12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764 |
- /**
- * @license
- * Cesium - https://github.com/CesiumGS/cesium
- * Version 1.96
- *
- * Copyright 2011-2022 Cesium Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Columbus View (Pat. Pend.)
- *
- * Portions licensed separately.
- * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
- */
- var qAe=Object.create;var dP=Object.defineProperty;var YAe=Object.getOwnPropertyDescriptor;var XAe=Object.getOwnPropertyNames;var KAe=Object.getPrototypeOf,$Ae=Object.prototype.hasOwnProperty;var un=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),MX=(e,t)=>{for(var n in t)dP(e,n,{get:t[n],enumerable:!0})},BX=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of XAe(t))!$Ae.call(e,r)&&r!==n&&dP(e,r,{get:()=>t[r],enumerable:!(i=YAe(t,r))||i.enumerable});return e};var Ns=(e,t,n)=>(n=e!=null?qAe(KAe(e)):{},BX(t||!e||!e.__esModule?dP(n,"default",{value:e,enumerable:!0}):n,e)),ZAe=e=>BX(dP({},"__esModule",{value:!0}),e);var FX=un((AAt,NX)=>{var Mm=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};Mm.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};Mm.prototype.init_by_array=function(e,t){var n,i,r;for(this.init_seed(19650218),n=1,i=0,r=this.N>t?this.N:t;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1664525<<16)+(o&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(r=this.N-1;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1566083941<<16)+(o&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};Mm.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};Mm.prototype.random_int31=function(){return this.random_int()>>>1};Mm.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Mm.prototype.random=function(){return this.random_int()*(1/4294967296)};Mm.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Mm.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};NX.exports=Mm});var KX=un((GC,WC)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof GC=="object"&&GC&&!GC.nodeType&&GC,n=typeof WC=="object"&&WC&&!WC.nodeType&&WC,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var r,o=2147483647,s=36,a=1,c=26,u=38,f=700,d=72,p=128,g="-",m=/^xn--/,x=/[^\x20-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,A={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=s-a,T=Math.floor,S=String.fromCharCode,w;function D(k){throw new RangeError(A[k])}function I(k,H){for(var V=k.length,q=[];V--;)q[V]=H(k[V]);return q}function O(k,H){var V=k.split("@"),q="";V.length>1&&(q=V[0]+"@",k=V[1]),k=k.replace(C,".");var j=k.split("."),X=I(j,H).join(".");return q+X}function B(k){for(var H=[],V=0,q=k.length,j,X;V<q;)j=k.charCodeAt(V++),j>=55296&&j<=56319&&V<q?(X=k.charCodeAt(V++),(X&64512)==56320?H.push(((j&1023)<<10)+(X&1023)+65536):(H.push(j),V--)):H.push(j);return H}function L(k){return I(k,function(H){var V="";return H>65535&&(H-=65536,V+=S(H>>>10&1023|55296),H=56320|H&1023),V+=S(H),V}).join("")}function _(k){return k-48<10?k-22:k-65<26?k-65:k-97<26?k-97:s}function E(k,H){return k+22+75*(k<26)-((H!=0)<<5)}function v(k,H,V){var q=0;for(k=V?T(k/f):k>>1,k+=T(k/H);k>b*c>>1;q+=s)k=T(k/b);return T(q+(b+1)*k/(k+u))}function P(k){var H=[],V=k.length,q,j=0,X=p,G=d,$,J,ce,de,ie,ae,_e,be,Te;for($=k.lastIndexOf(g),$<0&&($=0),J=0;J<$;++J)k.charCodeAt(J)>=128&&D("not-basic"),H.push(k.charCodeAt(J));for(ce=$>0?$+1:0;ce<V;){for(de=j,ie=1,ae=s;ce>=V&&D("invalid-input"),_e=_(k.charCodeAt(ce++)),(_e>=s||_e>T((o-j)/ie))&&D("overflow"),j+=_e*ie,be=ae<=G?a:ae>=G+c?c:ae-G,!(_e<be);ae+=s)Te=s-be,ie>T(o/Te)&&D("overflow"),ie*=Te;q=H.length+1,G=v(j-de,q,de==0),T(j/q)>o-X&&D("overflow"),X+=T(j/q),j%=q,H.splice(j++,0,X)}return L(H)}function R(k){var H,V,q,j,X,G,$,J,ce,de,ie,ae=[],_e,be,Te,Oe;for(k=B(k),_e=k.length,H=p,V=0,X=d,G=0;G<_e;++G)ie=k[G],ie<128&&ae.push(S(ie));for(q=j=ae.length,j&&ae.push(g);q<_e;){for($=o,G=0;G<_e;++G)ie=k[G],ie>=H&&ie<$&&($=ie);for(be=q+1,$-H>T((o-V)/be)&&D("overflow"),V+=($-H)*be,H=$,G=0;G<_e;++G)if(ie=k[G],ie<H&&++V>o&&D("overflow"),ie==H){for(J=V,ce=s;de=ce<=X?a:ce>=X+c?c:ce-X,!(J<de);ce+=s)Oe=J-de,Te=s-de,ae.push(S(E(de+Oe%Te,0))),J=T(Oe/Te);ae.push(S(E(J,0))),X=v(V,be,q==j),V=0,++q}++V,++H}return ae.join("")}function F(k){return O(k,function(H){return m.test(H)?P(H.slice(4).toLowerCase()):H})}function U(k){return O(k,function(H){return x.test(H)?"xn--"+R(H):H})}if(r={version:"1.3.2",ucs2:{decode:B,encode:L},decode:P,encode:R,toASCII:U,toUnicode:F},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return r});else if(t&&n)if(WC.exports==t)n.exports=r;else for(w in r)r.hasOwnProperty(w)&&(t[w]=r[w]);else e.punycode=r})(GC)});var ZX=un(($X,CP)=>{/*!
- * URI.js - Mutating URLs
- * IPv6 Support
- *
- * Version: 1.19.7
- *
- * Author: Rodney Rehm
- * Web: http://medialize.github.io/URI.js/
- *
- * Licensed under
- * MIT License http://www.opensource.org/licenses/mit-license
- *
- */(function(e,t){"use strict";typeof CP=="object"&&CP.exports?CP.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})($X,function(e){"use strict";var t=e&&e.IPv6;function n(r){var o=r.toLowerCase(),s=o.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var u;for(u=0;u<a&&s[u]!=="";u++);if(u<c)for(s.splice(u,1,"0000");s.length<c;)s.splice(u,0,"0000");for(var f,d=0;d<c;d++){f=s[d].split("");for(var p=0;p<3&&(f[0]==="0"&&f.length>1);p++)f.splice(0,1);s[d]=f.join("")}var g=-1,m=0,x=0,C=-1,A=!1;for(d=0;d<c;d++)A?s[d]==="0"?x+=1:(A=!1,x>m&&(g=C,m=x)):s[d]==="0"&&(A=!0,C=d,x=1);x>m&&(g=C,m=x),m>1&&s.splice(g,m,""),a=s.length;var b="";for(s[0]===""&&(b=":"),d=0;d<a&&(b+=s[d],d!==a-1);d++)b+=":";return s[a-1]===""&&(b+=":"),b}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var QX=un((JX,AP)=>{/*!
- * URI.js - Mutating URLs
- * Second Level Domain (SLD) Support
- *
- * Version: 1.19.7
- *
- * Author: Rodney Rehm
- * Web: http://medialize.github.io/URI.js/
- *
- * Licensed under
- * MIT License http://www.opensource.org/licenses/mit-license
- *
- */(function(e,t){"use strict";typeof AP=="object"&&AP.exports?AP.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(JX,function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(i){var r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return!1;var o=i.lastIndexOf(".",r-1);if(o<=0||o>=r-1)return!1;var s=n.list[i.slice(r+1)];return s?s.indexOf(" "+i.slice(o+1,r)+" ")>=0:!1},is:function(i){var r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return!1;var o=i.lastIndexOf(".",r-1);if(o>=0)return!1;var s=n.list[i.slice(r+1)];return s?s.indexOf(" "+i.slice(0,r)+" ")>=0:!1},get:function(i){var r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return null;var o=i.lastIndexOf(".",r-1);if(o<=0||o>=r-1)return null;var s=n.list[i.slice(r+1)];return!s||s.indexOf(" "+i.slice(o+1,r)+" ")<0?null:i.slice(o+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var tK=un((eK,TP)=>{/*!
- * URI.js - Mutating URLs
- *
- * Version: 1.19.7
- *
- * Author: Rodney Rehm
- * Web: http://medialize.github.io/URI.js/
- *
- * Licensed under
- * MIT License http://www.opensource.org/licenses/mit-license
- *
- */(function(e,t){"use strict";typeof TP=="object"&&TP.exports?TP.exports=t(KX(),ZX(),QX()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(eK,function(e,t,n,i){"use strict";var r=i&&i.URI;function o(E,v){var P=arguments.length>=1,R=arguments.length>=2;if(!(this instanceof o))return P?R?new o(E,v):new o(E):new o;if(E===void 0){if(P)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?E=location.href+"":E=""}if(E===null&&P)throw new TypeError("null is not a valid argument for URI");return this.href(E),v!==void 0?this.absoluteTo(v):this}function s(E){return/^[0-9]+$/.test(E)}o.version="1.19.7";var a=o.prototype,c=Object.prototype.hasOwnProperty;function u(E){return E.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(E){return E===void 0?"Undefined":String(Object.prototype.toString.call(E)).slice(8,-1)}function d(E){return f(E)==="Array"}function p(E,v){var P={},R,F;if(f(v)==="RegExp")P=null;else if(d(v))for(R=0,F=v.length;R<F;R++)P[v[R]]=!0;else P[v]=!0;for(R=0,F=E.length;R<F;R++){var U=P&&P[E[R]]!==void 0||!P&&v.test(E[R]);U&&(E.splice(R,1),F--,R--)}return E}function g(E,v){var P,R;if(d(v)){for(P=0,R=v.length;P<R;P++)if(!g(E,v[P]))return!1;return!0}var F=f(v);for(P=0,R=E.length;P<R;P++)if(F==="RegExp"){if(typeof E[P]=="string"&&E[P].match(v))return!0}else if(E[P]===v)return!0;return!1}function m(E,v){if(!d(E)||!d(v)||E.length!==v.length)return!1;E.sort(),v.sort();for(var P=0,R=E.length;P<R;P++)if(E[P]!==v[P])return!1;return!0}function x(E){var v=/^\/+|\/+$/g;return E.replace(v,"")}o._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:o.preventInvalidHostname,duplicateQueryParameters:o.duplicateQueryParameters,escapeQuerySpace:o.escapeQuerySpace}},o.preventInvalidHostname=!1,o.duplicateQueryParameters=!1,o.escapeQuerySpace=!0,o.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,o.idn_expression=/[^a-z0-9\._-]/i,o.punycode_expression=/(xn--)/i,o.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,o.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,o.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},o.getDomAttribute=function(E){if(!(!E||!E.nodeName)){var v=E.nodeName.toLowerCase();if(!(v==="input"&&E.type!=="image"))return o.domAttributes[v]}};function C(E){return escape(E)}function A(E){return encodeURIComponent(E).replace(/[!'()*]/g,C).replace(/\*/g,"%2A")}o.encode=A,o.decode=decodeURIComponent,o.iso8859=function(){o.encode=escape,o.decode=unescape},o.unicode=function(){o.encode=A,o.decode=decodeURIComponent},o.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},o.encodeQuery=function(E,v){var P=o.encode(E+"");return v===void 0&&(v=o.escapeQuerySpace),v?P.replace(/%20/g,"+"):P},o.decodeQuery=function(E,v){E+="",v===void 0&&(v=o.escapeQuerySpace);try{return o.decode(v?E.replace(/\+/g,"%20"):E)}catch{return E}};var b={encode:"encode",decode:"decode"},T,S=function(E,v){return function(P){try{return o[v](P+"").replace(o.characters[E][v].expression,function(R){return o.characters[E][v].map[R]})}catch{return P}}};for(T in b)o[T+"PathSegment"]=S("pathname",b[T]),o[T+"UrnPathSegment"]=S("urnpath",b[T]);var w=function(E,v,P){return function(R){var F;P?F=function(V){return o[v](o[P](V))}:F=o[v];for(var U=(R+"").split(E),k=0,H=U.length;k<H;k++)U[k]=F(U[k]);return U.join(E)}};o.decodePath=w("/","decodePathSegment"),o.decodeUrnPath=w(":","decodeUrnPathSegment"),o.recodePath=w("/","encodePathSegment","decode"),o.recodeUrnPath=w(":","encodeUrnPathSegment","decode"),o.encodeReserved=S("reserved","encode"),o.parse=function(E,v){var P;return v||(v={preventInvalidHostname:o.preventInvalidHostname}),P=E.indexOf("#"),P>-1&&(v.fragment=E.substring(P+1)||null,E=E.substring(0,P)),P=E.indexOf("?"),P>-1&&(v.query=E.substring(P+1)||null,E=E.substring(0,P)),E=E.replace(/^(https?|ftp|wss?)?:[/\\]*/,"$1://"),E.substring(0,2)==="//"?(v.protocol=null,E=E.substring(2),E=o.parseAuthority(E,v)):(P=E.indexOf(":"),P>-1&&(v.protocol=E.substring(0,P)||null,v.protocol&&!v.protocol.match(o.protocol_expression)?v.protocol=void 0:E.substring(P+1,P+3).replace(/\\/g,"/")==="//"?(E=E.substring(P+3),E=o.parseAuthority(E,v)):(E=E.substring(P+1),v.urn=!0))),v.path=E,v},o.parseHost=function(E,v){E||(E=""),E=E.replace(/\\/g,"/");var P=E.indexOf("/"),R,F;if(P===-1&&(P=E.length),E.charAt(0)==="[")R=E.indexOf("]"),v.hostname=E.substring(1,R)||null,v.port=E.substring(R+2,P)||null,v.port==="/"&&(v.port=null);else{var U=E.indexOf(":"),k=E.indexOf("/"),H=E.indexOf(":",U+1);H!==-1&&(k===-1||H<k)?(v.hostname=E.substring(0,P)||null,v.port=null):(F=E.substring(0,P).split(":"),v.hostname=F[0]||null,v.port=F[1]||null)}return v.hostname&&E.substring(P).charAt(0)!=="/"&&(P++,E="/"+E),v.preventInvalidHostname&&o.ensureValidHostname(v.hostname,v.protocol),v.port&&o.ensureValidPort(v.port),E.substring(P)||"/"},o.parseAuthority=function(E,v){return E=o.parseUserinfo(E,v),o.parseHost(E,v)},o.parseUserinfo=function(E,v){var P=E,R=E.indexOf("\\");R!==-1&&(E=E.replace(/\\/g,"/"));var F=E.indexOf("/"),U=E.lastIndexOf("@",F>-1?F:E.length-1),k;return U>-1&&(F===-1||U<F)?(k=E.substring(0,U).split(":"),v.username=k[0]?o.decode(k[0]):null,k.shift(),v.password=k[0]?o.decode(k.join(":")):null,E=P.substring(U+1)):(v.username=null,v.password=null),E},o.parseQuery=function(E,v){if(!E)return{};if(E=E.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!E)return{};for(var P={},R=E.split("&"),F=R.length,U,k,H,V=0;V<F;V++)U=R[V].split("="),k=o.decodeQuery(U.shift(),v),H=U.length?o.decodeQuery(U.join("="),v):null,k!=="__proto__"&&(c.call(P,k)?((typeof P[k]=="string"||P[k]===null)&&(P[k]=[P[k]]),P[k].push(H)):P[k]=H);return P},o.build=function(E){var v="",P=!1;return E.protocol&&(v+=E.protocol+":"),!E.urn&&(v||E.hostname)&&(v+="//",P=!0),v+=o.buildAuthority(E)||"",typeof E.path=="string"&&(E.path.charAt(0)!=="/"&&P&&(v+="/"),v+=E.path),typeof E.query=="string"&&E.query&&(v+="?"+E.query),typeof E.fragment=="string"&&E.fragment&&(v+="#"+E.fragment),v},o.buildHost=function(E){var v="";if(E.hostname)o.ip6_expression.test(E.hostname)?v+="["+E.hostname+"]":v+=E.hostname;else return"";return E.port&&(v+=":"+E.port),v},o.buildAuthority=function(E){return o.buildUserinfo(E)+o.buildHost(E)},o.buildUserinfo=function(E){var v="";return E.username&&(v+=o.encode(E.username)),E.password&&(v+=":"+o.encode(E.password)),v&&(v+="@"),v},o.buildQuery=function(E,v,P){var R="",F,U,k,H;for(U in E)if(U!=="__proto__"&&c.call(E,U))if(d(E[U]))for(F={},k=0,H=E[U].length;k<H;k++)E[U][k]!==void 0&&F[E[U][k]+""]===void 0&&(R+="&"+o.buildQueryParameter(U,E[U][k],P),v!==!0&&(F[E[U][k]+""]=!0));else E[U]!==void 0&&(R+="&"+o.buildQueryParameter(U,E[U],P));return R.substring(1)},o.buildQueryParameter=function(E,v,P){return o.encodeQuery(E,P)+(v!==null?"="+o.encodeQuery(v,P):"")},o.addQuery=function(E,v,P){if(typeof v=="object")for(var R in v)c.call(v,R)&&o.addQuery(E,R,v[R]);else if(typeof v=="string"){if(E[v]===void 0){E[v]=P;return}else typeof E[v]=="string"&&(E[v]=[E[v]]);d(P)||(P=[P]),E[v]=(E[v]||[]).concat(P)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},o.setQuery=function(E,v,P){if(typeof v=="object")for(var R in v)c.call(v,R)&&o.setQuery(E,R,v[R]);else if(typeof v=="string")E[v]=P===void 0?null:P;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},o.removeQuery=function(E,v,P){var R,F,U;if(d(v))for(R=0,F=v.length;R<F;R++)E[v[R]]=void 0;else if(f(v)==="RegExp")for(U in E)v.test(U)&&(E[U]=void 0);else if(typeof v=="object")for(U in v)c.call(v,U)&&o.removeQuery(E,U,v[U]);else if(typeof v=="string")P!==void 0?f(P)==="RegExp"?!d(E[v])&&P.test(E[v])?E[v]=void 0:E[v]=p(E[v],P):E[v]===String(P)&&(!d(P)||P.length===1)?E[v]=void 0:d(E[v])&&(E[v]=p(E[v],P)):E[v]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},o.hasQuery=function(E,v,P,R){switch(f(v)){case"String":break;case"RegExp":for(var F in E)if(c.call(E,F)&&v.test(F)&&(P===void 0||o.hasQuery(E,F,P)))return!0;return!1;case"Object":for(var U in v)if(c.call(v,U)&&!o.hasQuery(E,U,v[U]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(P)){case"Undefined":return v in E;case"Boolean":var k=Boolean(d(E[v])?E[v].length:E[v]);return P===k;case"Function":return!!P(E[v],v,E);case"Array":if(!d(E[v]))return!1;var H=R?g:m;return H(E[v],P);case"RegExp":return d(E[v])?R?g(E[v],P):!1:Boolean(E[v]&&E[v].match(P));case"Number":P=String(P);case"String":return d(E[v])?R?g(E[v],P):!1:E[v]===P;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},o.joinPaths=function(){for(var E=[],v=[],P=0,R=0;R<arguments.length;R++){var F=new o(arguments[R]);E.push(F);for(var U=F.segment(),k=0;k<U.length;k++)typeof U[k]=="string"&&v.push(U[k]),U[k]&&P++}if(!v.length||!P)return new o("");var H=new o("").segment(v);return(E[0].path()===""||E[0].path().slice(0,1)==="/")&&H.path("/"+H.path()),H.normalize()},o.commonPath=function(E,v){var P=Math.min(E.length,v.length),R;for(R=0;R<P;R++)if(E.charAt(R)!==v.charAt(R)){R--;break}return R<1?E.charAt(0)===v.charAt(0)&&E.charAt(0)==="/"?"/":"":((E.charAt(R)!=="/"||v.charAt(R)!=="/")&&(R=E.substring(0,R).lastIndexOf("/")),E.substring(0,R+1))},o.withinString=function(E,v,P){P||(P={});var R=P.start||o.findUri.start,F=P.end||o.findUri.end,U=P.trim||o.findUri.trim,k=P.parens||o.findUri.parens,H=/[a-z0-9-]=["']?$/i;for(R.lastIndex=0;;){var V=R.exec(E);if(!V)break;var q=V.index;if(P.ignoreHtml){var j=E.slice(Math.max(q-3,0),q);if(j&&H.test(j))continue}for(var X=q+E.slice(q).search(F),G=E.slice(q,X),$=-1;;){var J=k.exec(G);if(!J)break;var ce=J.index+J[0].length;$=Math.max($,ce)}if($>-1?G=G.slice(0,$)+G.slice($).replace(U,""):G=G.replace(U,""),!(G.length<=V[0].length)&&!(P.ignore&&P.ignore.test(G))){X=q+G.length;var de=v(G,q,X,E);if(de===void 0){R.lastIndex=X;continue}de=String(de),E=E.slice(0,q)+de+E.slice(X),R.lastIndex=q+de.length}}return R.lastIndex=0,E},o.ensureValidHostname=function(E,v){var P=!!E,R=!!v,F=!1;if(R&&(F=g(o.hostProtocols,v)),F&&!P)throw new TypeError("Hostname cannot be empty, if protocol is "+v);if(E&&E.match(o.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(E).match(o.invalid_hostname_characters))throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-:_]')}},o.ensureValidPort=function(E){if(!!E){var v=Number(E);if(!(s(v)&&v>0&&v<65536))throw new TypeError('Port "'+E+'" is not a valid port')}},o.noConflict=function(E){if(E){var v={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(v.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(v.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(v.SecondLevelDomains=i.SecondLevelDomains.noConflict()),v}else i.URI===this&&(i.URI=r);return this},a.build=function(E){return E===!0?this._deferred_build=!0:(E===void 0||this._deferred_build)&&(this._string=o.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new o(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function D(E){return function(v,P){return v===void 0?this._parts[E]||"":(this._parts[E]=v||null,this.build(!P),this)}}function I(E,v){return function(P,R){return P===void 0?this._parts[E]||"":(P!==null&&(P=P+"",P.charAt(0)===v&&(P=P.substring(1))),this._parts[E]=P,this.build(!R),this)}}a.protocol=D("protocol"),a.username=D("username"),a.password=D("password"),a.hostname=D("hostname"),a.port=D("port"),a.query=I("query","?"),a.fragment=I("fragment","#"),a.search=function(E,v){var P=this.query(E,v);return typeof P=="string"&&P.length?"?"+P:P},a.hash=function(E,v){var P=this.fragment(E,v);return typeof P=="string"&&P.length?"#"+P:P},a.pathname=function(E,v){if(E===void 0||E===!0){var P=this._parts.path||(this._parts.hostname?"/":"");return E?(this._parts.urn?o.decodeUrnPath:o.decodePath)(P):P}else return this._parts.urn?this._parts.path=E?o.recodeUrnPath(E):"":this._parts.path=E?o.recodePath(E):"/",this.build(!v),this},a.path=a.pathname,a.href=function(E,v){var P;if(E===void 0)return this.toString();this._string="",this._parts=o._parts();var R=E instanceof o,F=typeof E=="object"&&(E.hostname||E.path||E.pathname);if(E.nodeName){var U=o.getDomAttribute(E);E=E[U]||"",F=!1}if(!R&&F&&E.pathname!==void 0&&(E=E.toString()),typeof E=="string"||E instanceof String)this._parts=o.parse(String(E),this._parts);else if(R||F){var k=R?E._parts:E;for(P in k)P!=="query"&&c.call(this._parts,P)&&(this._parts[P]=k[P]);k.query&&this.query(k.query,!1)}else throw new TypeError("invalid input");return this.build(!v),this},a.is=function(E){var v=!1,P=!1,R=!1,F=!1,U=!1,k=!1,H=!1,V=!this._parts.urn;switch(this._parts.hostname&&(V=!1,P=o.ip4_expression.test(this._parts.hostname),R=o.ip6_expression.test(this._parts.hostname),v=P||R,F=!v,U=F&&n&&n.has(this._parts.hostname),k=F&&o.idn_expression.test(this._parts.hostname),H=F&&o.punycode_expression.test(this._parts.hostname)),E.toLowerCase()){case"relative":return V;case"absolute":return!V;case"domain":case"name":return F;case"sld":return U;case"ip":return v;case"ip4":case"ipv4":case"inet4":return P;case"ip6":case"ipv6":case"inet6":return R;case"idn":return k;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return H}return null};var O=a.protocol,B=a.port,L=a.hostname;a.protocol=function(E,v){if(E&&(E=E.replace(/:(\/\/)?$/,""),!E.match(o.protocol_expression)))throw new TypeError('Protocol "'+E+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return O.call(this,E,v)},a.scheme=a.protocol,a.port=function(E,v){return this._parts.urn?E===void 0?"":this:(E!==void 0&&(E===0&&(E=null),E&&(E+="",E.charAt(0)===":"&&(E=E.substring(1)),o.ensureValidPort(E))),B.call(this,E,v))},a.hostname=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E!==void 0){var P={preventInvalidHostname:this._parts.preventInvalidHostname},R=o.parseHost(E,P);if(R!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');E=P.hostname,this._parts.preventInvalidHostname&&o.ensureValidHostname(E,this._parts.protocol)}return L.call(this,E,v)},a.origin=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E===void 0){var P=this.protocol(),R=this.authority();return R?(P?P+"://":"")+this.authority():""}else{var F=o(E);return this.protocol(F.protocol()).authority(F.authority()).build(!v),this}},a.host=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E===void 0)return this._parts.hostname?o.buildHost(this._parts):"";var P=o.parseHost(E,this._parts);if(P!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');return this.build(!v),this},a.authority=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E===void 0)return this._parts.hostname?o.buildAuthority(this._parts):"";var P=o.parseAuthority(E,this._parts);if(P!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');return this.build(!v),this},a.userinfo=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E===void 0){var P=o.buildUserinfo(this._parts);return P&&P.substring(0,P.length-1)}else return E[E.length-1]!=="@"&&(E+="@"),o.parseUserinfo(E,this._parts),this.build(!v),this},a.resource=function(E,v){var P;return E===void 0?this.path()+this.search()+this.hash():(P=o.parse(E),this._parts.path=P.path,this._parts.query=P.query,this._parts.fragment=P.fragment,this.build(!v),this)},a.subdomain=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,P)||""}else{var R=this._parts.hostname.length-this.domain().length,F=this._parts.hostname.substring(0,R),U=new RegExp("^"+u(F));if(E&&E.charAt(E.length-1)!=="."&&(E+="."),E.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return E&&o.ensureValidHostname(E,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(U,E),this.build(!v),this}},a.domain=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(typeof E=="boolean"&&(v=E,E=void 0),E===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.match(/\./g);if(P&&P.length<2)return this._parts.hostname;var R=this._parts.hostname.length-this.tld(v).length-1;return R=this._parts.hostname.lastIndexOf(".",R-1)+1,this._parts.hostname.substring(R)||""}else{if(!E)throw new TypeError("cannot set domain empty");if(E.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(o.ensureValidHostname(E,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=E;else{var F=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(F,E)}return this.build(!v),this}},a.tld=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(typeof E=="boolean"&&(v=E,E=void 0),E===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.lastIndexOf("."),R=this._parts.hostname.substring(P+1);return v!==!0&&n&&n.list[R.toLowerCase()]&&n.get(this._parts.hostname)||R}else{var F;if(E)if(E.match(/[^a-zA-Z0-9-]/))if(n&&n.is(E))F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,E);else throw new TypeError('TLD "'+E+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,E)}else throw new TypeError("cannot set TLD empty");return this.build(!v),this}},a.directory=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E===void 0||E===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var P=this._parts.path.length-this.filename().length-1,R=this._parts.path.substring(0,P)||(this._parts.hostname?"/":"");return E?o.decodePath(R):R}else{var F=this._parts.path.length-this.filename().length,U=this._parts.path.substring(0,F),k=new RegExp("^"+u(U));return this.is("relative")||(E||(E="/"),E.charAt(0)!=="/"&&(E="/"+E)),E&&E.charAt(E.length-1)!=="/"&&(E+="/"),E=o.recodePath(E),this._parts.path=this._parts.path.replace(k,E),this.build(!v),this}},a.filename=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(typeof E!="string"){if(!this._parts.path||this._parts.path==="/")return"";var P=this._parts.path.lastIndexOf("/"),R=this._parts.path.substring(P+1);return E?o.decodePathSegment(R):R}else{var F=!1;E.charAt(0)==="/"&&(E=E.substring(1)),E.match(/\.?\//)&&(F=!0);var U=new RegExp(u(this.filename())+"$");return E=o.recodePath(E),this._parts.path=this._parts.path.replace(U,E),F?this.normalizePath(v):this.build(!v),this}},a.suffix=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E===void 0||E===!0){if(!this._parts.path||this._parts.path==="/")return"";var P=this.filename(),R=P.lastIndexOf("."),F,U;return R===-1?"":(F=P.substring(R+1),U=/^[a-z0-9%]+$/i.test(F)?F:"",E?o.decodePathSegment(U):U)}else{E.charAt(0)==="."&&(E=E.substring(1));var k=this.suffix(),H;if(k)E?H=new RegExp(u(k)+"$"):H=new RegExp(u("."+k)+"$");else{if(!E)return this;this._parts.path+="."+o.recodePath(E)}return H&&(E=o.recodePath(E),this._parts.path=this._parts.path.replace(H,E)),this.build(!v),this}},a.segment=function(E,v,P){var R=this._parts.urn?":":"/",F=this.path(),U=F.substring(0,1)==="/",k=F.split(R);if(E!==void 0&&typeof E!="number"&&(P=v,v=E,E=void 0),E!==void 0&&typeof E!="number")throw new Error('Bad segment "'+E+'", must be 0-based integer');if(U&&k.shift(),E<0&&(E=Math.max(k.length+E,0)),v===void 0)return E===void 0?k:k[E];if(E===null||k[E]===void 0)if(d(v)){k=[];for(var H=0,V=v.length;H<V;H++)!v[H].length&&(!k.length||!k[k.length-1].length)||(k.length&&!k[k.length-1].length&&k.pop(),k.push(x(v[H])))}else(v||typeof v=="string")&&(v=x(v),k[k.length-1]===""?k[k.length-1]=v:k.push(v));else v?k[E]=x(v):k.splice(E,1);return U&&k.unshift(""),this.path(k.join(R),P)},a.segmentCoded=function(E,v,P){var R,F,U;if(typeof E!="number"&&(P=v,v=E,E=void 0),v===void 0){if(R=this.segment(E,v,P),!d(R))R=R!==void 0?o.decode(R):void 0;else for(F=0,U=R.length;F<U;F++)R[F]=o.decode(R[F]);return R}if(!d(v))v=typeof v=="string"||v instanceof String?o.encode(v):v;else for(F=0,U=v.length;F<U;F++)v[F]=o.encode(v[F]);return this.segment(E,v,P)};var _=a.query;return a.query=function(E,v){if(E===!0)return o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof E=="function"){var P=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace),R=E.call(this,P);return this._parts.query=o.buildQuery(R||P,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!v),this}else return E!==void 0&&typeof E!="string"?(this._parts.query=o.buildQuery(E,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!v),this):_.call(this,E,v)},a.setQuery=function(E,v,P){var R=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof E=="string"||E instanceof String)R[E]=v!==void 0?v:null;else if(typeof E=="object")for(var F in E)c.call(E,F)&&(R[F]=E[F]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=o.buildQuery(R,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof E!="string"&&(P=v),this.build(!P),this},a.addQuery=function(E,v,P){var R=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.addQuery(R,E,v===void 0?null:v),this._parts.query=o.buildQuery(R,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof E!="string"&&(P=v),this.build(!P),this},a.removeQuery=function(E,v,P){var R=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.removeQuery(R,E,v),this._parts.query=o.buildQuery(R,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof E!="string"&&(P=v),this.build(!P),this},a.hasQuery=function(E,v,P){var R=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.hasQuery(R,E,v,P)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(E){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!E)),this},a.normalizeHostname=function(E){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!E)),this},a.normalizePort=function(E){return typeof this._parts.protocol=="string"&&this._parts.port===o.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!E)),this},a.normalizePath=function(E){var v=this._parts.path;if(!v)return this;if(this._parts.urn)return this._parts.path=o.recodeUrnPath(this._parts.path),this.build(!E),this;if(this._parts.path==="/")return this;v=o.recodePath(v);var P,R="",F,U;for(v.charAt(0)!=="/"&&(P=!0,v="/"+v),(v.slice(-3)==="/.."||v.slice(-2)==="/.")&&(v+="/"),v=v.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),P&&(R=v.substring(1).match(/^(\.\.\/)+/)||"",R&&(R=R[0]));F=v.search(/\/\.\.(\/|$)/),F!==-1;){if(F===0){v=v.substring(3);continue}U=v.substring(0,F).lastIndexOf("/"),U===-1&&(U=F),v=v.substring(0,U)+v.substring(F+3)}return P&&this.is("relative")&&(v=R+v.substring(1)),this._parts.path=v,this.build(!E),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(E){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(o.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!E)),this},a.normalizeFragment=function(E){return this._parts.fragment||(this._parts.fragment=null,this.build(!E)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var E=o.encode,v=o.decode;o.encode=escape,o.decode=decodeURIComponent;try{this.normalize()}finally{o.encode=E,o.decode=v}return this},a.unicode=function(){var E=o.encode,v=o.decode;o.encode=A,o.decode=unescape;try{this.normalize()}finally{o.encode=E,o.decode=v}return this},a.readable=function(){var E=this.clone();E.username("").password("").normalize();var v="";if(E._parts.protocol&&(v+=E._parts.protocol+"://"),E._parts.hostname&&(E.is("punycode")&&e?(v+=e.toUnicode(E._parts.hostname),E._parts.port&&(v+=":"+E._parts.port)):v+=E.host()),E._parts.hostname&&E._parts.path&&E._parts.path.charAt(0)!=="/"&&(v+="/"),v+=E.path(!0),E._parts.query){for(var P="",R=0,F=E._parts.query.split("&"),U=F.length;R<U;R++){var k=(F[R]||"").split("=");P+="&"+o.decodeQuery(k[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),k[1]!==void 0&&(P+="="+o.decodeQuery(k[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}v+="?"+P.substring(1)}return v+=o.decodeQuery(E.hash(),!0),v},a.absoluteTo=function(E){var v=this.clone(),P=["protocol","username","password","hostname","port"],R,F,U;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(E instanceof o||(E=new o(E)),v._parts.protocol||(v._parts.protocol=E._parts.protocol,this._parts.hostname))return v;for(F=0;U=P[F];F++)v._parts[U]=E._parts[U];return v._parts.path?(v._parts.path.substring(-2)===".."&&(v._parts.path+="/"),v.path().charAt(0)!=="/"&&(R=E.directory(),R=R||(E.path().indexOf("/")===0?"/":""),v._parts.path=(R?R+"/":"")+v._parts.path,v.normalizePath())):(v._parts.path=E._parts.path,v._parts.query||(v._parts.query=E._parts.query)),v.build(),v},a.relativeTo=function(E){var v=this.clone().normalize(),P,R,F,U,k;if(v._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(E=new o(E).normalize(),P=v._parts,R=E._parts,U=v.path(),k=E.path(),U.charAt(0)!=="/")throw new Error("URI is already relative");if(k.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(P.protocol===R.protocol&&(P.protocol=null),P.username!==R.username||P.password!==R.password||P.protocol!==null||P.username!==null||P.password!==null)return v.build();if(P.hostname===R.hostname&&P.port===R.port)P.hostname=null,P.port=null;else return v.build();if(U===k)return P.path="",v.build();if(F=o.commonPath(U,k),!F)return v.build();var H=R.path.substring(F.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return P.path=H+P.path.substring(F.length)||"./",v.build()},a.equals=function(E){var v=this.clone(),P=new o(E),R={},F={},U={},k,H,V;if(v.normalize(),P.normalize(),v.toString()===P.toString())return!0;if(k=v.query(),H=P.query(),v.query(""),P.query(""),v.toString()!==P.toString()||k.length!==H.length)return!1;R=o.parseQuery(k,this._parts.escapeQuerySpace),F=o.parseQuery(H,this._parts.escapeQuerySpace);for(V in R)if(c.call(R,V)){if(d(R[V])){if(!m(R[V],F[V]))return!1}else if(R[V]!==F[V])return!1;U[V]=!0}for(V in F)if(c.call(F,V)&&!U[V])return!1;return!0},a.preventInvalidHostname=function(E){return this._parts.preventInvalidHostname=!!E,this},a.duplicateQueryParameters=function(E){return this._parts.duplicateQueryParameters=!!E,this},a.escapeQuerySpace=function(E){return this._parts.escapeQuerySpace=!!E,this},o})});var NK=un((uwt,LK)=>{"use strict";/*! @license DOMPurify 2.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.3/LICENSE */function Hbe(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}else return Array.from(e)}var Gbe=Object.hasOwnProperty,SK=Object.setPrototypeOf,Wbe=Object.isFrozen,jbe=Object.getPrototypeOf,qbe=Object.getOwnPropertyDescriptor,fc=Object.freeze,Fm=Object.seal,Ybe=Object.create,MK=typeof Reflect<"u"&&Reflect,LP=MK.apply,lH=MK.construct;LP||(LP=function(t,n,i){return t.apply(n,i)});fc||(fc=function(t){return t});Fm||(Fm=function(t){return t});lH||(lH=function(t,n){return new(Function.prototype.bind.apply(t,[null].concat(Hbe(n))))});var Xbe=jf(Array.prototype.forEach),wK=jf(Array.prototype.pop),uS=jf(Array.prototype.push),BP=jf(String.prototype.toLowerCase),vK=jf(String.prototype.match),__=jf(String.prototype.replace),Kbe=jf(String.prototype.indexOf),$be=jf(String.prototype.trim),Nm=jf(RegExp.prototype.test),DK=Zbe(TypeError);function jf(e){return function(t){for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return LP(e,t,i)}}function Zbe(e){return function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return lH(e,n)}}function _i(e,t){SK&&SK(e,null);for(var n=t.length;n--;){var i=t[n];if(typeof i=="string"){var r=BP(i);r!==i&&(Wbe(t)||(t[n]=r),i=r)}e[i]=!0}return e}function cy(e){var t=Ybe(null),n=void 0;for(n in e)LP(Gbe,e,[n])&&(t[n]=e[n]);return t}function RP(e,t){for(;e!==null;){var n=qbe(e,t);if(n){if(n.get)return jf(n.get);if(typeof n.value=="function")return jf(n.value)}e=jbe(e)}function i(r){return console.warn("fallback value for",r),null}return i}var PK=fc(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),oH=fc(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),sH=fc(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Jbe=fc(["animate","color-profile","cursor","discard","fedropshadow","feimage","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),aH=fc(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),Qbe=fc(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),IK=fc(["#text"]),OK=fc(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),cH=fc(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),RK=fc(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),MP=fc(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),eEe=Fm(/\{\{[\s\S]*|[\s\S]*\}\}/gm),tEe=Fm(/<%[\s\S]*|[\s\S]*%>/gm),nEe=Fm(/^data-[\-\w.\u00B7-\uFFFF]/),iEe=Fm(/^aria-[\-\w]+$/),rEe=Fm(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),oEe=Fm(/^(?:\w+script|data):/i),sEe=Fm(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),fS=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function dh(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}else return Array.from(e)}var aEe=function(){return typeof window>"u"?null:window},cEe=function(t,n){if((typeof t>"u"?"undefined":fS(t))!=="object"||typeof t.createPolicy!="function")return null;var i=null,r="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(r)&&(i=n.currentScript.getAttribute(r));var o="dompurify"+(i?"#"+i:"");try{return t.createPolicy(o,{createHTML:function(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function BK(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:aEe(),t=function(ve){return BK(ve)};if(t.version="2.3.3",t.removed=[],!e||!e.document||e.document.nodeType!==9)return t.isSupported=!1,t;var n=e.document,i=e.document,r=e.DocumentFragment,o=e.HTMLTemplateElement,s=e.Node,a=e.Element,c=e.NodeFilter,u=e.NamedNodeMap,f=u===void 0?e.NamedNodeMap||e.MozNamedAttrMap:u,d=e.Text,p=e.Comment,g=e.DOMParser,m=e.trustedTypes,x=a.prototype,C=RP(x,"cloneNode"),A=RP(x,"nextSibling"),b=RP(x,"childNodes"),T=RP(x,"parentNode");if(typeof o=="function"){var S=i.createElement("template");S.content&&S.content.ownerDocument&&(i=S.content.ownerDocument)}var w=cEe(m,n),D=w&&Pt?w.createHTML(""):"",I=i,O=I.implementation,B=I.createNodeIterator,L=I.createDocumentFragment,_=I.getElementsByTagName,E=n.importNode,v={};try{v=cy(i).documentMode?i.documentMode:{}}catch{}var P={};t.isSupported=typeof T=="function"&&O&&typeof O.createHTMLDocument<"u"&&v!==9;var R=eEe,F=tEe,U=nEe,k=iEe,H=oEe,V=sEe,q=rEe,j=null,X=_i({},[].concat(dh(PK),dh(oH),dh(sH),dh(aH),dh(IK))),G=null,$=_i({},[].concat(dh(OK),dh(cH),dh(RK),dh(MP))),J=null,ce=null,de=!0,ie=!0,ae=!1,_e=!1,be=!1,Te=!1,Oe=!1,Be=!1,tt=!1,lt=!0,Pt=!1,ht=!0,wn=!0,ii=!1,nt={},Mt=null,ri=_i({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),we=null,_t=_i({},["audio","video","img","source","image","track"]),Yt=null,Gi=_i({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ti="http://www.w3.org/1998/Math/MathML",Br="http://www.w3.org/2000/svg",or="http://www.w3.org/1999/xhtml",Lr=or,Pi=!1,gr=void 0,Ia=["application/xhtml+xml","text/html"],He="text/html",We=void 0,Ue=null,Je=i.createElement("form"),gt=function(ve){Ue&&Ue===ve||((!ve||(typeof ve>"u"?"undefined":fS(ve))!=="object")&&(ve={}),ve=cy(ve),j="ALLOWED_TAGS"in ve?_i({},ve.ALLOWED_TAGS):X,G="ALLOWED_ATTR"in ve?_i({},ve.ALLOWED_ATTR):$,Yt="ADD_URI_SAFE_ATTR"in ve?_i(cy(Gi),ve.ADD_URI_SAFE_ATTR):Gi,we="ADD_DATA_URI_TAGS"in ve?_i(cy(_t),ve.ADD_DATA_URI_TAGS):_t,Mt="FORBID_CONTENTS"in ve?_i({},ve.FORBID_CONTENTS):ri,J="FORBID_TAGS"in ve?_i({},ve.FORBID_TAGS):{},ce="FORBID_ATTR"in ve?_i({},ve.FORBID_ATTR):{},nt="USE_PROFILES"in ve?ve.USE_PROFILES:!1,de=ve.ALLOW_ARIA_ATTR!==!1,ie=ve.ALLOW_DATA_ATTR!==!1,ae=ve.ALLOW_UNKNOWN_PROTOCOLS||!1,_e=ve.SAFE_FOR_TEMPLATES||!1,be=ve.WHOLE_DOCUMENT||!1,Be=ve.RETURN_DOM||!1,tt=ve.RETURN_DOM_FRAGMENT||!1,lt=ve.RETURN_DOM_IMPORT!==!1,Pt=ve.RETURN_TRUSTED_TYPE||!1,Oe=ve.FORCE_BODY||!1,ht=ve.SANITIZE_DOM!==!1,wn=ve.KEEP_CONTENT!==!1,ii=ve.IN_PLACE||!1,q=ve.ALLOWED_URI_REGEXP||q,Lr=ve.NAMESPACE||or,gr=Ia.indexOf(ve.PARSER_MEDIA_TYPE)===-1?gr=He:gr=ve.PARSER_MEDIA_TYPE,We=gr==="application/xhtml+xml"?function(ut){return ut}:BP,_e&&(ie=!1),tt&&(Be=!0),nt&&(j=_i({},[].concat(dh(IK))),G=[],nt.html===!0&&(_i(j,PK),_i(G,OK)),nt.svg===!0&&(_i(j,oH),_i(G,cH),_i(G,MP)),nt.svgFilters===!0&&(_i(j,sH),_i(G,cH),_i(G,MP)),nt.mathMl===!0&&(_i(j,aH),_i(G,RK),_i(G,MP))),ve.ADD_TAGS&&(j===X&&(j=cy(j)),_i(j,ve.ADD_TAGS)),ve.ADD_ATTR&&(G===$&&(G=cy(G)),_i(G,ve.ADD_ATTR)),ve.ADD_URI_SAFE_ATTR&&_i(Yt,ve.ADD_URI_SAFE_ATTR),ve.FORBID_CONTENTS&&(Mt===ri&&(Mt=cy(Mt)),_i(Mt,ve.FORBID_CONTENTS)),wn&&(j["#text"]=!0),be&&_i(j,["html","head","body"]),j.table&&(_i(j,["tbody"]),delete J.tbody),fc&&fc(ve),Ue=ve)},cn=_i({},["mi","mo","mn","ms","mtext"]),Rn=_i({},["foreignobject","desc","title","annotation-xml"]),$i=_i({},oH);_i($i,sH),_i($i,Jbe);var Nr=_i({},aH);_i(Nr,Qbe);var zo=function(ve){var ut=T(ve);(!ut||!ut.tagName)&&(ut={namespaceURI:or,tagName:"template"});var sn=BP(ve.tagName),Zn=BP(ut.tagName);if(ve.namespaceURI===Br)return ut.namespaceURI===or?sn==="svg":ut.namespaceURI===ti?sn==="svg"&&(Zn==="annotation-xml"||cn[Zn]):Boolean($i[sn]);if(ve.namespaceURI===ti)return ut.namespaceURI===or?sn==="math":ut.namespaceURI===Br?sn==="math"&&Rn[Zn]:Boolean(Nr[sn]);if(ve.namespaceURI===or){if(ut.namespaceURI===Br&&!Rn[Zn]||ut.namespaceURI===ti&&!cn[Zn])return!1;var go=_i({},["title","style","font","a","script"]);return!Nr[sn]&&(go[sn]||!$i[sn])}return!1},$n=function(ve){uS(t.removed,{element:ve});try{ve.parentNode.removeChild(ve)}catch{try{ve.outerHTML=D}catch{ve.remove()}}},Ho=function(ve,ut){try{uS(t.removed,{attribute:ut.getAttributeNode(ve),from:ut})}catch{uS(t.removed,{attribute:null,from:ut})}if(ut.removeAttribute(ve),ve==="is"&&!G[ve])if(Be||tt)try{$n(ut)}catch{}else try{ut.setAttribute(ve,"")}catch{}},Go=function(ve){var ut=void 0,sn=void 0;if(Oe)ve="<remove></remove>"+ve;else{var Zn=vK(ve,/^[\r\n\t ]+/);sn=Zn&&Zn[0]}gr==="application/xhtml+xml"&&(ve='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ve+"</body></html>");var go=w?w.createHTML(ve):ve;if(Lr===or)try{ut=new g().parseFromString(go,gr)}catch{}if(!ut||!ut.documentElement){ut=O.createDocument(Lr,"template",null);try{ut.documentElement.innerHTML=Pi?"":go}catch{}}var io=ut.body||ut.documentElement;return ve&&sn&&io.insertBefore(i.createTextNode(sn),io.childNodes[0]||null),Lr===or?_.call(ut,be?"html":"body")[0]:be?ut.documentElement:io},lc=function(ve){return B.call(ve.ownerDocument||ve,ve,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},jr=function(ve){return ve instanceof d||ve instanceof p?!1:typeof ve.nodeName!="string"||typeof ve.textContent!="string"||typeof ve.removeChild!="function"||!(ve.attributes instanceof f)||typeof ve.removeAttribute!="function"||typeof ve.setAttribute!="function"||typeof ve.namespaceURI!="string"||typeof ve.insertBefore!="function"},Fr=function(ve){return(typeof s>"u"?"undefined":fS(s))==="object"?ve instanceof s:ve&&(typeof ve>"u"?"undefined":fS(ve))==="object"&&typeof ve.nodeType=="number"&&typeof ve.nodeName=="string"},Po=function(ve,ut,sn){!P[ve]||Xbe(P[ve],function(Zn){Zn.call(t,ut,sn,Ue)})},Kc=function(ve){var ut=void 0;if(Po("beforeSanitizeElements",ve,null),jr(ve)||vK(ve.nodeName,/[\u0080-\uFFFF]/))return $n(ve),!0;var sn=We(ve.nodeName);if(Po("uponSanitizeElement",ve,{tagName:sn,allowedTags:j}),!Fr(ve.firstElementChild)&&(!Fr(ve.content)||!Fr(ve.content.firstElementChild))&&Nm(/<[/\w]/g,ve.innerHTML)&&Nm(/<[/\w]/g,ve.textContent)||sn==="select"&&Nm(/<template/i,ve.innerHTML))return $n(ve),!0;if(!j[sn]||J[sn]){if(wn&&!Mt[sn]){var Zn=T(ve)||ve.parentNode,go=b(ve)||ve.childNodes;if(go&&Zn)for(var io=go.length,wr=io-1;wr>=0;--wr)Zn.insertBefore(C(go[wr],!0),A(ve))}return $n(ve),!0}return ve instanceof a&&!zo(ve)||(sn==="noscript"||sn==="noembed")&&Nm(/<\/no(script|embed)/i,ve.innerHTML)?($n(ve),!0):(_e&&ve.nodeType===3&&(ut=ve.textContent,ut=__(ut,R," "),ut=__(ut,F," "),ve.textContent!==ut&&(uS(t.removed,{element:ve.cloneNode()}),ve.textContent=ut)),Po("afterSanitizeElements",ve,null),!1)},Ls=function(ve,ut,sn){if(ht&&(ut==="id"||ut==="name")&&(sn in i||sn in Je))return!1;if(!(ie&&!ce[ut]&&Nm(U,ut))){if(!(de&&Nm(k,ut))){if(!G[ut]||ce[ut])return!1;if(!Yt[ut]){if(!Nm(q,__(sn,V,""))){if(!((ut==="src"||ut==="xlink:href"||ut==="href")&&ve!=="script"&&Kbe(sn,"data:")===0&&we[ve])){if(!(ae&&!Nm(H,__(sn,V,"")))){if(sn)return!1}}}}}}return!0},ca=function(ve){var ut=void 0,sn=void 0,Zn=void 0,go=void 0;Po("beforeSanitizeAttributes",ve,null);var io=ve.attributes;if(!!io){var wr={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:G};for(go=io.length;go--;){ut=io[go];var Ll=ut,ny=Ll.name,M8=Ll.namespaceURI;if(sn=$be(ut.value),Zn=We(ny),wr.attrName=Zn,wr.attrValue=sn,wr.keepAttr=!0,wr.forceKeepAttr=void 0,Po("uponSanitizeAttribute",ve,wr),sn=wr.attrValue,!wr.forceKeepAttr&&(Ho(ny,ve),!!wr.keepAttr)){if(Nm(/\/>/i,sn)){Ho(ny,ve);continue}_e&&(sn=__(sn,R," "),sn=__(sn,F," "));var jAe=We(ve.nodeName);if(!!Ls(jAe,Zn,sn))try{M8?ve.setAttributeNS(M8,ny,sn):ve.setAttribute(ny,sn),wK(t.removed)}catch{}}}Po("afterSanitizeAttributes",ve,null)}},FC=function vt(ve){var ut=void 0,sn=lc(ve);for(Po("beforeSanitizeShadowDOM",ve,null);ut=sn.nextNode();)Po("uponSanitizeShadowNode",ut,null),!Kc(ut)&&(ut.content instanceof r&&vt(ut.content),ca(ut));Po("afterSanitizeShadowDOM",ve,null)};return t.sanitize=function(vt,ve){var ut=void 0,sn=void 0,Zn=void 0,go=void 0,io=void 0;if(Pi=!vt,Pi&&(vt="<!-->"),typeof vt!="string"&&!Fr(vt)){if(typeof vt.toString!="function")throw DK("toString is not a function");if(vt=vt.toString(),typeof vt!="string")throw DK("dirty is not a string, aborting")}if(!t.isSupported){if(fS(e.toStaticHTML)==="object"||typeof e.toStaticHTML=="function"){if(typeof vt=="string")return e.toStaticHTML(vt);if(Fr(vt))return e.toStaticHTML(vt.outerHTML)}return vt}if(Te||gt(ve),t.removed=[],typeof vt=="string"&&(ii=!1),!ii)if(vt instanceof s)ut=Go("<!---->"),sn=ut.ownerDocument.importNode(vt,!0),sn.nodeType===1&&sn.nodeName==="BODY"||sn.nodeName==="HTML"?ut=sn:ut.appendChild(sn);else{if(!Be&&!_e&&!be&&vt.indexOf("<")===-1)return w&&Pt?w.createHTML(vt):vt;if(ut=Go(vt),!ut)return Be?null:D}ut&&Oe&&$n(ut.firstChild);for(var wr=lc(ii?vt:ut);Zn=wr.nextNode();)Zn.nodeType===3&&Zn===go||Kc(Zn)||(Zn.content instanceof r&&FC(Zn.content),ca(Zn),go=Zn);if(go=null,ii)return vt;if(Be){if(tt)for(io=L.call(ut.ownerDocument);ut.firstChild;)io.appendChild(ut.firstChild);else io=ut;return lt&&(io=E.call(n,io,!0)),io}var Ll=be?ut.outerHTML:ut.innerHTML;return _e&&(Ll=__(Ll,R," "),Ll=__(Ll,F," ")),w&&Pt?w.createHTML(Ll):Ll},t.setConfig=function(vt){gt(vt),Te=!0},t.clearConfig=function(){Ue=null,Te=!1},t.isValidAttribute=function(vt,ve,ut){Ue||gt({});var sn=We(vt),Zn=We(ve);return Ls(sn,Zn,ut)},t.addHook=function(vt,ve){typeof ve=="function"&&(P[vt]=P[vt]||[],uS(P[vt],ve))},t.removeHook=function(vt){P[vt]&&wK(P[vt])},t.removeHooks=function(vt){P[vt]&&(P[vt]=[])},t.removeAllHooks=function(){P={}},t}var lEe=BK();LK.exports=lEe});var PJ=un((o3t,R5)=>{"use strict";R5.exports=LI;R5.exports.default=LI;function LI(e,t,n){n=n||2;var i=t&&t.length,r=i?t[0]*n:e.length,o=wJ(e,0,r,n,!0),s=[];if(!o||o.next===o.prev)return s;var a,c,u,f,d,p,g;if(i&&(o=m1e(e,t,o,n)),e.length>80*n){a=u=e[0],c=f=e[1];for(var m=n;m<r;m+=n)d=e[m],p=e[m+1],d<a&&(a=d),p<c&&(c=p),d>u&&(u=d),p>f&&(f=p);g=Math.max(u-a,f-c),g=g!==0?32767/g:0}return PS(o,s,n,a,c,g,0),s}function wJ(e,t,n,i,r){var o,s;if(r===O5(e,t,n,i)>0)for(o=t;o<n;o+=i)s=SJ(o,e[o],e[o+1],s);else for(o=n-i;o>=t;o-=i)s=SJ(o,e[o],e[o+1],s);return s&&NI(s,s.next)&&(OS(s),s=s.next),s}function Ey(e,t){if(!e)return e;t||(t=e);var n=e,i;do if(i=!1,!n.steiner&&(NI(n,n.next)||Mo(n.prev,n,n.next)===0)){if(OS(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function PS(e,t,n,i,r,o,s){if(!!e){!s&&o&&x1e(e,i,r,o);for(var a=e,c,u;e.prev!==e.next;){if(c=e.prev,u=e.next,o?f1e(e,i,r,o):u1e(e)){t.push(c.i/n|0),t.push(e.i/n|0),t.push(u.i/n|0),OS(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=d1e(Ey(e),t,n),PS(e,t,n,i,r,o,2)):s===2&&h1e(e,t,n,i,r,o):PS(Ey(e),t,n,i,r,o,1);break}}}}function u1e(e){var t=e.prev,n=e,i=e.next;if(Mo(t,n,i)>=0)return!1;for(var r=t.x,o=n.x,s=i.x,a=t.y,c=n.y,u=i.y,f=r<o?r<s?r:s:o<s?o:s,d=a<c?a<u?a:u:c<u?c:u,p=r>o?r>s?r:s:o>s?o:s,g=a>c?a>u?a:u:c>u?c:u,m=i.next;m!==t;){if(m.x>=f&&m.x<=p&&m.y>=d&&m.y<=g&&PA(r,a,o,c,s,u,m.x,m.y)&&Mo(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function f1e(e,t,n,i){var r=e.prev,o=e,s=e.next;if(Mo(r,o,s)>=0)return!1;for(var a=r.x,c=o.x,u=s.x,f=r.y,d=o.y,p=s.y,g=a<c?a<u?a:u:c<u?c:u,m=f<d?f<p?f:p:d<p?d:p,x=a>c?a>u?a:u:c>u?c:u,C=f>d?f>p?f:p:d>p?d:p,A=P5(g,m,t,n,i),b=P5(x,C,t,n,i),T=e.prevZ,S=e.nextZ;T&&T.z>=A&&S&&S.z<=b;){if(T.x>=g&&T.x<=x&&T.y>=m&&T.y<=C&&T!==r&&T!==s&&PA(a,f,c,d,u,p,T.x,T.y)&&Mo(T.prev,T,T.next)>=0||(T=T.prevZ,S.x>=g&&S.x<=x&&S.y>=m&&S.y<=C&&S!==r&&S!==s&&PA(a,f,c,d,u,p,S.x,S.y)&&Mo(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;T&&T.z>=A;){if(T.x>=g&&T.x<=x&&T.y>=m&&T.y<=C&&T!==r&&T!==s&&PA(a,f,c,d,u,p,T.x,T.y)&&Mo(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;S&&S.z<=b;){if(S.x>=g&&S.x<=x&&S.y>=m&&S.y<=C&&S!==r&&S!==s&&PA(a,f,c,d,u,p,S.x,S.y)&&Mo(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function d1e(e,t,n){var i=e;do{var r=i.prev,o=i.next.next;!NI(r,o)&&vJ(r,i,i.next,o)&&IS(r,o)&&IS(o,r)&&(t.push(r.i/n|0),t.push(i.i/n|0),t.push(o.i/n|0),OS(i),OS(i.next),i=e=o),i=i.next}while(i!==e);return Ey(i)}function h1e(e,t,n,i,r,o){var s=e;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&T1e(s,a)){var c=DJ(s,a);s=Ey(s,s.next),c=Ey(c,c.next),PS(s,t,n,i,r,o,0),PS(c,t,n,i,r,o,0);return}a=a.next}s=s.next}while(s!==e)}function m1e(e,t,n,i){var r=[],o,s,a,c,u;for(o=0,s=t.length;o<s;o++)a=t[o]*i,c=o<s-1?t[o+1]*i:e.length,u=wJ(e,a,c,i,!1),u===u.next&&(u.steiner=!0),r.push(A1e(u));for(r.sort(p1e),o=0;o<r.length;o++)n=_1e(r[o],n);return n}function p1e(e,t){return e.x-t.x}function _1e(e,t){var n=g1e(e,t);if(!n)return t;var i=DJ(n,e);return Ey(i,i.next),Ey(n,n.next)}function g1e(e,t){var n=t,i=e.x,r=e.y,o=-1/0,s;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=i&&a>o&&(o=a,s=n.x<n.next.x?n:n.next,a===i))return s}n=n.next}while(n!==t);if(!s)return null;var c=s,u=s.x,f=s.y,d=1/0,p;n=s;do i>=n.x&&n.x>=u&&i!==n.x&&PA(r<f?i:o,r,u,f,r<f?o:i,r,n.x,n.y)&&(p=Math.abs(r-n.y)/(i-n.x),IS(n,e)&&(p<d||p===d&&(n.x>s.x||n.x===s.x&&y1e(s,n)))&&(s=n,d=p)),n=n.next;while(n!==c);return s}function y1e(e,t){return Mo(e.prev,e,t.prev)<0&&Mo(t.next,e,e.next)<0}function x1e(e,t,n,i){var r=e;do r.z===0&&(r.z=P5(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,C1e(r)}function C1e(e){var t,n,i,r,o,s,a,c,u=1;do{for(n=e,e=null,o=null,s=0;n;){for(s++,i=n,a=0,t=0;t<u&&(a++,i=i.nextZ,!!i);t++);for(c=u;a>0||c>0&&i;)a!==0&&(c===0||!i||n.z<=i.z)?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,c--),o?o.nextZ=r:e=r,r.prevZ=o,o=r;n=i}o.nextZ=null,u*=2}while(s>1);return e}function P5(e,t,n,i,r){return e=(e-n)*r|0,t=(t-i)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function A1e(e){var t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function PA(e,t,n,i,r,o,s,a){return(r-s)*(t-a)>=(e-s)*(o-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(o-a)>=(r-s)*(i-a)}function T1e(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!b1e(e,t)&&(IS(e,t)&&IS(t,e)&&E1e(e,t)&&(Mo(e.prev,e,t.prev)||Mo(e,t.prev,t))||NI(e,t)&&Mo(e.prev,e,e.next)>0&&Mo(t.prev,t,t.next)>0)}function Mo(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function NI(e,t){return e.x===t.x&&e.y===t.y}function vJ(e,t,n,i){var r=BI(Mo(e,t,n)),o=BI(Mo(e,t,i)),s=BI(Mo(n,i,e)),a=BI(Mo(n,i,t));return!!(r!==o&&s!==a||r===0&&MI(e,n,t)||o===0&&MI(e,i,t)||s===0&&MI(n,e,i)||a===0&&MI(n,t,i))}function MI(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function BI(e){return e>0?1:e<0?-1:0}function b1e(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&vJ(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function IS(e,t){return Mo(e.prev,e,e.next)<0?Mo(e,t,e.next)>=0&&Mo(e,e.prev,t)>=0:Mo(e,t,e.prev)<0||Mo(e,e.next,t)<0}function E1e(e,t){var n=e,i=!1,r=(e.x+t.x)/2,o=(e.y+t.y)/2;do n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function DJ(e,t){var n=new I5(e.i,e.x,e.y),i=new I5(t.i,t.x,t.y),r=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function SJ(e,t,n,i){var r=new I5(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function OS(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function I5(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}LI.deviation=function(e,t,n,i){var r=t&&t.length,o=r?t[0]*n:e.length,s=Math.abs(O5(e,0,o,n));if(r)for(var a=0,c=t.length;a<c;a++){var u=t[a]*n,f=a<c-1?t[a+1]*n:e.length;s-=Math.abs(O5(e,u,f,n))}var d=0;for(a=0;a<i.length;a+=3){var p=i[a]*n,g=i[a+1]*n,m=i[a+2]*n;d+=Math.abs((e[p]-e[m])*(e[g+1]-e[p+1])-(e[p]-e[g])*(e[m+1]-e[p+1]))}return s===0&&d===0?0:Math.abs((d-s)/s)};function O5(e,t,n,i){for(var r=0,o=t,s=n-i;o<n;o+=i)r+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;return r}LI.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},i=0,r=0;r<e.length;r++){for(var o=0;o<e[r].length;o++)for(var s=0;s<t;s++)n.vertices.push(e[r][o][s]);r>0&&(i+=e[r-1].length,n.holes.push(i))}return n}});var LQ=un((eG,tG)=>{var yo=yo||function(){var e=[];return{getAll:function(){return e},removeAll:function(){e=[]},add:function(t){e.push(t)},remove:function(t){var n=e.indexOf(t);n!==-1&&e.splice(n,1)},update:function(t,n){if(e.length===0)return!1;var i=0;for(t=t!==void 0?t:yo.now();i<e.length;)e[i].update(t)||n?i++:e.splice(i,1);return!0}}}();typeof window>"u"&&typeof process<"u"?yo.now=function(){var e=process.hrtime();return e[0]*1e3+e[1]/1e6}:typeof window<"u"&&window.performance!==void 0&&window.performance.now!==void 0?yo.now=window.performance.now.bind(window.performance):Date.now!==void 0?yo.now=Date.now:yo.now=function(){return new Date().getTime()};yo.Tween=function(e){var t=e,n={},i={},r={},o=1e3,s=0,a,c=!1,u=!1,f=!1,d=0,p=null,g=yo.Easing.Linear.None,m=yo.Interpolation.Linear,x=[],C=null,A=!1,b=null,T=null,S=null;this.to=function(w,D){return i=w,D!==void 0&&(o=D),this},this.start=function(w){yo.add(this),u=!0,A=!1,p=w!==void 0?w:yo.now(),p+=d;for(var D in i){if(i[D]instanceof Array){if(i[D].length===0)continue;i[D]=[t[D]].concat(i[D])}t[D]!==void 0&&(n[D]=t[D],n[D]instanceof Array||(n[D]*=1),r[D]=n[D]||0)}return this},this.stop=function(){return u?(yo.remove(this),u=!1,S!==null&&S.call(t,t),this.stopChainedTweens(),this):this},this.end=function(){return this.update(p+o),this},this.stopChainedTweens=function(){for(var w=0,D=x.length;w<D;w++)x[w].stop()},this.delay=function(w){return d=w,this},this.repeat=function(w){return s=w,this},this.repeatDelay=function(w){return a=w,this},this.yoyo=function(w){return c=w,this},this.easing=function(w){return g=w,this},this.interpolation=function(w){return m=w,this},this.chain=function(){return x=arguments,this},this.onStart=function(w){return C=w,this},this.onUpdate=function(w){return b=w,this},this.onComplete=function(w){return T=w,this},this.onStop=function(w){return S=w,this},this.update=function(w){var D,I,O;if(w<p)return!0;A===!1&&(C!==null&&C.call(t,t),A=!0),I=(w-p)/o,I=I>1?1:I,O=g(I);for(D in i)if(n[D]!==void 0){var B=n[D]||0,L=i[D];L instanceof Array?t[D]=m(L,O):(typeof L=="string"&&(L.charAt(0)==="+"||L.charAt(0)==="-"?L=B+parseFloat(L):L=parseFloat(L)),typeof L=="number"&&(t[D]=B+(L-B)*O))}if(b!==null&&b.call(t,O),I===1)if(s>0){isFinite(s)&&s--;for(D in r){if(typeof i[D]=="string"&&(r[D]=r[D]+parseFloat(i[D])),c){var _=r[D];r[D]=i[D],i[D]=_}n[D]=r[D]}return c&&(f=!f),a!==void 0?p=w+a:p=w+d,!0}else{T!==null&&T.call(t,t);for(var E=0,v=x.length;E<v;E++)x[E].start(p+o);return!1}return!0}};yo.Easing={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(e){return 1-yo.Easing.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?yo.Easing.Bounce.In(e*2)*.5:yo.Easing.Bounce.Out(e*2-1)*.5+.5}}};yo.Interpolation={Linear:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=yo.Interpolation.Utils.Linear;return t<0?o(e[0],e[1],i):t>1?o(e[n],e[n-1],n-i):o(e[r],e[r+1>n?n:r+1],i-r)},Bezier:function(e,t){for(var n=0,i=e.length-1,r=Math.pow,o=yo.Interpolation.Utils.Bernstein,s=0;s<=i;s++)n+=r(1-t,i-s)*r(t,s)*e[s]*o(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=yo.Interpolation.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(r=Math.floor(i=n*(1+t))),o(e[(r-1+n)%n],e[r],e[(r+1)%n],e[(r+2)%n],i-r)):t<0?e[0]-(o(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(o(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):o(e[r?r-1:0],e[r],e[n<r+1?n:r+1],e[n<r+2?n:r+2],i-r)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=yo.Interpolation.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}}(),CatmullRom:function(e,t,n,i,r){var o=(n-e)*.5,s=(i-t)*.5,a=r*r,c=r*a;return(2*t-2*n+o+s)*c+(-3*t+3*n-2*o-s)*a+o*r+t}}};(function(e){typeof define=="function"&&define.amd?define([],function(){return yo}):typeof tG<"u"&&typeof eG=="object"?tG.exports=yo:e!==void 0&&(e.TWEEN=yo)})(eG)});var JQ=un((exports,module)=>{/*!
- * protobuf.js v6.10.2 (c) 2016, daniel wirtz
- * compiled fri, 08 jul 2022 16:17:13 utc
- * licensed under the bsd-3-clause license
- * see: https://github.com/dcodeio/protobuf.js for details
- */(function(undefined){"use strict";(function(t,n,i){function r(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},r,a,a.exports),a.exports}var o=r(i[0]);o.util.global.protobuf=o,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(o.util.Long=s,o.configure()),o}),typeof module=="object"&&module&&module.exports&&(module.exports=o)})({1:[function(e,t,n){"use strict";t.exports=i;function i(r,o){for(var s=new Array(arguments.length-1),a=0,c=2,u=!0;c<arguments.length;)s[a++]=arguments[c++];return new Promise(function(d,p){s[a]=function(m){if(u)if(u=!1,m)p(m);else{for(var x=new Array(arguments.length-1),C=0;C<x.length;)x[C++]=arguments[C];d.apply(null,x)}};try{r.apply(o||null,s)}catch(g){u&&(u=!1,p(g))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(u){var f=u.length;if(!f)return 0;for(var d=0;--f%4>1&&u.charAt(f)==="=";)++d;return Math.ceil(u.length*3)/4-d};for(var r=new Array(64),o=new Array(123),s=0;s<64;)o[r[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(u,f,d){for(var p=null,g=[],m=0,x=0,C;f<d;){var A=u[f++];switch(x){case 0:g[m++]=r[A>>2],C=(A&3)<<4,x=1;break;case 1:g[m++]=r[C|A>>4],C=(A&15)<<2,x=2;break;case 2:g[m++]=r[C|A>>6],g[m++]=r[A&63],x=0;break}m>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,g)),m=0)}return x&&(g[m++]=r[C],g[m++]=61,x===1&&(g[m++]=61)),p?(m&&p.push(String.fromCharCode.apply(String,g.slice(0,m))),p.join("")):String.fromCharCode.apply(String,g.slice(0,m))};var a="invalid encoding";i.decode=function(u,f,d){for(var p=d,g=0,m,x=0;x<u.length;){var C=u.charCodeAt(x++);if(C===61&&g>1)break;if((C=o[C])===undefined)throw Error(a);switch(g){case 0:m=C,g=1;break;case 1:f[d++]=m<<2|(C&48)>>4,m=C,g=2;break;case 2:f[d++]=(m&15)<<4|(C&60)>>2,m=C,g=3;break;case 3:f[d++]=(m&3)<<6|C,g=0;break}}if(g===1)throw Error(a);return d-p},i.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(o,s,a){return(this._listeners[o]||(this._listeners[o]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(o,s){if(o===undefined)this._listeners={};else if(s===undefined)this._listeners[o]=[];else for(var a=this._listeners[o],c=0;c<a.length;)a[c].fn===s?a.splice(c,1):++c;return this},i.prototype.emit=function(o){var s=this._listeners[o];if(s){for(var a=[],c=1;c<arguments.length;)a.push(arguments[c++]);for(c=0;c<s.length;)s[c].fn.apply(s[c++].ctx,a)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(c){return typeof Float32Array<"u"?function(){var u=new Float32Array([-0]),f=new Uint8Array(u.buffer),d=f[3]===128;function p(C,A,b){u[0]=C,A[b]=f[0],A[b+1]=f[1],A[b+2]=f[2],A[b+3]=f[3]}function g(C,A,b){u[0]=C,A[b]=f[3],A[b+1]=f[2],A[b+2]=f[1],A[b+3]=f[0]}c.writeFloatLE=d?p:g,c.writeFloatBE=d?g:p;function m(C,A){return f[0]=C[A],f[1]=C[A+1],f[2]=C[A+2],f[3]=C[A+3],u[0]}function x(C,A){return f[3]=C[A],f[2]=C[A+1],f[1]=C[A+2],f[0]=C[A+3],u[0]}c.readFloatLE=d?m:x,c.readFloatBE=d?x:m}():function(){function u(d,p,g,m){var x=p<0?1:0;if(x&&(p=-p),p===0)d(1/p>0?0:2147483648,g,m);else if(isNaN(p))d(2143289344,g,m);else if(p>34028234663852886e22)d((x<<31|2139095040)>>>0,g,m);else if(p<11754943508222875e-54)d((x<<31|Math.round(p/1401298464324817e-60))>>>0,g,m);else{var C=Math.floor(Math.log(p)/Math.LN2),A=Math.round(p*Math.pow(2,-C)*8388608)&8388607;d((x<<31|C+127<<23|A)>>>0,g,m)}}c.writeFloatLE=u.bind(null,r),c.writeFloatBE=u.bind(null,o);function f(d,p,g){var m=d(p,g),x=(m>>31)*2+1,C=m>>>23&255,A=m&8388607;return C===255?A?NaN:x*(1/0):C===0?x*1401298464324817e-60*A:x*Math.pow(2,C-150)*(A+8388608)}c.readFloatLE=f.bind(null,s),c.readFloatBE=f.bind(null,a)}(),typeof Float64Array<"u"?function(){var u=new Float64Array([-0]),f=new Uint8Array(u.buffer),d=f[7]===128;function p(C,A,b){u[0]=C,A[b]=f[0],A[b+1]=f[1],A[b+2]=f[2],A[b+3]=f[3],A[b+4]=f[4],A[b+5]=f[5],A[b+6]=f[6],A[b+7]=f[7]}function g(C,A,b){u[0]=C,A[b]=f[7],A[b+1]=f[6],A[b+2]=f[5],A[b+3]=f[4],A[b+4]=f[3],A[b+5]=f[2],A[b+6]=f[1],A[b+7]=f[0]}c.writeDoubleLE=d?p:g,c.writeDoubleBE=d?g:p;function m(C,A){return f[0]=C[A],f[1]=C[A+1],f[2]=C[A+2],f[3]=C[A+3],f[4]=C[A+4],f[5]=C[A+5],f[6]=C[A+6],f[7]=C[A+7],u[0]}function x(C,A){return f[7]=C[A],f[6]=C[A+1],f[5]=C[A+2],f[4]=C[A+3],f[3]=C[A+4],f[2]=C[A+5],f[1]=C[A+6],f[0]=C[A+7],u[0]}c.readDoubleLE=d?m:x,c.readDoubleBE=d?x:m}():function(){function u(d,p,g,m,x,C){var A=m<0?1:0;if(A&&(m=-m),m===0)d(0,x,C+p),d(1/m>0?0:2147483648,x,C+g);else if(isNaN(m))d(0,x,C+p),d(2146959360,x,C+g);else if(m>17976931348623157e292)d(0,x,C+p),d((A<<31|2146435072)>>>0,x,C+g);else{var b;if(m<22250738585072014e-324)b=m/5e-324,d(b>>>0,x,C+p),d((A<<31|b/4294967296)>>>0,x,C+g);else{var T=Math.floor(Math.log(m)/Math.LN2);T===1024&&(T=1023),b=m*Math.pow(2,-T),d(b*4503599627370496>>>0,x,C+p),d((A<<31|T+1023<<20|b*1048576&1048575)>>>0,x,C+g)}}}c.writeDoubleLE=u.bind(null,r,0,4),c.writeDoubleBE=u.bind(null,o,4,0);function f(d,p,g,m,x){var C=d(m,x+p),A=d(m,x+g),b=(A>>31)*2+1,T=A>>>20&2047,S=4294967296*(A&1048575)+C;return T===2047?S?NaN:b*(1/0):T===0?b*5e-324*S:b*Math.pow(2,T-1075)*(S+4503599627370496)}c.readDoubleLE=f.bind(null,s,0,4),c.readDoubleBE=f.bind(null,a,4,0)}(),c}function r(c,u,f){u[f]=c&255,u[f+1]=c>>>8&255,u[f+2]=c>>>16&255,u[f+3]=c>>>24}function o(c,u,f){u[f]=c>>>24,u[f+1]=c>>>16&255,u[f+2]=c>>>8&255,u[f+3]=c&255}function s(c,u){return(c[u]|c[u+1]<<8|c[u+2]<<16|c[u+3]<<24)>>>0}function a(c,u){return(c[u]<<24|c[u+1]<<16|c[u+2]<<8|c[u+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(r,o,s){var a=s||8192,c=a>>>1,u=null,f=a;return function(p){if(p<1||p>c)return r(p);f+p>a&&(u=r(a),f=0);var g=o.call(u,f,f+=p);return f&7&&(f=(f|7)+1),g}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(o){for(var s=0,a=0,c=0;c<o.length;++c)a=o.charCodeAt(c),a<128?s+=1:a<2048?s+=2:(a&64512)===55296&&(o.charCodeAt(c+1)&64512)===56320?(++c,s+=4):s+=3;return s},i.read=function(o,s,a){var c=a-s;if(c<1)return"";for(var u=null,f=[],d=0,p;s<a;)p=o[s++],p<128?f[d++]=p:p>191&&p<224?f[d++]=(p&31)<<6|o[s++]&63:p>239&&p<365?(p=((p&7)<<18|(o[s++]&63)<<12|(o[s++]&63)<<6|o[s++]&63)-65536,f[d++]=55296+(p>>10),f[d++]=56320+(p&1023)):f[d++]=(p&15)<<12|(o[s++]&63)<<6|o[s++]&63,d>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,f)),d=0);return u?(d&&u.push(String.fromCharCode.apply(String,f.slice(0,d))),u.join("")):String.fromCharCode.apply(String,f.slice(0,d))},i.write=function(o,s,a){for(var c=a,u,f,d=0;d<o.length;++d)u=o.charCodeAt(d),u<128?s[a++]=u:u<2048?(s[a++]=u>>6|192,s[a++]=u&63|128):(u&64512)===55296&&((f=o.charCodeAt(d+1))&64512)===56320?(u=65536+((u&1023)<<10)+(f&1023),++d,s[a++]=u>>18|240,s[a++]=u>>12&63|128,s[a++]=u>>6&63|128,s[a++]=u&63|128):(s[a++]=u>>12|224,s[a++]=u>>6&63|128,s[a++]=u&63|128);return a-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=r;function r(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}r()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),r,o=i.LongBits,s=i.utf8;function a(m,x){return RangeError("index out of range: "+m.pos+" + "+(x||1)+" > "+m.len)}function c(m){this.buf=m,this.pos=0,this.len=m.length}var u=typeof Uint8Array<"u"?function(x){if(x instanceof Uint8Array||Array.isArray(x))return new c(x);throw Error("illegal buffer")}:function(x){if(Array.isArray(x))return new c(x);throw Error("illegal buffer")},f=function(){return i.Buffer?function(C){return(c.create=function(b){return i.Buffer.isBuffer(b)?new r(b):u(b)})(C)}:u};c.create=f(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=function(){var x=4294967295;return function(){if(x=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(x=(x|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return x;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return x}}(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var x=this.uint32();return x>>>1^-(x&1)|0};function d(){var m=new o(0,0),x=0;if(this.len-this.pos>4){for(;x<4;++x)if(m.lo=(m.lo|(this.buf[this.pos]&127)<<x*7)>>>0,this.buf[this.pos++]<128)return m;if(m.lo=(m.lo|(this.buf[this.pos]&127)<<28)>>>0,m.hi=(m.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return m;x=0}else{for(;x<3;++x){if(this.pos>=this.len)throw a(this);if(m.lo=(m.lo|(this.buf[this.pos]&127)<<x*7)>>>0,this.buf[this.pos++]<128)return m}return m.lo=(m.lo|(this.buf[this.pos++]&127)<<x*7)>>>0,m}if(this.len-this.pos>4){for(;x<5;++x)if(m.hi=(m.hi|(this.buf[this.pos]&127)<<x*7+3)>>>0,this.buf[this.pos++]<128)return m}else for(;x<5;++x){if(this.pos>=this.len)throw a(this);if(m.hi=(m.hi|(this.buf[this.pos]&127)<<x*7+3)>>>0,this.buf[this.pos++]<128)return m}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(m,x){return(m[x-4]|m[x-3]<<8|m[x-2]<<16|m[x-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function g(){if(this.pos+8>this.len)throw a(this,8);return new o(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var x=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,x},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var x=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,x},c.prototype.bytes=function(){var x=this.uint32(),C=this.pos,A=this.pos+x;if(A>this.len)throw a(this,x);return this.pos+=x,Array.isArray(this.buf)?this.buf.slice(C,A):C===A?new this.buf.constructor(0):this._slice.call(this.buf,C,A)},c.prototype.string=function(){var x=this.bytes();return s.read(x,0,x.length)},c.prototype.skip=function(x){if(typeof x=="number"){if(this.pos+x>this.len)throw a(this,x);this.pos+=x}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(m){switch(m){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(m=this.uint32()&7)!==4;)this.skipType(m);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+m+" at offset "+this.pos)}return this},c._configure=function(m){r=m,c.create=f(),r._configure();var x=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return d.call(this)[x](!1)},uint64:function(){return d.call(this)[x](!0)},sint64:function(){return d.call(this).zzDecode()[x](!1)},fixed64:function(){return g.call(this)[x](!0)},sfixed64:function(){return g.call(this)[x](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=o;var i=e(9);(o.prototype=Object.create(i.prototype)).constructor=o;var r=e(15);function o(s){i.call(this,s)}o._configure=function(){r.Buffer&&(o.prototype._slice=r.Buffer.prototype.slice)},o.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},o._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=r;var i=e(15);(r.prototype=Object.create(i.EventEmitter.prototype)).constructor=r;function r(o,s,a){if(typeof o!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=o,this.requestDelimited=Boolean(s),this.responseDelimited=Boolean(a)}r.prototype.rpcCall=function o(s,a,c,u,f){if(!u)throw TypeError("request must be specified");var d=this;if(!f)return i.asPromise(o,d,s,a,c,u);if(!d.rpcImpl)return setTimeout(function(){f(Error("already ended"))},0),undefined;try{return d.rpcImpl(s,a[d.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(g,m){if(g)return d.emit("error",g,s),f(g);if(m===null)return d.end(!0),undefined;if(!(m instanceof c))try{m=c[d.responseDelimited?"decodeDelimited":"decode"](m)}catch(x){return d.emit("error",x,s),f(x)}return d.emit("data",m,s),f(null,m)})}catch(p){return d.emit("error",p,s),setTimeout(function(){f(p)},0),undefined}},r.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=r;var i=e(15);function r(c,u){this.lo=c>>>0,this.hi=u>>>0}var o=r.zero=new r(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var s=r.zeroHash="\0\0\0\0\0\0\0\0";r.fromNumber=function(u){if(u===0)return o;var f=u<0;f&&(u=-u);var d=u>>>0,p=(u-d)/4294967296>>>0;return f&&(p=~p>>>0,d=~d>>>0,++d>4294967295&&(d=0,++p>4294967295&&(p=0))),new r(d,p)},r.from=function(u){if(typeof u=="number")return r.fromNumber(u);if(i.isString(u))if(i.Long)u=i.Long.fromString(u);else return r.fromNumber(parseInt(u,10));return u.low||u.high?new r(u.low>>>0,u.high>>>0):o},r.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var f=~this.lo+1>>>0,d=~this.hi>>>0;return f||(d=d+1>>>0),-(f+d*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(u){return i.Long?new i.Long(this.lo|0,this.hi|0,Boolean(u)):{low:this.lo|0,high:this.hi|0,unsigned:Boolean(u)}};var a=String.prototype.charCodeAt;r.fromHash=function(u){return u===s?o:new r((a.call(u,0)|a.call(u,1)<<8|a.call(u,2)<<16|a.call(u,3)<<24)>>>0,(a.call(u,4)|a.call(u,5)<<8|a.call(u,6)<<16|a.call(u,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},r.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},r.prototype.length=function(){var u=this.lo,f=(this.lo>>>28|this.hi<<4)>>>0,d=this.hi>>>24;return d===0?f===0?u<16384?u<128?1:2:u<2097152?3:4:f<16384?f<128?5:6:f<2097152?7:8:d<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=Boolean(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var u=a[c];return u!=null&&a.hasOwnProperty(c)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,c){var u=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(u.lo,u.hi,c):u.toNumber(Boolean(c))};function r(s,a,c){for(var u=Object.keys(a),f=0;f<u.length;++f)(s[u[f]]===undefined||!c)&&(s[u[f]]=a[u[f]]);return s}i.merge=r,i.lcFirst=function(a){return a.charAt(0).toLowerCase()+a.substring(1)};function o(s){function a(c,u){if(!(this instanceof a))return new a(c,u);Object.defineProperty(this,"message",{get:function(){return c}}),Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&r(this,u)}return a.prototype=Object.create(Error.prototype,{constructor:{value:a,writable:!0,enumerable:!1,configurable:!0},name:{get(){return s},set:undefined,enumerable:!1,configurable:!0},toString:{value(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),a}i.newError=o,i.ProtocolError=o("ProtocolError"),i.oneOfGetter=function(a){for(var c={},u=0;u<a.length;++u)c[a[u]]=1;return function(){for(var f=Object.keys(this),d=f.length-1;d>-1;--d)if(c[f[d]]===1&&this[f[d]]!==undefined&&this[f[d]]!==null)return f[d]}},i.oneOfSetter=function(a){return function(c){for(var u=0;u<a.length;++u)a[u]!==c&&delete this[a[u]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var s=i.Buffer;if(!s){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=s.from!==Uint8Array.from&&s.from||function(c,u){return new s(c,u)},i._Buffer_allocUnsafe=s.allocUnsafe||function(c){return new s(c)}}},{1:1,14:14,2:2,3:3,4:4,5:5,6:6,7:7}],16:[function(e,t,n){"use strict";t.exports=d;var i=e(15),r,o=i.LongBits,s=i.base64,a=i.utf8;function c(T,S,w){this.fn=T,this.len=S,this.next=undefined,this.val=w}function u(){}function f(T){this.head=T.head,this.tail=T.tail,this.len=T.len,this.next=T.states}function d(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d}};d.create=p(),d.alloc=function(S){return new i.Array(S)},i.Array!==Array&&(d.alloc=i.pool(d.alloc,i.Array.prototype.subarray)),d.prototype._push=function(S,w,D){return this.tail=this.tail.next=new c(S,w,D),this.len+=w,this};function g(T,S,w){S[w]=T&255}function m(T,S,w){for(;T>127;)S[w++]=T&127|128,T>>>=7;S[w]=T}function x(T,S){this.len=T,this.next=undefined,this.val=S}x.prototype=Object.create(c.prototype),x.prototype.fn=m,d.prototype.uint32=function(S){return this.len+=(this.tail=this.tail.next=new x((S=S>>>0)<128?1:S<16384?2:S<2097152?3:S<268435456?4:5,S)).len,this},d.prototype.int32=function(S){return S<0?this._push(C,10,o.fromNumber(S)):this.uint32(S)},d.prototype.sint32=function(S){return this.uint32((S<<1^S>>31)>>>0)};function C(T,S,w){for(;T.hi;)S[w++]=T.lo&127|128,T.lo=(T.lo>>>7|T.hi<<25)>>>0,T.hi>>>=7;for(;T.lo>127;)S[w++]=T.lo&127|128,T.lo=T.lo>>>7;S[w++]=T.lo}d.prototype.uint64=function(S){var w=o.from(S);return this._push(C,w.length(),w)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(S){var w=o.from(S).zzEncode();return this._push(C,w.length(),w)},d.prototype.bool=function(S){return this._push(g,1,S?1:0)};function A(T,S,w){S[w]=T&255,S[w+1]=T>>>8&255,S[w+2]=T>>>16&255,S[w+3]=T>>>24}d.prototype.fixed32=function(S){return this._push(A,4,S>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(S){var w=o.from(S);return this._push(A,4,w.lo)._push(A,4,w.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(S){return this._push(i.float.writeFloatLE,4,S)},d.prototype.double=function(S){return this._push(i.float.writeDoubleLE,8,S)};var b=i.Array.prototype.set?function(S,w,D){w.set(S,D)}:function(S,w,D){for(var I=0;I<S.length;++I)w[D+I]=S[I]};d.prototype.bytes=function(S){var w=S.length>>>0;if(!w)return this._push(g,1,0);if(i.isString(S)){var D=d.alloc(w=s.length(S));s.decode(S,D,0),S=D}return this.uint32(w)._push(b,w,S)},d.prototype.string=function(S){var w=a.length(S);return w?this.uint32(w)._push(a.write,w,S):this._push(g,1,0)},d.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new c(u,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},d.prototype.ldelim=function(){var S=this.head,w=this.tail,D=this.len;return this.reset().uint32(D),D&&(this.tail.next=S.next,this.tail=w,this.len+=D),this},d.prototype.finish=function(){for(var S=this.head.next,w=this.constructor.alloc(this.len),D=0;S;)S.fn(S.val,w,D),D+=S.len,S=S.next;return w},d._configure=function(T){r=T,d.create=p(),r._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=o;var i=e(16);(o.prototype=Object.create(i.prototype)).constructor=o;var r=e(15);function o(){i.call(this)}o._configure=function(){o.alloc=r._Buffer_allocUnsafe,o.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&r.Buffer.prototype.set.name==="set"?function(c,u,f){u.set(c,f)}:function(c,u,f){if(c.copy)c.copy(u,f,0,c.length);else for(var d=0;d<c.length;)u[f++]=c[d++]}},o.prototype.bytes=function(c){r.isString(c)&&(c=r._Buffer_from(c,"base64"));var u=c.length>>>0;return this.uint32(u),u&&this._push(o.writeBytesBuffer,u,c),this};function s(a,c,u){a.length<40?r.utf8.write(a,c,u):c.utf8Write?c.utf8Write(a,u):c.write(a,u)}o.prototype.string=function(c){var u=r.Buffer.byteLength(c);return this.uint32(u),u&&this._push(s,u,c),this},o._configure()},{15:15,16:16}]},{},[8])})()});var Ote=un((FG,VG)=>{(function(e,t){typeof FG=="object"&&typeof VG<"u"?VG.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self,e.RBush=t())})(FG,function(){"use strict";function e(T,S,w,D,I){t(T,S,w||0,D||T.length-1,I||i)}function t(T,S,w,D,I){for(;D>w;){if(D-w>600){var O=D-w+1,B=S-w+1,L=Math.log(O),_=.5*Math.exp(2*L/3),E=.5*Math.sqrt(L*_*(O-_)/O)*(B-O/2<0?-1:1),v=Math.max(w,Math.floor(S-B*_/O+E)),P=Math.min(D,Math.floor(S+(O-B)*_/O+E));t(T,S,v,P,I)}var R=T[S],F=w,U=D;for(n(T,w,S),I(T[D],R)>0&&n(T,w,D);F<U;){for(n(T,F,U),F++,U--;I(T[F],R)<0;)F++;for(;I(T[U],R)>0;)U--}I(T[w],R)===0?n(T,w,U):(U++,n(T,U,D)),U<=S&&(w=U+1),S<=U&&(D=U-1)}}function n(T,S,w){var D=T[S];T[S]=T[w],T[w]=D}function i(T,S){return T<S?-1:T>S?1:0}var r=function(S){S===void 0&&(S=9),this._maxEntries=Math.max(4,S),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()};r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(S){var w=this.data,D=[];if(!C(S,w))return D;for(var I=this.toBBox,O=[];w;){for(var B=0;B<w.children.length;B++){var L=w.children[B],_=w.leaf?I(L):L;C(S,_)&&(w.leaf?D.push(L):x(S,_)?this._all(L,D):O.push(L))}w=O.pop()}return D},r.prototype.collides=function(S){var w=this.data;if(!C(S,w))return!1;for(var D=[];w;){for(var I=0;I<w.children.length;I++){var O=w.children[I],B=w.leaf?this.toBBox(O):O;if(C(S,B)){if(w.leaf||x(S,B))return!0;D.push(O)}}w=D.pop()}return!1},r.prototype.load=function(S){if(!(S&&S.length))return this;if(S.length<this._minEntries){for(var w=0;w<S.length;w++)this.insert(S[w]);return this}var D=this._build(S.slice(),0,S.length-1,0);if(!this.data.children.length)this.data=D;else if(this.data.height===D.height)this._splitRoot(this.data,D);else{if(this.data.height<D.height){var I=this.data;this.data=D,D=I}this._insert(D,this.data.height-D.height-1,!0)}return this},r.prototype.insert=function(S){return S&&this._insert(S,this.data.height-1),this},r.prototype.clear=function(){return this.data=A([]),this},r.prototype.remove=function(S,w){if(!S)return this;for(var D=this.data,I=this.toBBox(S),O=[],B=[],L,_,E;D||O.length;){if(D||(D=O.pop(),_=O[O.length-1],L=B.pop(),E=!0),D.leaf){var v=o(S,D.children,w);if(v!==-1)return D.children.splice(v,1),O.push(D),this._condense(O),this}!E&&!D.leaf&&x(D,I)?(O.push(D),B.push(L),L=0,_=D,D=D.children[0]):_?(L++,D=_.children[L],E=!1):D=null}return this},r.prototype.toBBox=function(S){return S},r.prototype.compareMinX=function(S,w){return S.minX-w.minX},r.prototype.compareMinY=function(S,w){return S.minY-w.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(S){return this.data=S,this},r.prototype._all=function(S,w){for(var D=[];S;)S.leaf?w.push.apply(w,S.children):D.push.apply(D,S.children),S=D.pop();return w},r.prototype._build=function(S,w,D,I){var O=D-w+1,B=this._maxEntries,L;if(O<=B)return L=A(S.slice(w,D+1)),s(L,this.toBBox),L;I||(I=Math.ceil(Math.log(O)/Math.log(B)),B=Math.ceil(O/Math.pow(B,I-1))),L=A([]),L.leaf=!1,L.height=I;var _=Math.ceil(O/B),E=_*Math.ceil(Math.sqrt(B));b(S,w,D,E,this.compareMinX);for(var v=w;v<=D;v+=E){var P=Math.min(v+E-1,D);b(S,v,P,_,this.compareMinY);for(var R=v;R<=P;R+=_){var F=Math.min(R+_-1,P);L.children.push(this._build(S,R,F,I-1))}}return s(L,this.toBBox),L},r.prototype._chooseSubtree=function(S,w,D,I){for(;I.push(w),!(w.leaf||I.length-1===D);){for(var O=1/0,B=1/0,L=void 0,_=0;_<w.children.length;_++){var E=w.children[_],v=d(E),P=g(S,E)-v;P<B?(B=P,O=v<O?v:O,L=E):P===B&&v<O&&(O=v,L=E)}w=L||w.children[0]}return w},r.prototype._insert=function(S,w,D){var I=D?S:this.toBBox(S),O=[],B=this._chooseSubtree(I,this.data,w,O);for(B.children.push(S),c(B,I);w>=0&&O[w].children.length>this._maxEntries;)this._split(O,w),w--;this._adjustParentBBoxes(I,O,w)},r.prototype._split=function(S,w){var D=S[w],I=D.children.length,O=this._minEntries;this._chooseSplitAxis(D,O,I);var B=this._chooseSplitIndex(D,O,I),L=A(D.children.splice(B,D.children.length-B));L.height=D.height,L.leaf=D.leaf,s(D,this.toBBox),s(L,this.toBBox),w?S[w-1].children.push(L):this._splitRoot(D,L)},r.prototype._splitRoot=function(S,w){this.data=A([S,w]),this.data.height=S.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(S,w,D){for(var I,O=1/0,B=1/0,L=w;L<=D-w;L++){var _=a(S,0,L,this.toBBox),E=a(S,L,D,this.toBBox),v=m(_,E),P=d(_)+d(E);v<O?(O=v,I=L,B=P<B?P:B):v===O&&P<B&&(B=P,I=L)}return I||D-w},r.prototype._chooseSplitAxis=function(S,w,D){var I=S.leaf?this.compareMinX:u,O=S.leaf?this.compareMinY:f,B=this._allDistMargin(S,w,D,I),L=this._allDistMargin(S,w,D,O);B<L&&S.children.sort(I)},r.prototype._allDistMargin=function(S,w,D,I){S.children.sort(I);for(var O=this.toBBox,B=a(S,0,w,O),L=a(S,D-w,D,O),_=p(B)+p(L),E=w;E<D-w;E++){var v=S.children[E];c(B,S.leaf?O(v):v),_+=p(B)}for(var P=D-w-1;P>=w;P--){var R=S.children[P];c(L,S.leaf?O(R):R),_+=p(L)}return _},r.prototype._adjustParentBBoxes=function(S,w,D){for(var I=D;I>=0;I--)c(w[I],S)},r.prototype._condense=function(S){for(var w=S.length-1,D=void 0;w>=0;w--)S[w].children.length===0?w>0?(D=S[w-1].children,D.splice(D.indexOf(S[w]),1)):this.clear():s(S[w],this.toBBox)};function o(T,S,w){if(!w)return S.indexOf(T);for(var D=0;D<S.length;D++)if(w(T,S[D]))return D;return-1}function s(T,S){a(T,0,T.children.length,S,T)}function a(T,S,w,D,I){I||(I=A(null)),I.minX=1/0,I.minY=1/0,I.maxX=-1/0,I.maxY=-1/0;for(var O=S;O<w;O++){var B=T.children[O];c(I,T.leaf?D(B):B)}return I}function c(T,S){return T.minX=Math.min(T.minX,S.minX),T.minY=Math.min(T.minY,S.minY),T.maxX=Math.max(T.maxX,S.maxX),T.maxY=Math.max(T.maxY,S.maxY),T}function u(T,S){return T.minX-S.minX}function f(T,S){return T.minY-S.minY}function d(T){return(T.maxX-T.minX)*(T.maxY-T.minY)}function p(T){return T.maxX-T.minX+(T.maxY-T.minY)}function g(T,S){return(Math.max(S.maxX,T.maxX)-Math.min(S.minX,T.minX))*(Math.max(S.maxY,T.maxY)-Math.min(S.minY,T.minY))}function m(T,S){var w=Math.max(T.minX,S.minX),D=Math.max(T.minY,S.minY),I=Math.min(T.maxX,S.maxX),O=Math.min(T.maxY,S.maxY);return Math.max(0,I-w)*Math.max(0,O-D)}function x(T,S){return T.minX<=S.minX&&T.minY<=S.minY&&S.maxX<=T.maxX&&S.maxY<=T.maxY}function C(T,S){return S.minX<=T.maxX&&S.minY<=T.maxY&&S.maxX>=T.minX&&S.maxY>=T.minY}function A(T){return{children:T,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function b(T,S,w,D,I){for(var O=[S,w];O.length;)if(w=O.pop(),S=O.pop(),!(w-S<=D)){var B=S+Math.ceil((w-S)/D/2)*D;e(T,B,S,w,I),O.push(S,B,B,w)}}return r})});var Coe=un((qw,eN)=>{(function(e){"use strict";var t="Compound",n="Identifier",i="MemberExpression",r="Literal",o="ThisExpression",s="CallExpression",a="UnaryExpression",c="BinaryExpression",u="LogicalExpression",f="ConditionalExpression",d="ArrayExpression",p=46,g=44,m=39,x=34,C=40,A=41,b=91,T=93,S=63,w=59,D=58,I=function(X,G){var $=new Error(X+" at character "+G);throw $.index=G,$.description=X,$},O=!0,B={"-":O,"!":O,"~":O,"+":O},L={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},_=function(X){var G=0,$;for(var J in X)($=J.length)>G&&X.hasOwnProperty(J)&&(G=$);return G},E=_(B),v=_(L),P={true:!0,false:!1,null:null},R="this",F=function(X){return L[X]||0},U=function(X,G,$){var J=X==="||"||X==="&&"?u:c;return{type:J,operator:X,left:G,right:$}},k=function(X){return X>=48&&X<=57},H=function(X){return X===36||X===95||X>=65&&X<=90||X>=97&&X<=122||X>=128&&!L[String.fromCharCode(X)]},V=function(X){return X===36||X===95||X>=65&&X<=90||X>=97&&X<=122||X>=48&&X<=57||X>=128&&!L[String.fromCharCode(X)]},q=function(X){for(var G=0,$=X.charAt,J=X.charCodeAt,ce=function(we){return $.call(X,we)},de=function(we){return J.call(X,we)},ie=X.length,ae=function(){for(var we=de(G);we===32||we===9||we===10||we===13;)we=de(++G)},_e=function(){var we=Te(),_t,Yt;if(ae(),de(G)===S){if(G++,_t=_e(),_t||I("Expected expression",G),ae(),de(G)===D)return G++,Yt=_e(),Yt||I("Expected expression",G),{type:f,test:we,consequent:_t,alternate:Yt};I("Expected :",G)}else return we},be=function(){ae();for(var we,_t=X.substr(G,v),Yt=_t.length;Yt>0;){if(L.hasOwnProperty(_t)&&(!H(de(G))||G+_t.length<X.length&&!V(de(G+_t.length))))return G+=Yt,_t;_t=_t.substr(0,--Yt)}return!1},Te=function(){var we,_t,Yt,Gi,ti,Br,or,Lr,Pi,gr;if(or=Oe(),Yt=be(),!Yt)return or;for(Br={value:Yt,prec:F(Yt)},Lr=Oe(),Lr||I("Expected expression after "+Yt,G),ti=[or,Br,Lr];(Yt=be())&&(Gi=F(Yt),Gi!==0);){for(Br={value:Yt,prec:Gi},gr=Yt;ti.length>2&&Gi<=ti[ti.length-2].prec;)Lr=ti.pop(),Yt=ti.pop().value,or=ti.pop(),_t=U(Yt,or,Lr),ti.push(_t);_t=Oe(),_t||I("Expected expression after "+gr,G),ti.push(Br,_t)}for(Pi=ti.length-1,_t=ti[Pi];Pi>1;)_t=U(ti[Pi-1].value,ti[Pi-2],_t),Pi-=2;return _t},Oe=function(){var we,_t,Yt;if(ae(),we=de(G),k(we)||we===p)return Be();if(we===m||we===x)return tt();if(we===b)return ii();for(_t=X.substr(G,E),Yt=_t.length;Yt>0;){if(B.hasOwnProperty(_t)&&(!H(de(G))||G+_t.length<X.length&&!V(de(G+_t.length))))return G+=Yt,{type:a,operator:_t,argument:Oe(),prefix:!0};_t=_t.substr(0,--Yt)}return H(we)||we===C?ht():!1},Be=function(){for(var we="",_t,Yt;k(de(G));)we+=ce(G++);if(de(G)===p)for(we+=ce(G++);k(de(G));)we+=ce(G++);if(_t=ce(G),_t==="e"||_t==="E"){for(we+=ce(G++),_t=ce(G),(_t==="+"||_t==="-")&&(we+=ce(G++));k(de(G));)we+=ce(G++);k(de(G-1))||I("Expected exponent ("+we+ce(G)+")",G)}return Yt=de(G),H(Yt)?I("Variable names cannot start with a number ("+we+ce(G)+")",G):Yt===p&&I("Unexpected period",G),{type:r,value:parseFloat(we),raw:we}},tt=function(){for(var we="",_t=ce(G++),Yt=!1,Gi;G<ie;)if(Gi=ce(G++),Gi===_t){Yt=!0;break}else if(Gi==="\\")switch(Gi=ce(G++),Gi){case"n":we+=`
- `;break;case"r":we+="\r";break;case"t":we+=" ";break;case"b":we+="\b";break;case"f":we+="\f";break;case"v":we+="\v";break;default:we+=Gi}else we+=Gi;return Yt||I('Unclosed quote after "'+we+'"',G),{type:r,value:we,raw:_t+we+_t}},lt=function(){var we=de(G),_t=G,Yt;for(H(we)?G++:I("Unexpected "+ce(G),G);G<ie&&(we=de(G),V(we));)G++;return Yt=X.slice(_t,G),P.hasOwnProperty(Yt)?{type:r,value:P[Yt],raw:Yt}:Yt===R?{type:o}:{type:n,name:Yt}},Pt=function(we){for(var _t,Yt=[],Gi,ti=!1,Br=0;G<ie;)if(ae(),_t=de(G),_t===we){ti=!0,G++,we===A&&Br&&Br>=Yt.length&&I("Unexpected token "+String.fromCharCode(we),G);break}else if(_t===g){if(G++,Br++,Br!==Yt.length){if(we===A)I("Unexpected token ,",G);else if(we===T)for(var or=Yt.length;or<Br;or++)Yt.push(null)}}else Gi=_e(),(!Gi||Gi.type===t)&&I("Expected comma",G),Yt.push(Gi);return ti||I("Expected "+String.fromCharCode(we),G),Yt},ht=function(){var we,_t;for(we=de(G),we===C?_t=wn():_t=lt(),ae(),we=de(G);we===p||we===b||we===C;)G++,we===p?(ae(),_t={type:i,computed:!1,object:_t,property:lt()}):we===b?(_t={type:i,computed:!0,object:_t,property:_e()},ae(),we=de(G),we!==T&&I("Unclosed [",G),G++):we===C&&(_t={type:s,arguments:Pt(A),callee:_t}),ae(),we=de(G);return _t},wn=function(){G++;var we=_e();if(ae(),de(G)===A)return G++,we;I("Unclosed (",G)},ii=function(){return G++,{type:d,elements:Pt(T)}},nt=[],Mt,ri;G<ie;)Mt=de(G),Mt===w||Mt===g?G++:(ri=_e())?nt.push(ri):G<ie&&I('Unexpected "'+ce(G)+'"',G);return nt.length===1?nt[0]:{type:t,body:nt}};if(q.version="0.3.5",q.toString=function(){return"JavaScript Expression Parser (JSEP) v"+q.version},q.addUnaryOp=function(X){return E=Math.max(X.length,E),B[X]=O,this},q.addBinaryOp=function(X,G){return v=Math.max(X.length,v),L[X]=G,this},q.addLiteral=function(X,G){return P[X]=G,this},q.removeUnaryOp=function(X){return delete B[X],X.length===E&&(E=_(B)),this},q.removeAllUnaryOps=function(){return B={},E=0,this},q.removeBinaryOp=function(X){return delete L[X],X.length===v&&(v=_(L)),this},q.removeAllBinaryOps=function(){return L={},v=0,this},q.removeLiteral=function(X){return delete P[X],this},q.removeAllLiterals=function(){return P={},this},typeof qw>"u"){var j=e.jsep;e.jsep=q,q.noConflict=function(){return e.jsep===q&&(e.jsep=j),q}}else typeof eN<"u"&&eN.exports?qw=eN.exports=q:qw.parse=q})(qw)});var kse=un((nv,c9)=>{var EN=function(){"use strict";var e="B9h79tEBBBENQ9gEUEU9gEUB9gBB9gVUUUUUEU9gDUUEU9gLUUUUEU9gIUUUEU9gVUUUUUB9gLUUUUB9gD99UE99Ie8aDILEVOLEVLRRRRRWWVBOOBEdddLVE9wEIIVIEBEOWEUEC+Q/KEKR/QIhO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9fw9u9j9v9kw9WwvTw949C919m9mwvBE8f9tw79o9v9wT9fw9u9j9v9kw9WwvTw949C919m9mwv9C9v919u9kBDe9tw79o9v9wT9fw9u9j9v9kw9WwvTw949Wwv79p9v9uBIy9tw79o9v9wT9fw9u9j9v9kw69u9kw949C919m9mwvBL8e9tw79o9v9wT9fw9u9j9v9kw69u9kw949C919m9mwv9C9v919u9kBO8a9tw79o9v9wT9fw9u9j9v9kw69u9kw949Wwv79p9v9uBRe9tw79o9v9wT9fw9u9j9v9kw69u9kw949Twg91w9u9jwBWA9tw79o9v9wT9fw9u9j9v9kw69u9kw949Twg91w9u9jw9C9v919u9kBdl9tw79o9v9wT9fw9u9j9v9kws9p2Twv9P9jTBQk9tw79o9v9wT9fw9u9j9v9kws9p2Twv9R919hTBKl9tw79o9v9wT9fw9u9j9v9kws9p2Twvt949wBXe9tw79o9v9wT9f9v9wT9p9t9p96w9WwvTw94j9h9j9owBSA9tw79o9v9wT9f9v9wT9p9t9p96w9WwvTw94j9h9j9ow9TTv9p9wBZA9tw79o9v9wT9f9v9wT9p9t9p96w9WwvTw94swT9j9o9Sw9t9h9wBhL79iv9rBodWEBCEKDqxQ+f9Q8aDBK/EpE8jU8jJJJJBCJO9rGV8kJJJJBCBHODNALCEFAE0MBABCBrBJ+KJJBC+gEv86BBAVCJDFCBCJDZnJJJB8aDNAItMBAVCJDFADALZ+TJJJB8aKABAEFHRABCEFHEAVALFCBCBCJDAL9rALCfE0eZnJJJB8aAVAVCJDFALZ+TJJJBHWCJ/ABAL9uHODNAItMBAOC/wfBgGOCJDAOCJD6eHdCBHQINAWCJLFCBCJDZnJJJB8aAdAIAQ9rAQAdFAI6eHKADAQAL2FHXDNALtMBAKCSFGOC9wgHMAOCL4CIFCD4HpCBHSAXHZAEHhINDNAKtMBAWASFrBBHoCBHEAZHOINAWCJLFAEFAOrBBGaAo9rGoCETAoCkTCk91CR4786BBAOALFHOAaHoAECEFGEAK9HMBKKDNARAh9rAp6MBAhCBApZnJJJBGcApFHEDNAMtMBCBHxAWCJLFHqINARAE9rCk6MDAWCJLFAxFGlrBDHoCUHODNAlrBEGaAlrBBGkvCfEgMBCBHaAoCfEgMBCBHoDNAlrBIMBAlrBLMBAlrBVMBAlrBOMBAlrBRMBAlrBWMBAlrBdMBAlrBQMBAlrBKMBAlrBXMBAlrBMMBCBHaAlrBpMECBHoCUCBAlrBSeHOKCBHaKDNDNDNDNCLCDCECWAOCZ6GheAkCfEgGkCD0CLvAaCfEgGaCD0FAoCfEgGoCD0FAlrBIGyCD0FAlrBLG8aCD0FAlrBVGeCD0FAlrBOG3CD0FAlrBRG5CD0FAlrBWG8eCD0FAlrBdG8fCD0FAlrBQGACD0FAlrBKGHCD0FAlrBXGGCD0FAlrBMG8jCD0FAlrBpG8kCD0FAlrBSG8lCD0FG8mAOCZAheG8n6GOeAkCp0CWvAaCp0FAoCp0FAyCp0FA8aCp0FAeCp0FA3Cp0FA5Cp0FA8eCp0FA8fCp0FAACp0FAHCp0FAGCp0FA8jCp0FA8kCp0FA8lCp0FA8mA8nAOe6GoeGyCUFpDIEBKAcAxCO4FGaAarBBCDCIAoeAxCI4COgTv86BBAyCW9HMEAEAl8pBB83BBAECWFAlCWF8pBB83BBAECZFHEXDKAcAxCO4FGaAarBBCEAxCI4COgTv86BBKCDCLCWCEAheAOeAoeH8aCUAyTCU7HaCBH5AqHeINAEH3A8aHoAeHECBHOINAErBBGhAaAhAaCfEgGk6eAOCfEgAyTvHOAECEFHEAoCUFGoMBKA3AO86BBAeA8aFHeA3CEFHEA5A8aFG5CZ6MBKDNAlrBBGOAk6MBA3AO86BEA3CDFHEKDNAlrBEGOAk6MBAEAO86BBAECEFHEKDNAlrBDGOAk6MBAEAO86BBAECEFHEKDNAlrBIGOAk6MBAEAO86BBAECEFHEKDNAlrBLGOAk6MBAEAO86BBAECEFHEKDNAlrBVGOAk6MBAEAO86BBAECEFHEKDNAlrBOGOAk6MBAEAO86BBAECEFHEKDNAlrBRGOAk6MBAEAO86BBAECEFHEKDNAlrBWGOAk6MBAEAO86BBAECEFHEKDNAlrBdGOAk6MBAEAO86BBAECEFHEKDNAlrBQGOAk6MBAEAO86BBAECEFHEKDNAlrBKGOAk6MBAEAO86BBAECEFHEKDNAlrBXGOAk6MBAEAO86BBAECEFHEKDNAlrBMGOAk6MBAEAO86BBAECEFHEKDNAlrBpGOAk6MBAEAO86BBAECEFHEKAlrBSGOAk6MBAEAO86BBAECEFHEKAqCZFHqAxCZFGxAM6MBKKAEtMBAZCEFHZAEHhASCEFGSALsMDXEKKCBHOXIKAWAXAKCUFAL2FALZ+TJJJB8aAKAQFGQAI6MBKKCBHOARAE9rCAALALCA6e6MBDNALC8f0MBAECBCAAL9rGOZnJJJBAOFHEKAEAWCJDFALZ+TJJJBALFAB9rHOKAVCJOF8kJJJJBAOK9HEEUAECAAECA0eABCJ/ABAE9uC/wfBgGDCJDADCJD6eGDFCUFAD9uAE2ADCL4CIFCD4ADv2FCEFKMBCBABbDJ+KJJBK/pSEeU8jJJJJBC/AE9rGL8kJJJJBCBHVDNAICI9uGOChFAE0MBABCBYD+E+KJJBGRC/gEv86BBALC/ABFCfECJEZnJJJB8aALCuFGW9CU83IBALC8wFGd9CU83IBALCYFGQ9CU83IBALCAFGK9CU83IBALCkFGX9CU83IBALCZFGM9CU83IBAL9CU83IWAL9CU83IBABAEFC9wFGpABCEFGSAOFGE6HODNAItMBCMCSARCB9KeHZCBHhCBHoCBHaCBHcCBHxINDNAOCEgtMBCBHVXIKCDHqADAaCDTFGOYDBHlAOCWFYDBHkAOCLFYDBHyCBH8aCBHODNDNDNDNDNDNDNDNDNINALC/ABFAOCU7AxFCSgCITFGVYDLHeDNAVYDBGVAl9HMBAeAy9HMBAqC9+FHqXDKDNAVAy9HMBAeAk9HMBAqCUFHqXDKDNAVAk9HMBAeAlsMDKAqCLFHqA8aCZFH8aAOCEFGOCZ9HMBXDKKAqC870MBADAqCIgCX2GVC+E1JJBFYDBAaFCDTFYDBHqADAVCJ1JJBFYDBAaFCDTFYDBHyALADAVC11JJBFYDBAaFCDTFYDBGVAcZ+FJJJBGeCBCSAVAhsGkeAeCB9KAeAZ9IgGleHeAkAlCE7gHkDNARCE9IMBAeCS9HMBAVAVAoAVCEFAosGeeGoCEFsMDCMCSAeeHeKASAeA8av86BBAeCS9HMDAVAo9rGOCETAOC8f917HOINAEAOCfB0CRTAOCfBgv86BBAECEFHEAOCR4GOMBKAVHoXIKADCEAkAhsCETAyAhseCX2GOC11JJBFYDBAaFCDTFYDBHqADAOC+E1JJBFYDBAaFCDTFYDBHeADAOCJ1JJBFYDBAaFCDTFYDBHVCBHlDNARCE9IMBAhtMBAVMBAeCE9HMBAqCD9HMBAW9CU83IBAd9CU83IBAQ9CU83IBAK9CU83IBAX9CU83IBAM9CU83IBAL9CU83IWAL9CU83IBCBHhCEHlKAhAVAhsGOFH8aALAeAcZ+FJJJBHyALAqAcZ+FJJJBHkAyCM0MLAyCEFHyXVKCpHeASAOCLTCpv86BBAVHoKAetMBAeAZ9IMEKALAcCDTFAVbDBAcCEFCSgHcKAhAkFHhALC/ABFAxCITFGOAqbDLAOAVbDBALC/ABFAxCEFCSgGOCITFGeAVbDLAeAybDBAOCEFHVXDKCBCSAeA8asG3eHyA8aA3FH8aKDNDNAkCM0MBAkCEFHkXEKCBCSAqA8asG3eHkA8aA3FH8aKDNDNDNDNDNDNDNDNDNDNDNDNDNDNDNDNDNAkAyCLTvG3CfEgG5C+qUFp9UISSSSSSSSSSSSSSWSLQMSSSSSSSSSSSSESVSSSSSSSSSSSSSRDSdSSSSSSSSSSSSSSKSSSSSSSSSSSSSSSSOBKC/wEH8eA5pDMKpKC/xEH8eXXKC/yEH8eXKKC/zEH8eXQKC/0EH8eXdKC/1EH8eXWKC/2EH8eXRKC/3EH8eXOKC/4EH8eXVKC/5EH8eXLKC/6EH8eXIKC/7EH8eXDKC/8EH8eXEKCPEH8eKAlAVAh9HvMBASA8e86BBXEKASC9+CUAOe86BBAEA386BBAECEFHEKDNAOMBAVAo9rGOCETAOC8f917HOINAEAOCfB0CRTAOCfBgv86BBAECEFHEAOCR4GOMBKAVHoKDNAyCS9HMBAeAo9rGOCETAOC8f917HOINAEAOCfB0CRTAOCfBgv86BBAECEFHEAOCR4GOMBKAeHoKDNAkCS9HMBAqAo9rGOCETAOC8f917HOINAEAOCfB0CRTAOCfBgv86BBAECEFHEAOCR4GOMBKAqHoKALAcCDTFAVbDBAcCEFCSgHODNDNAypZBEEEEEEEEEEEEEEBEKALAOCDTFAebDBAcCDFCSgHOKDNDNAkpZBEEEEEEEEEEEEEEBEKALAOCDTFAqbDBAOCEFCSgHOKALC/ABFAxCITFGyAVbDLAyAebDBALC/ABFAxCEFCSgCITFGyAebDLAyAqbDBALC/ABFAxCDFCSgCITFGeAqbDLAeAVbDBAxCIFHVAOHcA8aHhKApAE6HOASCEFHSAVCSgHxAaCIFGaAI6MBKKCBHVAOMBAE9C/lm+i/D+Z+g8a83BWAE9CJ/s+d+0/1+M/e/U+GU83BBAEAB9rCZFHVKALC/AEF8kJJJJBAVK+mIEEUCBHIDNABADCUFCSgCDTFYDBAEsMBCEHIABADCpFCSgCDTFYDBAEsMBCDHIABADCMFCSgCDTFYDBAEsMBCIHIABADCXFCSgCDTFYDBAEsMBCLHIABADCKFCSgCDTFYDBAEsMBCVHIABADCQFCSgCDTFYDBAEsMBCOHIABADCdFCSgCDTFYDBAEsMBCRHIABADCWFCSgCDTFYDBAEsMBCWHIABADCRFCSgCDTFYDBAEsMBCdHIABADCOFCSgCDTFYDBAEsMBCQHIABADCVFCSgCDTFYDBAEsMBCKHIABADCLFCSgCDTFYDBAEsMBCXHIABADCIFCSgCDTFYDBAEsMBCMHIABADCDFCSgCDTFYDBAEsMBCpHIABADCEFCSgCDTFYDBAEsMBCSCUABADCSgCDTFYDBAEseSKAIKjEIUCRHDDNINADCEFHIADC96FGLC8f0MEAIHDCEALTAE6MBKKAICR9uCI2CDFABCI9u2ChFKMBCBABbD+E+KJJBK+YDERU8jJJJJBCZ9rHLCBHVDNAICVFAE0MBCBHVABCBrB+E+KJJBC/QEv86BBAL9CB83IWABCEFHOABAEFC98FHRDNAItMBCBHWINDNARAO0MBCBSKAVADAWCDTFYDBGdALCWFAVCDTFYDB9rGEAEC8f91GEFAE7C59K7GVAdALCWFAVCDTFGQYDB9rGEC8f91CETAECDT7vHEINAOAECfB0CRTAECfBgv86BBAOCEFHOAECR4GEMBKAQAdbDBAWCEFGWAI9HMBKKCBHVARAO6MBAOCBbBBAOAB9rCLFHVKAVK86EIUCWHDDNINADCEFHIADC95FGLC8f0MEAIHDCEALTAE6MBKKAICR9uAB2CVFK+yWDEUO99DNAEtMBADCLsHVCUADCETCUFTCU7HDDNDNCUAICUFTCU7+yGOjBBBzmGR+LjBBB9P9dtMBAR+oHIXEKCJJJJ94HIKAD+yHWDNAVMBABCOFHDINALCLFiDBGRjBBBBjBBJzALiDBGd+LAR+LmALCWFiDBGQ+LmGR+VARjBBBB9beGRnHKAdARnHRALCXFiDBHdDNDNAQjBBBB9gtMBAKHQXEKjBBJzAR+L+TGQAQ+MAKjBBBB9geHQjBBJzAK+L+TGKAK+MARjBBBB9geHRKADC9+FAI87EBDNDNjBBBzjBBB+/AdjBBBB9geAdjBBJ+/AdjBBJ+/9geGdjBBJzAdjBBJz9feAWnmGd+LjBBB9P9dtMBAd+oHBXEKCJJJJ94HBKADAB87EBDNDNjBBBzjBBB+/AQjBBBB9geAQjBBJ+/AQjBBJ+/9geGdjBBJzAdjBBJz9feAOnmGd+LjBBB9P9dtMBAd+oHBXEKCJJJJ94HBKADC98FAB87EBDNDNjBBBzjBBB+/ARjBBBB9geARjBBJ+/ARjBBJ+/9geGRjBBJzARjBBJz9feAOnmGR+LjBBB9P9dtMBAR+oHBXEKCJJJJ94HBKADC96FAB87EBALCZFHLADCWFHDAECUFGEMBXDKKABCIFHDINALCLFiDBGRjBBBBjBBJzALiDBGd+LAR+LmALCWFiDBGQ+LmGR+VARjBBBB9beGRnHKAdARnHRALCXFiDBHdDNDNAQjBBBB9gtMBAKHQXEKjBBJzAR+L+TGQAQ+MAKjBBBB9geHQjBBJzAK+L+TGKAK+MARjBBBB9geHRKADCUFAI86BBDNDNjBBBzjBBB+/AdjBBBB9geAdjBBJ+/AdjBBJ+/9geGdjBBJzAdjBBJz9feAWnmGd+LjBBB9P9dtMBAd+oHBXEKCJJJJ94HBKADAB86BBDNDNjBBBzjBBB+/AQjBBBB9geAQjBBJ+/AQjBBJ+/9geGdjBBJzAdjBBJz9feAOnmGd+LjBBB9P9dtMBAd+oHBXEKCJJJJ94HBKADC9+FAB86BBDNDNjBBBzjBBB+/ARjBBBB9geARjBBJ+/ARjBBJ+/9geGRjBBJzARjBBJz9feAOnmGR+LjBBB9P9dtMBAR+oHBXEKCJJJJ94HBKADC99FAB86BBALCZFHLADCLFHDAECUFGEMBKKK/KLLD99EUE99EUDNAEtMBDNDNCUAICUFTCU7+yGVjBBBzmGO+LjBBB9P9dtMBAO+oHIXEKCJJJJ94HIKAIC/8fIgHRINABCOFCICDALCLFiDB+LALiDB+L9eGIALCWFiDB+LALAICDTFiDB+L9eeGIALCXFiDB+LALAICDTFiDB+L9eeGIARv87EBDNDNjBBBzjBBB+/ALAICEFCIgCDTFiDBj/zL+1znjBBJ+/jBBJzALAICDTFiDBjBBBB9deGOnGWjBBBB9geAWjBBJ+/AWjBBJ+/9geGWjBBJzAWjBBJz9feAVnmGW+LjBBB9P9dtMBAW+oHdXEKCJJJJ94HdKABAd87EBDNDNjBBBzjBBB+/AOALAICDFCIgCDTFiDBj/zL+1znnGWjBBBB9geAWjBBJ+/AWjBBJ+/9geGWjBBJzAWjBBJz9feAVnmGW+LjBBB9P9dtMBAW+oHdXEKCJJJJ94HdKABCDFAd87EBDNDNjBBBzjBBB+/AOALAICUFCIgCDTFiDBj/zL+1znnGOjBBBB9geAOjBBJ+/AOjBBJ+/9geGOjBBJzAOjBBJz9feAVnmGO+LjBBB9P9dtMBAO+oHIXEKCJJJJ94HIKABCLFAI87EBABCWFHBALCZFHLAECUFGEMBKKK+tDDWUE998jJJJJBCZ9rGV8kJJJJBDNAEtMBADCD4GOtMBCEAI9rHRAOCDTHWCBHdINC+cUHDALHIAOHQINAIiDBAVCXFZ+YJJJB8aAVYDXGKADADAK9IeHDAICLFHIAQCUFGQMBKARADFGICkTHKCBHDCBAI9rHXAOHIINDNDNALADFiDBGMAXZ+XJJJBjBBBzjBBB+/AMjBBBB9gemGM+LjBBB9P9dtMBAM+oHQXEKCJJJJ94HQKABADFAQCfffRgAKvbDBADCLFHDAICUFGIMBKABAWFHBALAWFHLAdCEFGdAE9HMBKKAVCZF8kJJJJBK+iMDlUI998jJJJJBC+QD9rGV8kJJJJBAVC+oEFCBC/kBZnJJJB8aCBHODNADtMBCBHOAItMBDNABAE9HMBAVCUADCDTGRADCffffI0eCBYD/4+JJJBhJJJJBBGEbD+oEAVCEbD1DAEABARZ+TJJJB8aKAVC+YEFCWFCBbDBAV9CB83I+YEAVC+YEFAEADAIAVC+oEFZ+OJJJBCUAICDTGWAICffffI0eGdCBYD/4+JJJBhJJJJBBHRAVC+oEFAVYD1DGOCDTFARbDBAVAOCEFGQbD1DARAVYD+YEGKAWZ+TJJJBHXAVC+oEFAQCDTFADCI9uGMCBYD/4+JJJBhJJJJBBGRbDBAVAOCDFGWbD1DARCBAMZnJJJBHpAVC+oEFAWCDTFAdCBYD/4+JJJBhJJJJBBGSbDBAVAOCIFGQbD1DAXHRASHWINAWALiDBALARYDBGdCWAdCW6eCDTFC/EBFiDBmuDBARCLFHRAWCLFHWAICUFGIMBKCBHIAVC+oEFAQCDTFCUAMCDTADCffff970eCBYD/4+JJJBhJJJJBBGQbDBAVAOCLFGObD1DDNADCI6MBAEHRAQHWINAWASARYDBCDTFiDBASARCLFYDBCDTFiDBmASARCWFYDBCDTFiDBmuDBARCXFHRAWCLFHWAICEFGIAM6MBKKAVC/MBFHZAVYD+cEHhAVYD+gEHoAVHRCBHdCBHWCBHaCEHcINARHxAEAWCX2FGqCWFGlYDBHDAqYDBHkABAaCX2FGRCLFAqCLFGyYDBG8abDBARAkbDBARCWFADbDBApAWFCE86BBAZADbDWAZA8abDLAZAkbDBAQAWCDTFCBbDBCIHeDNAdtMBAxHRINDNARYDBGIADsMBAIAksMBAIA8asMBAZAeCDTFAIbDBAeCEFHeKARCLFHRAdCUFGdMBKKAXAkCDTFGRARYDBCUFbDBAXA8aCDTFGRARYDBCUFbDBAXADCDTFGRARYDBCUFbDBAoAhAqYDBCDTGIFYDBCDTFGkHRAKAIFGDYDBGdHIDNAdtMBDNINARYDBAWsMEARCLFHRAICUFGItMDXBKKARAdCDTAkFC98FYDBbDBADADYDBCUFbDBKAoAhAyYDBCDTGIFYDBCDTFGkHRAKAIFGDYDBGdHIDNAdtMBDNINARYDBAWsMEARCLFHRAICUFGIMBXDKKARAdCDTAkFC98FYDBbDBADADYDBCUFbDBKDNAKAlYDBCDTGRFGDYDBGdtMBAoAhARFYDBCDTFGkHRAdHIDNINARYDBAWsMEARCLFHRAICUFGIMBXDKKARAdCDTAkFC98FYDBbDBADADYDBCUFbDBKDNDNAetMBCUHWjBBBBH3CBHRINASAZARCDTFYDBCDTGIFGdiDBH5AdALCBARCEFGkARCS0eCDTFiDBALAXAIFYDBGRCWARCW6eCDTFC/EBFiDBmG8euDBDNAKAIFYDBGdtMBA8eA5+TH8eAoAhAIFYDBCDTFHRAdCDTHIINAQARYDBGdCDTFGDA8eADiDBmG5uDBA5A3A3A59dGDeH3AdAWADeHWARCLFHRAIC98FGIMBKKAkHRAkAe9HMBKAWCU9HMEKAcAM9PMDINDNApAcFrBBMBAcHWXDKAMAcCEFGc9HMBXIKKAaCEFHaAeCZAeCZ6eHdAZHRAxHZAWCU9HMBKKAOCDTAVC+oEFFC98FHRDNINAOtMEARYDBCBYD/0+JJJBh+BJJJBBARC98FHRAOCUFHOXBKKAVC+QDF8kJJJJBK/iLEVUCUAICDTGVAICffffI0eGOCBYD/4+JJJBhJJJJBBHRALALYD9gGWCDTFARbDBALAWCEFbD9gABARbDBAOCBYD/4+JJJBhJJJJBBHRALALYD9gGOCDTFARbDBALAOCEFbD9gABARbDLCUADCDTADCffffI0eCBYD/4+JJJBhJJJJBBHRALALYD9gGOCDTFARbDBALAOCEFbD9gABARbDWABYDBCBAVZnJJJB8aADCI9uHdDNADtMBABYDBHOAEHLADHRINAOALYDBCDTFGVAVYDBCEFbDBALCLFHLARCUFGRMBKKDNAItMBABYDBHLABYDLHRCBHVAIHOINARAVbDBARCLFHRALYDBAVFHVALCLFHLAOCUFGOMBKKDNADCI6MBABYDLHRABYDWHVCBHLINAECWFYDBHOAECLFYDBHDARAEYDBCDTFGWAWYDBGWCEFbDBAVAWCDTFALbDBARADCDTFGDADYDBGDCEFbDBAVADCDTFALbDBARAOCDTFGOAOYDBGOCEFbDBAVAOCDTFALbDBAECXFHEALCEFGLAd6MBKKDNAItMBABYDLHEABYDBHLINAEAEYDBALYDB9rbDBALCLFHLAECLFHEAICUFGIMBKKKqBABAEADAIC+k1JJBZ+NJJJBKqBABAEADAIC+M+JJJBZ+NJJJBK9dEEUABCfEAICDTZnJJJBHLCBHIDNADtMBINDNALAEYDBCDTFGBYDBCU9HMBABAIbDBAICEFHIKAECLFHEADCUFGDMBKKAIK9TEIUCBCBYD/8+JJJBGEABCIFC98gFGBbD/8+JJJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABK9TEIUCBCBYD/8+JJJBGEABCIFC98gFGBbD/8+JJJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK9+EIUzBHEDNDNCBYD/8+JJJBGDAECZTGI9NMBCUHEADAI9rCffIFCZ4NBCUsMEKADHEKCBABAE9rCIFC98gCBYD/8+JJJBFGDbD/8+JJJBDNADzBCZTGE9NMBADAE9rCffIFCZ4NB8aKKXBABAEZ+ZJJJBK+BEEIUDNAB+8GDCl4GICfEgGLCfEsMBDNALMBDNABjBBBB9cMBAECBbDBABSKABjBBJ9fnAEZ+YJJJBHBAEAEYDBCNFbDBABSKAEAICfEgC+CUFbDBADCfff+D94gCJJJ/4Iv++HBKABK+gEBDNDNAECJE9IMBABjBBBUnHBDNAECfE9OMBAEC+BUFHEXDKABjBBBUnHBAECPDAECPD9IeC+C9+FHEXEKAEC+BU9KMBABjBBJXnHBDNAEC+b9+9MMBAEC/mBFHEXEKABjBBJXnHBAEC+299AEC+2999KeC/MEFHEKABAEClTCJJJ/8IF++nKK+ODDBCJWK/0EBBBBEBBBDBBBEBBBDBBBBBBBDBBBBBBBEBBBBBBB+L29Hz/69+9Kz/n/76z/RG97z/Z/O9Xz8j/b85z/+/U9Yz/B/K9hz+2/z9dz9E+L9Mz59a8kz+R/t3z+a+Zyz79ohz/J4++8++y+d9v8+BBBB9S+49+z8r+Hbz9m9m/m8+l/Z/O8+/8+pg89Q/X+j878r+Hq8++m+b/E87BBBBBBJzBBJzBBJz+e/v/n8++y+dSz9I/h/68+XD/r8+/H0838+/w+nOzBBBB+wv9o8+UF888+9I/h/68+9C9g/l89/N/M9M89/d8kO8+BBBBF+8Tz9M836zs+2azl/Zpzz818ez9E+LXz/u98f8+819e/68+BC/0dKXEBBBDBBBZwBB",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(d){n=d.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(0),n.exports.meshopt_encodeIndexVersion(1)});function r(d){for(var p=new Uint8Array(d.length),g=0;g<d.length;++g){var m=d.charCodeAt(g);p[g]=m>96?m-71:m>64?m-65:m>47?m+4:m>46?63:62}for(var x=0,g=0;g<d.length;++g)p[x++]=p[g]<60?t[p[g]]:(p[g]-60)*64+p[++g];return p.buffer.slice(0,x)}function o(d){if(!d)throw new Error("Assertion failed")}function s(d,p,g){var m=n.exports.sbrk,x=m(d.length*4),C=m(p*4),A=new Uint8Array(n.exports.memory.buffer),b=new Uint8Array(d.buffer,d.byteOffset,d.byteLength);A.set(b,x),g&&g(x,x,d.length,p);var T=n.exports.meshopt_optimizeVertexFetchRemap(C,x,d.length,p);A=new Uint8Array(n.exports.memory.buffer);var S=new Uint32Array(p);new Uint8Array(S.buffer).set(A.subarray(C,C+p*4)),b.set(A.subarray(x,x+d.length*4)),m(x-m(0));for(var w=0;w<d.length;++w)d[w]=S[d[w]];return[S,T]}function a(d,p,g,m,x){var C=n.exports.sbrk,A=C(p),b=C(m*x),T=new Uint8Array(n.exports.memory.buffer);T.set(new Uint8Array(g.buffer,g.byteOffset,g.byteLength),b);var S=d(A,p,b,m,x),w=new Uint8Array(S);return w.set(T.subarray(A,A+S)),C(A-C(0)),w}function c(d){for(var p=0,g=0;g<d.length;++g){var m=d[g];p=p<m?m:p}return p}function u(d,p){if(o(p==2||p==4),p==4)return new Uint32Array(d.buffer,d.byteOffset,d.byteLength/4);var g=new Uint16Array(d.buffer,d.byteOffset,d.byteLength/2);return new Uint32Array(g)}function f(d,p,g,m,x,C){var A=n.exports.sbrk,b=A(g*m),T=A(g*C),S=new Uint8Array(n.exports.memory.buffer);S.set(new Uint8Array(p.buffer,p.byteOffset,p.byteLength),T),d(b,g,m,x,T);var w=new Uint8Array(g*m);return w.set(S.subarray(b,b+g*m)),A(b-A(0)),w}return{ready:i,supported:!0,reorderMesh:function(d,p,g){var m=p?g?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return s(d,c(d)+1,m)},encodeVertexBuffer:function(d,p,g){o(g>0&&g<=256),o(g%4==0);var m=n.exports.meshopt_encodeVertexBufferBound(p,g);return a(n.exports.meshopt_encodeVertexBuffer,m,d,p,g)},encodeIndexBuffer:function(d,p,g){o(g==2||g==4),o(p%3==0);var m=u(d,g),x=n.exports.meshopt_encodeIndexBufferBound(p,c(m)+1);return a(n.exports.meshopt_encodeIndexBuffer,x,m,p,4)},encodeIndexSequence:function(d,p,g){o(g==2||g==4);var m=u(d,g),x=n.exports.meshopt_encodeIndexSequenceBound(p,c(m)+1);return a(n.exports.meshopt_encodeIndexSequence,x,m,p,4)},encodeGltfBuffer:function(d,p,g,m){var x={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return o(x[m]),x[m](d,p,g)},encodeFilterOct:function(d,p,g,m){return o(g==4||g==8),o(m>=1&&m<=16),f(n.exports.meshopt_encodeFilterOct,d,p,g,m,4)},encodeFilterQuat:function(d,p,g,m){return o(g==8),o(m>=4&&m<=16),f(n.exports.meshopt_encodeFilterQuat,d,p,g,m,4)},encodeFilterExp:function(d,p,g,m){return o(g>0&&g%4==0),o(m>=1&&m<=24),f(n.exports.meshopt_encodeFilterExp,d,p,g,m,g/4)}}}();typeof nv=="object"&&typeof c9=="object"?c9.exports=EN:typeof define=="function"&&define.amd?define([],function(){return EN}):typeof nv=="object"?nv.MeshoptEncoder=EN:(typeof self<"u"?self:nv).MeshoptEncoder=EN});var Use=un((iv,l9)=>{var SN=function(){"use strict";var e="B9h79tEBBBE8fV9gBB9gVUUUUUEU9gIUUUB9gEUEU9gIUUUEUIKQBEEEDDDILLLVE9wEEEVIEBEOWEUEC+Q/IEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBEy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBDe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBIl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBLk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBOL79iv9rBRQ+x8yQDBK/qMEZU8jJJJJBCJ/EB9rGV8kJJJJBC9+HODNADCEFAL0MBCUHOAIrBBC+gE9HMBAVAIALFGRAD9rADZ1JJJBHWCJ/ABAD9uC/wfBgGOCJDAOCJD6eHdAICEFHLCBHQDNINAQAE9PMEAdAEAQ9rAQAdFAE6eHKDNDNADtMBAKCSFGOC9wgHXAOCL4CIFCD4HMAWCJDFHpCBHSALHZINDNARAZ9rAM9PMBCBHLXIKAZAMFHLDNAXtMBCBHhCBHIINDNARAL9rCk9PMBCBHLXVKAWCJ/CBFAIFHODNDNDNDNDNAZAICO4FrBBAhCOg4CIgpLBEDIBKAO9CB83IBAOCWF9CB83IBXIKAOALrBLALrBBGoCO4GaAaCIsGae86BBAOCEFALCLFAaFGarBBAoCL4CIgGcAcCIsGce86BBAOCDFAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOCIFAaAcFGarBBAoCIgGoAoCIsGoe86BBAOCLFAaAoFGarBBALrBEGoCO4GcAcCIsGce86BBAOCVFAaAcFGarBBAoCL4CIgGcAcCIsGce86BBAOCOFAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOCRFAaAcFGarBBAoCIgGoAoCIsGoe86BBAOCWFAaAoFGarBBALrBDGoCO4GcAcCIsGce86BBAOCdFAaAcFGarBBAoCL4CIgGcAcCIsGce86BBAOCQFAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOCKFAaAcFGarBBAoCIgGoAoCIsGoe86BBAOCXFAaAoFGorBBALrBIGLCO4GaAaCIsGae86BBAOCMFAoAaFGorBBALCL4CIgGaAaCIsGae86BBAOCpFAoAaFGorBBALCD4CIgGaAaCIsGae86BBAOCSFAoAaFGOrBBALCIgGLALCIsGLe86BBAOALFHLXDKAOALrBWALrBBGoCL4GaAaCSsGae86BBAOCEFALCWFAaFGarBBAoCSgGoAoCSsGoe86BBAOCDFAaAoFGorBBALrBEGaCL4GcAcCSsGce86BBAOCIFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCLFAoAaFGorBBALrBDGaCL4GcAcCSsGce86BBAOCVFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCOFAoAaFGorBBALrBIGaCL4GcAcCSsGce86BBAOCRFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCWFAoAaFGorBBALrBLGaCL4GcAcCSsGce86BBAOCdFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCQFAoAaFGorBBALrBVGaCL4GcAcCSsGce86BBAOCKFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCXFAoAaFGorBBALrBOGaCL4GcAcCSsGce86BBAOCMFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCpFAoAaFGorBBALrBRGLCL4GaAaCSsGae86BBAOCSFAoAaFGOrBBALCSgGLALCSsGLe86BBAOALFHLXEKAOAL8pBB83BBAOCWFALCWF8pBB83BBALCZFHLKAhCDFHhAICZFGIAX6MBKKDNALMBCBHLXIKDNAKtMBAWASFrBBHhCBHOApHIINAIAWCJ/CBFAOFrBBGZCE4CBAZCEg9r7AhFGh86BBAIADFHIAOCEFGOAK9HMBKKApCEFHpALHZASCEFGSAD9HMBKKABAQAD2FAWCJDFAKAD2Z1JJJB8aAWAWCJDFAKCUFAD2FADZ1JJJB8aKAKCBALeAQFHQALMBKC9+HOXEKCBC99ARAL9rADCAADCA0eseHOKAVCJ/EBF8kJJJJBAOK+OoEZU8jJJJJBC/AE9rGV8kJJJJBC9+HODNAECI9uGRChFAL0MBCUHOAIrBBGWC/wEgC/gE9HMBAWCSgGdCE0MBAVC/ABFCfECJEZ+JJJJB8aAVCuF9CU83IBAVC8wF9CU83IBAVCYF9CU83IBAVCAF9CU83IBAVCkF9CU83IBAVCZF9CU83IBAV9CU83IWAV9CU83IBAIALFC9wFHQAICEFGWARFHKDNAEtMBCMCSAdCEseHXABHICBHdCBHMCBHpCBHLCBHOINDNAKAQ9NMBC9+HOXIKDNDNAWrBBGRC/vE0MBAVC/ABFARCL4CU7AOFCSgCITFGSYDLHZASYDBHhDNARCSgGSAX9PMBAVARCU7ALFCSgCDTFYDBAdASeHRAStHSDNDNADCD9HMBABAh87EBABCLFAR87EBABCDFAZ87EBXEKAIAhbDBAICWFARbDBAICLFAZbDBKAdASFHdAVC/ABFAOCITFGoARbDBAoAZbDLAVALCDTFARbDBAVC/ABFAOCEFCSgGOCITFGZAhbDBAZARbDLALASFHLAOCEFHOXDKDNDNASCSsMBAMASFASC987FCEFHMXEKAK8sBBGSCfEgHRDNDNASCU9MMBAKCEFHKXEKAK8sBEGSCfBgCRTARCfBgvHRDNASCU9MMBAKCDFHKXEKAK8sBDGSCfBgCpTARvHRDNASCU9MMBAKCIFHKXEKAK8sBIGSCfBgCxTARvHRDNASCU9MMBAKCLFHKXEKAKrBLC3TARvHRAKCVFHKKARCE4CBARCEg9r7AMFHMKDNDNADCD9HMBABAh87EBABCLFAM87EBABCDFAZ87EBXEKAIAhbDBAICWFAMbDBAICLFAZbDBKAVC/ABFAOCITFGRAMbDBARAZbDLAVALCDTFAMbDBAVC/ABFAOCEFCSgGOCITFGRAhbDBARAMbDLALCEFHLAOCEFHOXEKDNARCPE0MBAVALAQARCSgFrBBGSCL4GZ9rCSgCDTFYDBAdCEFGhAZeHRAVALAS9rCSgCDTFYDBAhAZtGoFGhASCSgGZeHSAZtHZDNDNADCD9HMBABAd87EBABCLFAS87EBABCDFAR87EBXEKAIAdbDBAICWFASbDBAICLFARbDBKAVALCDTFAdbDBAVC/ABFAOCITFGaARbDBAaAdbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALAoFCSgGLCDTFASbDBAVC/ABFAOCDFCSgGOCITFGRAdbDBARASbDLAOCEFHOALAZFHLAhAZFHdXEKAdCBAKrBBGaeGZARC/+EsGcFHRAaCSgHhDNDNAaCL4GoMBARCEFHSXEKARHSAVALAo9rCSgCDTFYDBHRKDNDNAhMBASCEFHdXEKASHdAVALAa9rCSgCDTFYDBHSKDNDNActMBAKCEFHaXEKAK8sBEGaCfEgHZDNDNAaCU9MMBAKCDFHaXEKAK8sBDGaCfBgCRTAZCfBgvHZDNAaCU9MMBAKCIFHaXEKAK8sBIGaCfBgCpTAZvHZDNAaCU9MMBAKCLFHaXEKAK8sBLGaCfBgCxTAZvHZDNAaCU9MMBAKCVFHaXEKAKCOFHaAKrBVC3TAZvHZKAZCE4CBAZCEg9r7AMFGMHZKDNDNAoCSsMBAaHcXEKAa8sBBGKCfEgHRDNDNAKCU9MMBAaCEFHcXEKAa8sBEGKCfBgCRTARCfBgvHRDNAKCU9MMBAaCDFHcXEKAa8sBDGKCfBgCpTARvHRDNAKCU9MMBAaCIFHcXEKAa8sBIGKCfBgCxTARvHRDNAKCU9MMBAaCLFHcXEKAaCVFHcAarBLC3TARvHRKARCE4CBARCEg9r7AMFGMHRKDNDNAhCSsMBAcHKXEKAc8sBBGKCfEgHSDNDNAKCU9MMBAcCEFHKXEKAc8sBEGKCfBgCRTASCfBgvHSDNAKCU9MMBAcCDFHKXEKAc8sBDGKCfBgCpTASvHSDNAKCU9MMBAcCIFHKXEKAc8sBIGKCfBgCxTASvHSDNAKCU9MMBAcCLFHKXEKAcCVFHKAcrBLC3TASvHSKASCE4CBASCEg9r7AMFGMHSKDNDNADCD9HMBABAZ87EBABCLFAS87EBABCDFAR87EBXEKAIAZbDBAICWFASbDBAICLFARbDBKAVC/ABFAOCITFGaARbDBAaAZbDLAVALCDTFAZbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCDFCSgCITFGRAZbDBARASbDLAVALAotAoCSsvFGLCSgCDTFASbDBALAhtAhCSsvFHLAOCIFHOKAWCEFHWABCOFHBAICXFHIAOCSgHOALCSgHLApCIFGpAE6MBKKCBC99AKAQseHOKAVC/AEF8kJJJJBAOK/tLEDU8jJJJJBCZ9rHVC9+HODNAECVFAL0MBCUHOAIrBBC/+EgC/QE9HMBAV9CB83IWAICEFHOAIALFC98FHIDNAEtMBDNADCDsMBINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKAVCWFALCEgCDTvGDALCD4CBALCE4CEg9r7ADYDBFGLbDBABALbDBABCLFHBAECUFGEMBXDKKINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKABALCD4CBALCE4CEg9r7AVCWFALCEgCDTvGLYDBFGD87EBALADbDBABCDFHBAECUFGEMBKKCBC99AOAIseHOKAOK+lVOEUE99DUD99EUD99DNDNADCL9HMBAEtMEINDNDNjBBBzjBBB+/ABCDFGD8sBB+yAB8sBBGI+yGL+L+TABCEFGV8sBBGO+yGR+L+TGWjBBBB9gGdeAWjBB/+9CAWAWnjBBBBAWAdeGQAQ+MGKAICU9KeALmGLALnAQAKAOCU9KeARmGQAQnmm+R+VGRnmGW+LjBBB9P9dtMBAW+oHIXEKCJJJJ94HIKADAI86BBDNDNjBBBzjBBB+/AQjBBBB9geAQARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKAVAD86BBDNDNjBBBzjBBB+/ALjBBBB9geALARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKABAD86BBABCLFHBAECUFGEMBXDKKAEtMBINDNDNjBBBzjBBB+/ABCLFGD8uEB+yAB8uEBGI+yGL+L+TABCDFGV8uEBGO+yGR+L+TGWjBBBB9gGdeAWjB/+fsAWAWnjBBBBAWAdeGQAQ+MGKAICU9KeALmGLALnAQAKAOCU9KeARmGQAQnmm+R+VGRnmGW+LjBBB9P9dtMBAW+oHIXEKCJJJJ94HIKADAI87EBDNDNjBBBzjBBB+/AQjBBBB9geAQARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKAVAD87EBDNDNjBBBzjBBB+/ALjBBBB9geALARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKABAD87EBABCWFHBAECUFGEMBKKK/SILIUI99IUE99DNAEtMBCBHIABHLINDNDNj/zL81zALCOF8uEBGVCIv+y+VGOAL8uEB+ynGRjB/+fsnjBBBzjBBB+/ARjBBBB9gemGW+LjBBB9P9dtMBAW+oHdXEKCJJJJ94HdKALCLF8uEBHQALCDF8uEBHKABAVCEFCIgAIvCETFAd87EBDNDNAOAK+ynGWjB/+fsnjBBBzjBBB+/AWjBBBB9gemGX+LjBBB9P9dtMBAX+oHKXEKCJJJJ94HKKABAVCDFCIgAIvCETFAK87EBDNDNAOAQ+ynGOjB/+fsnjBBBzjBBB+/AOjBBBB9gemGX+LjBBB9P9dtMBAX+oHQXEKCJJJJ94HQKABAVCUFCIgAIvCETFAQ87EBDNDNjBBJzARARn+TAWAWn+TAOAOn+TGRjBBBBARjBBBB9ge+RjB/+fsnjBBBzmGR+LjBBB9P9dtMBAR+oHQXEKCJJJJ94HQKABAVCIgAIvCETFAQ87EBALCWFHLAICLFHIAECUFGEMBKKK6BDNADCD4AE2GEtMBINABABYDBGDCWTCW91+yADCk91ClTCJJJ/8IF++nuDBABCLFHBAECUFGEMBKKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABKKKEBCJWKLZ9kBB",t="B9h79tEBBBE5V9gBB9gVUUUUUEU9gIUUUB9gDUUB9gEUEUIMXBBEBEEDIDIDLLVE9wEEEVIEBEOWEUEC+Q/aEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBDy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBLe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBOk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBWl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBQL79iv9rBKQ/j6XLBZIK9+EVU8jJJJJBCZ9rHBCBHEINCBHDCBHIINABCWFADFAICJUAEAD4CEgGLe86BBAIALFHIADCEFGDCW9HMBKAEC+Q+YJJBFAI86BBAECITC+Q1JJBFAB8pIW83IBAECEFGECJD9HMBKK1HLSUD97EUO978jJJJJBCJ/KB9rGV8kJJJJBC9+HODNADCEFAL0MBCUHOAIrBBC+gE9HMBAVAIALFGRAD9rAD/8QBBCJ/ABAD9uC/wfBgGOCJDAOCJD6eHWAICEFHOCBHdDNINAdAE9PMEAWAEAd9rAdAWFAE6eHQDNDNADtMBAQCSFGLC9wgGKCI2HXAKCETHMALCL4CIFCD4HpCBHSINAOHZCBHhDNINDNARAZ9rAp9PMBCBHOXVKAVCJ/CBFAhAK2FHoAZApFHOCBHIDNAKC/AB6MBARAO9rC/gB6MBCBHLINAoALFHIDNDNDNDNDNAZALCO4FrBBGaCIgpLBEDIBKAICBPhPKLBXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAIAOPBBBPKLBAOCZFHOKDNDNDNDNDNAaCD4CIgpLBEDIBKAICBPhPKLZXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLZAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLZAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAIAOPBBBPKLZAOCZFHOKDNDNDNDNDNAaCL4CIgpLBEDIBKAICBPhPKLAXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLAAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLAAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAIAOPBBBPKLAAOCZFHOKDNDNDNDNDNAaCO4pLBEDIBKAICBPhPKL8wXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBAaC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKL8wAOCLFAlPqBFAaC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBAaC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKL8wAOCWFAlPqBFAaC+Q+YJJBFrBBFHOXEKAIAOPBBBPKL8wAOCZFHOKALC/ABFHIALCJEFAK0MEAIHLARAO9rC/fB0MBKKDNAIAK9PMBAICI4HLINDNARAO9rCk9PMBCBHOXRKAoAIFHaDNDNDNDNDNAZAICO4FrBBALCOg4CIgpLBEDIBKAaCBPhPKLBXIKAaAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAaAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAaAOPBBBPKLBAOCZFHOKALCDFHLAICZFGIAK6MBKKDNAOtMBAOHZAhCEFGhCLsMDXEKKCBHOXIKDNAKtMBAVCJDFASFHIAVASFPBDBHlCBHaINAIAVCJ/CBFAaFGLPBLBGxCEP9tAxCEPSGcP9OP9hP9RGxALAKFPBLBGkCEP9tAkAcP9OP9hP9RGkPMBZEhDoIaLcVxOqRlGyALAMFPBLBG8aCEP9tA8aAcP9OP9hP9RG8aALAXFPBLBGeCEP9tAeAcP9OP9hP9RGePMBZEhDoIaLcVxOqRlG3PMBEZhDIoaLVcxORqlGcAcPMBEDIBEDIBEDIBEDIAlP9uGlPeBbDBAIADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFGLAlAyA3PMWdkyQK8aeXM35pS8e8fGcAcPMBEDIBEDIBEDIBEDIP9uGlPeBbDBALADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFGLAlAxAkPMWkdyQ8aKeX3M5p8eS8fGxA8aAePMWkdyQ8aKeX3M5p8eS8fGkPMBEZhDIoaLVcxORqlGcAcPMBEDIBEDIBEDIBEDIP9uGlPeBbDBALADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFGLAlAxAkPMWdkyQK8aeXM35pS8e8fGcAcPMBEDIBEDIBEDIBEDIP9uGlPeBbDBALADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFHIAaCZFGaAK6MBKKASCLFGSAD6MBKKABAdAD2FAVCJDFAQAD2/8QBBAVAVCJDFAQCUFAD2FAD/8QBBKAQCBAOeAdFHdAOMBKC9+HOXEKCBC99ARAO9rADCAADCA0eseHOKAVCJ/KBF8kJJJJBAOKWBZ+BJJJBK+KoEZU8jJJJJBC/AE9rGV8kJJJJBC9+HODNAECI9uGRChFAL0MBCUHOAIrBBGWC/wEgC/gE9HMBAWCSgGdCE0MBAVC/ABFCfECJE/8KBAVCuF9CU83IBAVC8wF9CU83IBAVCYF9CU83IBAVCAF9CU83IBAVCkF9CU83IBAVCZF9CU83IBAV9CU83IWAV9CU83IBAIALFC9wFHQAICEFGWARFHKDNAEtMBCMCSAdCEseHXABHICBHdCBHMCBHpCBHLCBHOINDNAKAQ9NMBC9+HOXIKDNDNAWrBBGRC/vE0MBAVC/ABFARCL4CU7AOFCSgCITFGSYDLHZASYDBHhDNARCSgGSAX9PMBAVARCU7ALFCSgCDTFYDBAdASeHRAStHSDNDNADCD9HMBABAh87EBABCLFAR87EBABCDFAZ87EBXEKAIAhbDBAICWFARbDBAICLFAZbDBKAdASFHdAVC/ABFAOCITFGoARbDBAoAZbDLAVALCDTFARbDBAVC/ABFAOCEFCSgGOCITFGZAhbDBAZARbDLALASFHLAOCEFHOXDKDNDNASCSsMBAMASFASC987FCEFHMXEKAK8sBBGSCfEgHRDNDNASCU9MMBAKCEFHKXEKAK8sBEGSCfBgCRTARCfBgvHRDNASCU9MMBAKCDFHKXEKAK8sBDGSCfBgCpTARvHRDNASCU9MMBAKCIFHKXEKAK8sBIGSCfBgCxTARvHRDNASCU9MMBAKCLFHKXEKAKrBLC3TARvHRAKCVFHKKARCE4CBARCEg9r7AMFHMKDNDNADCD9HMBABAh87EBABCLFAM87EBABCDFAZ87EBXEKAIAhbDBAICWFAMbDBAICLFAZbDBKAVC/ABFAOCITFGRAMbDBARAZbDLAVALCDTFAMbDBAVC/ABFAOCEFCSgGOCITFGRAhbDBARAMbDLALCEFHLAOCEFHOXEKDNARCPE0MBAVALAQARCSgFrBBGSCL4GZ9rCSgCDTFYDBAdCEFGhAZeHRAVALAS9rCSgCDTFYDBAhAZtGoFGhASCSgGZeHSAZtHZDNDNADCD9HMBABAd87EBABCLFAS87EBABCDFAR87EBXEKAIAdbDBAICWFASbDBAICLFARbDBKAVALCDTFAdbDBAVC/ABFAOCITFGaARbDBAaAdbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALAoFCSgGLCDTFASbDBAVC/ABFAOCDFCSgGOCITFGRAdbDBARASbDLAOCEFHOALAZFHLAhAZFHdXEKAdCBAKrBBGaeGZARC/+EsGcFHRAaCSgHhDNDNAaCL4GoMBARCEFHSXEKARHSAVALAo9rCSgCDTFYDBHRKDNDNAhMBASCEFHdXEKASHdAVALAa9rCSgCDTFYDBHSKDNDNActMBAKCEFHaXEKAK8sBEGaCfEgHZDNDNAaCU9MMBAKCDFHaXEKAK8sBDGaCfBgCRTAZCfBgvHZDNAaCU9MMBAKCIFHaXEKAK8sBIGaCfBgCpTAZvHZDNAaCU9MMBAKCLFHaXEKAK8sBLGaCfBgCxTAZvHZDNAaCU9MMBAKCVFHaXEKAKCOFHaAKrBVC3TAZvHZKAZCE4CBAZCEg9r7AMFGMHZKDNDNAoCSsMBAaHcXEKAa8sBBGKCfEgHRDNDNAKCU9MMBAaCEFHcXEKAa8sBEGKCfBgCRTARCfBgvHRDNAKCU9MMBAaCDFHcXEKAa8sBDGKCfBgCpTARvHRDNAKCU9MMBAaCIFHcXEKAa8sBIGKCfBgCxTARvHRDNAKCU9MMBAaCLFHcXEKAaCVFHcAarBLC3TARvHRKARCE4CBARCEg9r7AMFGMHRKDNDNAhCSsMBAcHKXEKAc8sBBGKCfEgHSDNDNAKCU9MMBAcCEFHKXEKAc8sBEGKCfBgCRTASCfBgvHSDNAKCU9MMBAcCDFHKXEKAc8sBDGKCfBgCpTASvHSDNAKCU9MMBAcCIFHKXEKAc8sBIGKCfBgCxTASvHSDNAKCU9MMBAcCLFHKXEKAcCVFHKAcrBLC3TASvHSKASCE4CBASCEg9r7AMFGMHSKDNDNADCD9HMBABAZ87EBABCLFAS87EBABCDFAR87EBXEKAIAZbDBAICWFASbDBAICLFARbDBKAVC/ABFAOCITFGaARbDBAaAZbDLAVALCDTFAZbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCDFCSgCITFGRAZbDBARASbDLAVALAotAoCSsvFGLCSgCDTFASbDBALAhtAhCSsvFHLAOCIFHOKAWCEFHWABCOFHBAICXFHIAOCSgHOALCSgHLApCIFGpAE6MBKKCBC99AKAQseHOKAVC/AEF8kJJJJBAOK/tLEDU8jJJJJBCZ9rHVC9+HODNAECVFAL0MBCUHOAIrBBC/+EgC/QE9HMBAV9CB83IWAICEFHOAIALFC98FHIDNAEtMBDNADCDsMBINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKAVCWFALCEgCDTvGDALCD4CBALCE4CEg9r7ADYDBFGLbDBABALbDBABCLFHBAECUFGEMBXDKKINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKABALCD4CBALCE4CEg9r7AVCWFALCEgCDTvGLYDBFGD87EBALADbDBABCDFHBAECUFGEMBKKCBC99AOAIseHOKAOK/xVDIUO978jJJJJBCA9rGI8kJJJJBDNDNADCL9HMBDNAEC98gGLtMBABHDCBHVINADADPBBBGOCkP+rECkP+sEP/6EGRAOCWP+rECkP+sEP/6EARP/gEAOCZP+rECkP+sEP/6EGWP/gEP/kEP/lEGdCBPhP+2EGQARCJJJJ94PhGKP9OP9RP/kEGRjBB/+9CPaARARP/mEAdAdP/mEAWAQAWAKP9OP9RP/kEGRARP/mEP/kEP/kEP/jEP/nEGWP/mEjBBN0PaGQP/kECfEPhP9OAOCJJJ94PhP9OP9QARAWP/mEAQP/kECWP+rECJ/+IPhP9OP9QAdAWP/mEAQP/kECZP+rECJJ/8RPhP9OP9QPKBBADCZFHDAVCLFGVAL6MBKKALAE9PMEAIAECIgGVCDTGDvCBCZAD9r/8KBAIABALCDTFGLAD/8QBBDNAVtMBAIAIPBLBGOCkP+rECkP+sEP/6EGRAOCWP+rECkP+sEP/6EARP/gEAOCZP+rECkP+sEP/6EGWP/gEP/kEP/lEGdCBPhP+2EGQARCJJJJ94PhGKP9OP9RP/kEGRjBB/+9CPaARARP/mEAdAdP/mEAWAQAWAKP9OP9RP/kEGRARP/mEP/kEP/kEP/jEP/nEGWP/mEjBBN0PaGQP/kECfEPhP9OAOCJJJ94PhP9OP9QARAWP/mEAQP/kECWP+rECJ/+IPhP9OP9QAdAWP/mEAQP/kECZP+rECJJ/8RPhP9OP9QPKLBKALAIAD/8QBBXEKABAEC98gGDZ+HJJJBADAE9PMBAIAECIgGLCITGVFCBCAAV9r/8KBAIABADCITFGDAV/8QBBAIALZ+HJJJBADAIAV/8QBBKAICAF8kJJJJBK+yIDDUR97DNAEtMBCBHDINABCZFGIAIPBBBGLCBPhGVCJJ98P3ECJJ98P3IGOP9OABPBBBGRALPMLVORXMpScxql358e8fCffEPhP9OP/6EARALPMBEDIWdQKZhoaky8aeGLCZP+sEP/6EGWP/gEALCZP+rECZP+sEP/6EGdP/gEP/kEP/lEGLjB/+fsPaAdALAVP+2EGVAdCJJJJ94PhGQP9OP9RP/kEGdAdP/mEALALP/mEAWAVAWAQP9OP9RP/kEGLALP/mEP/kEP/kEP/jEP/nEGWP/mEjBBN0PaGVP/kECZP+rEAdAWP/mEAVP/kECffIPhP9OP9QGdALAWP/mEAVP/kECUPSCBPlDCBPlICBPlOCBPlRCBPlQCBPlKCBPlpCBPlSP9OGLPMWdkyQK8aeXM35pS8e8fP9QPKBBABARAOP9OAdALPMBEZhDIoaLVcxORqlP9QPKBBABCAFHBADCLFGDAE6MBKKK94EIU8jJJJJBCA9rGI8kJJJJBABAEC98gGLZ+JJJJBDNALAE9PMBAIAECIgGVCITGEFCBCAAE9r/8KBAIABALCITFGBAE/8QBBAIAVZ+JJJJBABAIAE/8QBBKAICAF8kJJJJBK/hILDUE97EUV978jJJJJBCZ9rHDDNAEtMBCBHIINADABPBBBGLABCZFGVPBBBGOPMLVORXMpScxql358e8fGRCZP+sEGWCLP+rEPKLBABjBBJzPaj/zL81zPaAWCIPhP9QP/6EP/nEGWALAOPMBEDIWdQKZhoaky8aeGLCZP+rECZP+sEP/6EP/mEGOAOP/mEAWALCZP+sEP/6EP/mEGdAdP/mEAWARCZP+rECZP+sEP/6EP/mEGRARP/mEP/kEP/kEP/lECBPhP+4EP/jEjB/+fsPaGWP/mEjBBN0PaGLP/kECffIPhGQP9OAdAWP/mEALP/kECZP+rEP9QGdARAWP/mEALP/kECZP+rEAOAWP/mEALP/kEAQP9OP9QGWPMBEZhDIoaLVcxORqlGLP5BADPBLBPeB+t+J83IBABCWFALP5EADPBLBPeE+t+J83IBAVAdAWPMWdkyQK8aeXM35pS8e8fGWP5BADPBLBPeD+t+J83IBABCkFAWP5EADPBLBPeI+t+J83IBABCAFHBAICLFGIAE6MBKKK/3EDIUE978jJJJJBC/AB9rHIDNADCD4AE2GLC98gGVtMBCBHDABHEINAEAEPBBBGOCWP+rECWP+sEP/6EAOCkP+sEClP+rECJJJ/8IPhP+uEP/mEPKBBAECZFHEADCLFGDAV6MBKKDNAVAL9PMBAIALCIgGDCDTGEvCBC/ABAE9r/8KBAIABAVCDTFGVAE/8QBBDNADtMBAIAIPBLBGOCWP+rECWP+sEP/6EAOCkP+sEClP+rECJJJ/8IPhP+uEP/mEPKLBKAVAIAE/8QBBKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIKKKEBCJWKLZ9tBB",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var r=e;WebAssembly.validate(n)&&(r=t);var o,s=WebAssembly.instantiate(a(r),{}).then(function(d){o=d.instance,o.exports.__wasm_call_ctors()});function a(d){for(var p=new Uint8Array(d.length),g=0;g<d.length;++g){var m=d.charCodeAt(g);p[g]=m>96?m-71:m>64?m-65:m>47?m+4:m>46?63:62}for(var x=0,g=0;g<d.length;++g)p[x++]=p[g]<60?i[p[g]]:(p[g]-60)*64+p[++g];return p.buffer.slice(0,x)}function c(d,p,g,m,x,C){var A=o.exports.sbrk,b=g+3&-4,T=A(b*m),S=A(x.length),w=new Uint8Array(o.exports.memory.buffer);w.set(x,S);var D=d(T,g,m,S,x.length);if(D==0&&C&&C(T,b,m),p.set(w.subarray(T,T+g*m)),A(T-A(0)),D!=0)throw new Error("Malformed buffer data: "+D)}var u={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},f={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return{ready:s,supported:!0,decodeVertexBuffer:function(d,p,g,m,x){c(o.exports.meshopt_decodeVertexBuffer,d,p,g,m,o.exports[u[x]])},decodeIndexBuffer:function(d,p,g,m){c(o.exports.meshopt_decodeIndexBuffer,d,p,g,m)},decodeIndexSequence:function(d,p,g,m){c(o.exports.meshopt_decodeIndexSequence,d,p,g,m)},decodeGltfBuffer:function(d,p,g,m,x,C){c(o.exports[f[x]],d,p,g,m,o.exports[u[C]])}}}();typeof iv=="object"&&typeof l9=="object"?l9.exports=SN:typeof define=="function"&&define.amd?define([],function(){return SN}):typeof iv=="object"?iv.MeshoptDecoder=SN:(typeof self<"u"?self:iv).MeshoptDecoder=SN});var Hse=un((ePn,zse)=>{var AHe=kse(),THe=Use();zse.exports={MeshoptEncoder:AHe,MeshoptDecoder:THe}});var hce=un((i3n,dce)=>{dce.exports=o9e;function o9e(e,t,n){return t<n?e<t?t:e>n?n:e:e<n?n:e>t?t:e}});var gce=un((r3n,_ce)=>{"use strict";var s9e=hce();_ce.exports=a9e;var pv=1e20;function a9e(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,r=t.channel||0,o,s,a,c,u,f,d,p,g,m,x;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");o=t.width,s=t.height,c=e,t.stride?f=t.stride:f=Math.floor(e.length/o/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,d=p.getContext("2d"),o=p.width,s=p.height,g=d.getImageData(0,0,o,s),c=g.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,d=e,o=p.width,s=p.height,g=d.getImageData(0,0,o,s),c=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,o=e.width,s=e.height,c=g.data,f=4);if(a=Math.max(o,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(o*s),m=0,x=u.length;m<x;m++)c[m]=u[m*f+r]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var C=Array(o*s),A=Array(o*s),b=Array(a),T=Array(a),S=Array(a+1),w=Array(a);for(m=0,x=o*s;m<x;m++){var D=c[m];C[m]=D===1?0:D===0?pv:Math.pow(Math.max(0,.5-D),2),A[m]=D===1?pv:D===0?0:Math.pow(Math.max(0,D-.5),2)}mce(C,o,s,b,T,w,S),mce(A,o,s,b,T,w,S);var I=window.Float32Array?new Float32Array(o*s):new Array(o*s);for(m=0,x=o*s;m<x;m++)I[m]=s9e(1-((C[m]-A[m])/i+n),0,1);return I}function mce(e,t,n,i,r,o,s){for(var a=0;a<t;a++){for(var c=0;c<n;c++)i[c]=e[c*t+a];for(pce(i,r,o,s,n),c=0;c<n;c++)e[c*t+a]=r[c]}for(c=0;c<n;c++){for(a=0;a<t;a++)i[a]=e[c*t+a];for(pce(i,r,o,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(r[a])}}function pce(e,t,n,i,r){n[0]=0,i[0]=-pv,i[1]=+pv;for(var o=1,s=0;o<r;o++){for(var a=(e[o]+o*o-(e[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);a<=i[s];)s--,a=(e[o]+o*o-(e[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);s++,n[s]=o,i[s]=a,i[s+1]=+pv}for(o=0,s=0;o<r;o++){for(;i[s+1]<o;)s++;t[o]=(o-n[s])*(o-n[s])+e[n[s]]}}});var Tce=un((E3n,ZN)=>{function y9e(){var e=0,t=1,n=2,i=3,r=4,o=5,s=6,a=7,c=8,u=9,f=10,d=11,p=12,g=13,m=14,x=15,C=16,A=17,b=0,T=1,S=2,w=3,D=4;function I(_,E){return 55296<=_.charCodeAt(E)&&_.charCodeAt(E)<=56319&&56320<=_.charCodeAt(E+1)&&_.charCodeAt(E+1)<=57343}function O(_,E){E===void 0&&(E=0);var v=_.charCodeAt(E);if(55296<=v&&v<=56319&&E<_.length-1){var P=v,R=_.charCodeAt(E+1);return 56320<=R&&R<=57343?(P-55296)*1024+(R-56320)+65536:P}if(56320<=v&&v<=57343&&E>=1){var P=_.charCodeAt(E-1),R=v;return 55296<=P&&P<=56319?(P-55296)*1024+(R-56320)+65536:R}return v}function B(_,E,v){var P=[_].concat(E).concat([v]),R=P[P.length-2],F=v,U=P.lastIndexOf(m);if(U>1&&P.slice(1,U).every(function(V){return V==i})&&[i,g,A].indexOf(_)==-1)return S;var k=P.lastIndexOf(r);if(k>0&&P.slice(1,k).every(function(V){return V==r})&&[p,r].indexOf(R)==-1)return P.filter(function(V){return V==r}).length%2==1?w:D;if(R==e&&F==t)return b;if(R==n||R==e||R==t)return F==m&&E.every(function(V){return V==i})?S:T;if(F==n||F==e||F==t)return T;if(R==s&&(F==s||F==a||F==u||F==f))return b;if((R==u||R==a)&&(F==a||F==c))return b;if((R==f||R==c)&&F==c)return b;if(F==i||F==x)return b;if(F==o)return b;if(R==p)return b;var H=P.indexOf(i)!=-1?P.lastIndexOf(i)-1:P.length-2;return[g,A].indexOf(P[H])!=-1&&P.slice(H+1,-1).every(function(V){return V==i})&&F==m||R==x&&[C,A].indexOf(F)!=-1?b:E.indexOf(r)!=-1?S:R==r&&F==r?b:T}this.nextBreak=function(_,E){if(E===void 0&&(E=0),E<0)return 0;if(E>=_.length-1)return _.length;for(var v=L(O(_,E)),P=[],R=E+1;R<_.length;R++)if(!I(_,R-1)){var F=L(O(_,R));if(B(v,P,F))return R;P.push(F)}return _.length},this.splitGraphemes=function(_){for(var E=[],v=0,P;(P=this.nextBreak(_,v))<_.length;)E.push(_.slice(v,P)),v=P;return v<_.length&&E.push(_.slice(v)),E},this.iterateGraphemes=function(_){var E=0,v={next:function(){var P,R;return(R=this.nextBreak(_,E))<_.length?(P=_.slice(E,R),E=R,{value:P,done:!1}):E<_.length?(P=_.slice(E),E=_.length,{value:P,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(v[Symbol.iterator]=function(){return v}),v},this.countGraphemes=function(_){for(var E=0,v=0,P;(P=this.nextBreak(_,v))<_.length;)v=P,E++;return v<_.length&&E++,E};function L(_){return 1536<=_&&_<=1541||_==1757||_==1807||_==2274||_==3406||_==69821||70082<=_&&_<=70083||_==72250||72326<=_&&_<=72329||_==73030?p:_==13?e:_==10?t:0<=_&&_<=9||11<=_&&_<=12||14<=_&&_<=31||127<=_&&_<=159||_==173||_==1564||_==6158||_==8203||8206<=_&&_<=8207||_==8232||_==8233||8234<=_&&_<=8238||8288<=_&&_<=8292||_==8293||8294<=_&&_<=8303||55296<=_&&_<=57343||_==65279||65520<=_&&_<=65528||65529<=_&&_<=65531||113824<=_&&_<=113827||119155<=_&&_<=119162||_==917504||_==917505||917506<=_&&_<=917535||917632<=_&&_<=917759||918e3<=_&&_<=921599?n:768<=_&&_<=879||1155<=_&&_<=1159||1160<=_&&_<=1161||1425<=_&&_<=1469||_==1471||1473<=_&&_<=1474||1476<=_&&_<=1477||_==1479||1552<=_&&_<=1562||1611<=_&&_<=1631||_==1648||1750<=_&&_<=1756||1759<=_&&_<=1764||1767<=_&&_<=1768||1770<=_&&_<=1773||_==1809||1840<=_&&_<=1866||1958<=_&&_<=1968||2027<=_&&_<=2035||2070<=_&&_<=2073||2075<=_&&_<=2083||2085<=_&&_<=2087||2089<=_&&_<=2093||2137<=_&&_<=2139||2260<=_&&_<=2273||2275<=_&&_<=2306||_==2362||_==2364||2369<=_&&_<=2376||_==2381||2385<=_&&_<=2391||2402<=_&&_<=2403||_==2433||_==2492||_==2494||2497<=_&&_<=2500||_==2509||_==2519||2530<=_&&_<=2531||2561<=_&&_<=2562||_==2620||2625<=_&&_<=2626||2631<=_&&_<=2632||2635<=_&&_<=2637||_==2641||2672<=_&&_<=2673||_==2677||2689<=_&&_<=2690||_==2748||2753<=_&&_<=2757||2759<=_&&_<=2760||_==2765||2786<=_&&_<=2787||2810<=_&&_<=2815||_==2817||_==2876||_==2878||_==2879||2881<=_&&_<=2884||_==2893||_==2902||_==2903||2914<=_&&_<=2915||_==2946||_==3006||_==3008||_==3021||_==3031||_==3072||3134<=_&&_<=3136||3142<=_&&_<=3144||3146<=_&&_<=3149||3157<=_&&_<=3158||3170<=_&&_<=3171||_==3201||_==3260||_==3263||_==3266||_==3270||3276<=_&&_<=3277||3285<=_&&_<=3286||3298<=_&&_<=3299||3328<=_&&_<=3329||3387<=_&&_<=3388||_==3390||3393<=_&&_<=3396||_==3405||_==3415||3426<=_&&_<=3427||_==3530||_==3535||3538<=_&&_<=3540||_==3542||_==3551||_==3633||3636<=_&&_<=3642||3655<=_&&_<=3662||_==3761||3764<=_&&_<=3769||3771<=_&&_<=3772||3784<=_&&_<=3789||3864<=_&&_<=3865||_==3893||_==3895||_==3897||3953<=_&&_<=3966||3968<=_&&_<=3972||3974<=_&&_<=3975||3981<=_&&_<=3991||3993<=_&&_<=4028||_==4038||4141<=_&&_<=4144||4146<=_&&_<=4151||4153<=_&&_<=4154||4157<=_&&_<=4158||4184<=_&&_<=4185||4190<=_&&_<=4192||4209<=_&&_<=4212||_==4226||4229<=_&&_<=4230||_==4237||_==4253||4957<=_&&_<=4959||5906<=_&&_<=5908||5938<=_&&_<=5940||5970<=_&&_<=5971||6002<=_&&_<=6003||6068<=_&&_<=6069||6071<=_&&_<=6077||_==6086||6089<=_&&_<=6099||_==6109||6155<=_&&_<=6157||6277<=_&&_<=6278||_==6313||6432<=_&&_<=6434||6439<=_&&_<=6440||_==6450||6457<=_&&_<=6459||6679<=_&&_<=6680||_==6683||_==6742||6744<=_&&_<=6750||_==6752||_==6754||6757<=_&&_<=6764||6771<=_&&_<=6780||_==6783||6832<=_&&_<=6845||_==6846||6912<=_&&_<=6915||_==6964||6966<=_&&_<=6970||_==6972||_==6978||7019<=_&&_<=7027||7040<=_&&_<=7041||7074<=_&&_<=7077||7080<=_&&_<=7081||7083<=_&&_<=7085||_==7142||7144<=_&&_<=7145||_==7149||7151<=_&&_<=7153||7212<=_&&_<=7219||7222<=_&&_<=7223||7376<=_&&_<=7378||7380<=_&&_<=7392||7394<=_&&_<=7400||_==7405||_==7412||7416<=_&&_<=7417||7616<=_&&_<=7673||7675<=_&&_<=7679||_==8204||8400<=_&&_<=8412||8413<=_&&_<=8416||_==8417||8418<=_&&_<=8420||8421<=_&&_<=8432||11503<=_&&_<=11505||_==11647||11744<=_&&_<=11775||12330<=_&&_<=12333||12334<=_&&_<=12335||12441<=_&&_<=12442||_==42607||42608<=_&&_<=42610||42612<=_&&_<=42621||42654<=_&&_<=42655||42736<=_&&_<=42737||_==43010||_==43014||_==43019||43045<=_&&_<=43046||43204<=_&&_<=43205||43232<=_&&_<=43249||43302<=_&&_<=43309||43335<=_&&_<=43345||43392<=_&&_<=43394||_==43443||43446<=_&&_<=43449||_==43452||_==43493||43561<=_&&_<=43566||43569<=_&&_<=43570||43573<=_&&_<=43574||_==43587||_==43596||_==43644||_==43696||43698<=_&&_<=43700||43703<=_&&_<=43704||43710<=_&&_<=43711||_==43713||43756<=_&&_<=43757||_==43766||_==44005||_==44008||_==44013||_==64286||65024<=_&&_<=65039||65056<=_&&_<=65071||65438<=_&&_<=65439||_==66045||_==66272||66422<=_&&_<=66426||68097<=_&&_<=68099||68101<=_&&_<=68102||68108<=_&&_<=68111||68152<=_&&_<=68154||_==68159||68325<=_&&_<=68326||_==69633||69688<=_&&_<=69702||69759<=_&&_<=69761||69811<=_&&_<=69814||69817<=_&&_<=69818||69888<=_&&_<=69890||69927<=_&&_<=69931||69933<=_&&_<=69940||_==70003||70016<=_&&_<=70017||70070<=_&&_<=70078||70090<=_&&_<=70092||70191<=_&&_<=70193||_==70196||70198<=_&&_<=70199||_==70206||_==70367||70371<=_&&_<=70378||70400<=_&&_<=70401||_==70460||_==70462||_==70464||_==70487||70502<=_&&_<=70508||70512<=_&&_<=70516||70712<=_&&_<=70719||70722<=_&&_<=70724||_==70726||_==70832||70835<=_&&_<=70840||_==70842||_==70845||70847<=_&&_<=70848||70850<=_&&_<=70851||_==71087||71090<=_&&_<=71093||71100<=_&&_<=71101||71103<=_&&_<=71104||71132<=_&&_<=71133||71219<=_&&_<=71226||_==71229||71231<=_&&_<=71232||_==71339||_==71341||71344<=_&&_<=71349||_==71351||71453<=_&&_<=71455||71458<=_&&_<=71461||71463<=_&&_<=71467||72193<=_&&_<=72198||72201<=_&&_<=72202||72243<=_&&_<=72248||72251<=_&&_<=72254||_==72263||72273<=_&&_<=72278||72281<=_&&_<=72283||72330<=_&&_<=72342||72344<=_&&_<=72345||72752<=_&&_<=72758||72760<=_&&_<=72765||_==72767||72850<=_&&_<=72871||72874<=_&&_<=72880||72882<=_&&_<=72883||72885<=_&&_<=72886||73009<=_&&_<=73014||_==73018||73020<=_&&_<=73021||73023<=_&&_<=73029||_==73031||92912<=_&&_<=92916||92976<=_&&_<=92982||94095<=_&&_<=94098||113821<=_&&_<=113822||_==119141||119143<=_&&_<=119145||119150<=_&&_<=119154||119163<=_&&_<=119170||119173<=_&&_<=119179||119210<=_&&_<=119213||119362<=_&&_<=119364||121344<=_&&_<=121398||121403<=_&&_<=121452||_==121461||_==121476||121499<=_&&_<=121503||121505<=_&&_<=121519||122880<=_&&_<=122886||122888<=_&&_<=122904||122907<=_&&_<=122913||122915<=_&&_<=122916||122918<=_&&_<=122922||125136<=_&&_<=125142||125252<=_&&_<=125258||917536<=_&&_<=917631||917760<=_&&_<=917999?i:127462<=_&&_<=127487?r:_==2307||_==2363||2366<=_&&_<=2368||2377<=_&&_<=2380||2382<=_&&_<=2383||2434<=_&&_<=2435||2495<=_&&_<=2496||2503<=_&&_<=2504||2507<=_&&_<=2508||_==2563||2622<=_&&_<=2624||_==2691||2750<=_&&_<=2752||_==2761||2763<=_&&_<=2764||2818<=_&&_<=2819||_==2880||2887<=_&&_<=2888||2891<=_&&_<=2892||_==3007||3009<=_&&_<=3010||3014<=_&&_<=3016||3018<=_&&_<=3020||3073<=_&&_<=3075||3137<=_&&_<=3140||3202<=_&&_<=3203||_==3262||3264<=_&&_<=3265||3267<=_&&_<=3268||3271<=_&&_<=3272||3274<=_&&_<=3275||3330<=_&&_<=3331||3391<=_&&_<=3392||3398<=_&&_<=3400||3402<=_&&_<=3404||3458<=_&&_<=3459||3536<=_&&_<=3537||3544<=_&&_<=3550||3570<=_&&_<=3571||_==3635||_==3763||3902<=_&&_<=3903||_==3967||_==4145||4155<=_&&_<=4156||4182<=_&&_<=4183||_==4228||_==6070||6078<=_&&_<=6085||6087<=_&&_<=6088||6435<=_&&_<=6438||6441<=_&&_<=6443||6448<=_&&_<=6449||6451<=_&&_<=6456||6681<=_&&_<=6682||_==6741||_==6743||6765<=_&&_<=6770||_==6916||_==6965||_==6971||6973<=_&&_<=6977||6979<=_&&_<=6980||_==7042||_==7073||7078<=_&&_<=7079||_==7082||_==7143||7146<=_&&_<=7148||_==7150||7154<=_&&_<=7155||7204<=_&&_<=7211||7220<=_&&_<=7221||_==7393||7410<=_&&_<=7411||_==7415||43043<=_&&_<=43044||_==43047||43136<=_&&_<=43137||43188<=_&&_<=43203||43346<=_&&_<=43347||_==43395||43444<=_&&_<=43445||43450<=_&&_<=43451||43453<=_&&_<=43456||43567<=_&&_<=43568||43571<=_&&_<=43572||_==43597||_==43755||43758<=_&&_<=43759||_==43765||44003<=_&&_<=44004||44006<=_&&_<=44007||44009<=_&&_<=44010||_==44012||_==69632||_==69634||_==69762||69808<=_&&_<=69810||69815<=_&&_<=69816||_==69932||_==70018||70067<=_&&_<=70069||70079<=_&&_<=70080||70188<=_&&_<=70190||70194<=_&&_<=70195||_==70197||70368<=_&&_<=70370||70402<=_&&_<=70403||_==70463||70465<=_&&_<=70468||70471<=_&&_<=70472||70475<=_&&_<=70477||70498<=_&&_<=70499||70709<=_&&_<=70711||70720<=_&&_<=70721||_==70725||70833<=_&&_<=70834||_==70841||70843<=_&&_<=70844||_==70846||_==70849||71088<=_&&_<=71089||71096<=_&&_<=71099||_==71102||71216<=_&&_<=71218||71227<=_&&_<=71228||_==71230||_==71340||71342<=_&&_<=71343||_==71350||71456<=_&&_<=71457||_==71462||72199<=_&&_<=72200||_==72249||72279<=_&&_<=72280||_==72343||_==72751||_==72766||_==72873||_==72881||_==72884||94033<=_&&_<=94078||_==119142||_==119149?o:4352<=_&&_<=4447||43360<=_&&_<=43388?s:4448<=_&&_<=4519||55216<=_&&_<=55238?a:4520<=_&&_<=4607||55243<=_&&_<=55291?c:_==44032||_==44060||_==44088||_==44116||_==44144||_==44172||_==44200||_==44228||_==44256||_==44284||_==44312||_==44340||_==44368||_==44396||_==44424||_==44452||_==44480||_==44508||_==44536||_==44564||_==44592||_==44620||_==44648||_==44676||_==44704||_==44732||_==44760||_==44788||_==44816||_==44844||_==44872||_==44900||_==44928||_==44956||_==44984||_==45012||_==45040||_==45068||_==45096||_==45124||_==45152||_==45180||_==45208||_==45236||_==45264||_==45292||_==45320||_==45348||_==45376||_==45404||_==45432||_==45460||_==45488||_==45516||_==45544||_==45572||_==45600||_==45628||_==45656||_==45684||_==45712||_==45740||_==45768||_==45796||_==45824||_==45852||_==45880||_==45908||_==45936||_==45964||_==45992||_==46020||_==46048||_==46076||_==46104||_==46132||_==46160||_==46188||_==46216||_==46244||_==46272||_==46300||_==46328||_==46356||_==46384||_==46412||_==46440||_==46468||_==46496||_==46524||_==46552||_==46580||_==46608||_==46636||_==46664||_==46692||_==46720||_==46748||_==46776||_==46804||_==46832||_==46860||_==46888||_==46916||_==46944||_==46972||_==47e3||_==47028||_==47056||_==47084||_==47112||_==47140||_==47168||_==47196||_==47224||_==47252||_==47280||_==47308||_==47336||_==47364||_==47392||_==47420||_==47448||_==47476||_==47504||_==47532||_==47560||_==47588||_==47616||_==47644||_==47672||_==47700||_==47728||_==47756||_==47784||_==47812||_==47840||_==47868||_==47896||_==47924||_==47952||_==47980||_==48008||_==48036||_==48064||_==48092||_==48120||_==48148||_==48176||_==48204||_==48232||_==48260||_==48288||_==48316||_==48344||_==48372||_==48400||_==48428||_==48456||_==48484||_==48512||_==48540||_==48568||_==48596||_==48624||_==48652||_==48680||_==48708||_==48736||_==48764||_==48792||_==48820||_==48848||_==48876||_==48904||_==48932||_==48960||_==48988||_==49016||_==49044||_==49072||_==49100||_==49128||_==49156||_==49184||_==49212||_==49240||_==49268||_==49296||_==49324||_==49352||_==49380||_==49408||_==49436||_==49464||_==49492||_==49520||_==49548||_==49576||_==49604||_==49632||_==49660||_==49688||_==49716||_==49744||_==49772||_==49800||_==49828||_==49856||_==49884||_==49912||_==49940||_==49968||_==49996||_==50024||_==50052||_==50080||_==50108||_==50136||_==50164||_==50192||_==50220||_==50248||_==50276||_==50304||_==50332||_==50360||_==50388||_==50416||_==50444||_==50472||_==50500||_==50528||_==50556||_==50584||_==50612||_==50640||_==50668||_==50696||_==50724||_==50752||_==50780||_==50808||_==50836||_==50864||_==50892||_==50920||_==50948||_==50976||_==51004||_==51032||_==51060||_==51088||_==51116||_==51144||_==51172||_==51200||_==51228||_==51256||_==51284||_==51312||_==51340||_==51368||_==51396||_==51424||_==51452||_==51480||_==51508||_==51536||_==51564||_==51592||_==51620||_==51648||_==51676||_==51704||_==51732||_==51760||_==51788||_==51816||_==51844||_==51872||_==51900||_==51928||_==51956||_==51984||_==52012||_==52040||_==52068||_==52096||_==52124||_==52152||_==52180||_==52208||_==52236||_==52264||_==52292||_==52320||_==52348||_==52376||_==52404||_==52432||_==52460||_==52488||_==52516||_==52544||_==52572||_==52600||_==52628||_==52656||_==52684||_==52712||_==52740||_==52768||_==52796||_==52824||_==52852||_==52880||_==52908||_==52936||_==52964||_==52992||_==53020||_==53048||_==53076||_==53104||_==53132||_==53160||_==53188||_==53216||_==53244||_==53272||_==53300||_==53328||_==53356||_==53384||_==53412||_==53440||_==53468||_==53496||_==53524||_==53552||_==53580||_==53608||_==53636||_==53664||_==53692||_==53720||_==53748||_==53776||_==53804||_==53832||_==53860||_==53888||_==53916||_==53944||_==53972||_==54e3||_==54028||_==54056||_==54084||_==54112||_==54140||_==54168||_==54196||_==54224||_==54252||_==54280||_==54308||_==54336||_==54364||_==54392||_==54420||_==54448||_==54476||_==54504||_==54532||_==54560||_==54588||_==54616||_==54644||_==54672||_==54700||_==54728||_==54756||_==54784||_==54812||_==54840||_==54868||_==54896||_==54924||_==54952||_==54980||_==55008||_==55036||_==55064||_==55092||_==55120||_==55148||_==55176?u:44033<=_&&_<=44059||44061<=_&&_<=44087||44089<=_&&_<=44115||44117<=_&&_<=44143||44145<=_&&_<=44171||44173<=_&&_<=44199||44201<=_&&_<=44227||44229<=_&&_<=44255||44257<=_&&_<=44283||44285<=_&&_<=44311||44313<=_&&_<=44339||44341<=_&&_<=44367||44369<=_&&_<=44395||44397<=_&&_<=44423||44425<=_&&_<=44451||44453<=_&&_<=44479||44481<=_&&_<=44507||44509<=_&&_<=44535||44537<=_&&_<=44563||44565<=_&&_<=44591||44593<=_&&_<=44619||44621<=_&&_<=44647||44649<=_&&_<=44675||44677<=_&&_<=44703||44705<=_&&_<=44731||44733<=_&&_<=44759||44761<=_&&_<=44787||44789<=_&&_<=44815||44817<=_&&_<=44843||44845<=_&&_<=44871||44873<=_&&_<=44899||44901<=_&&_<=44927||44929<=_&&_<=44955||44957<=_&&_<=44983||44985<=_&&_<=45011||45013<=_&&_<=45039||45041<=_&&_<=45067||45069<=_&&_<=45095||45097<=_&&_<=45123||45125<=_&&_<=45151||45153<=_&&_<=45179||45181<=_&&_<=45207||45209<=_&&_<=45235||45237<=_&&_<=45263||45265<=_&&_<=45291||45293<=_&&_<=45319||45321<=_&&_<=45347||45349<=_&&_<=45375||45377<=_&&_<=45403||45405<=_&&_<=45431||45433<=_&&_<=45459||45461<=_&&_<=45487||45489<=_&&_<=45515||45517<=_&&_<=45543||45545<=_&&_<=45571||45573<=_&&_<=45599||45601<=_&&_<=45627||45629<=_&&_<=45655||45657<=_&&_<=45683||45685<=_&&_<=45711||45713<=_&&_<=45739||45741<=_&&_<=45767||45769<=_&&_<=45795||45797<=_&&_<=45823||45825<=_&&_<=45851||45853<=_&&_<=45879||45881<=_&&_<=45907||45909<=_&&_<=45935||45937<=_&&_<=45963||45965<=_&&_<=45991||45993<=_&&_<=46019||46021<=_&&_<=46047||46049<=_&&_<=46075||46077<=_&&_<=46103||46105<=_&&_<=46131||46133<=_&&_<=46159||46161<=_&&_<=46187||46189<=_&&_<=46215||46217<=_&&_<=46243||46245<=_&&_<=46271||46273<=_&&_<=46299||46301<=_&&_<=46327||46329<=_&&_<=46355||46357<=_&&_<=46383||46385<=_&&_<=46411||46413<=_&&_<=46439||46441<=_&&_<=46467||46469<=_&&_<=46495||46497<=_&&_<=46523||46525<=_&&_<=46551||46553<=_&&_<=46579||46581<=_&&_<=46607||46609<=_&&_<=46635||46637<=_&&_<=46663||46665<=_&&_<=46691||46693<=_&&_<=46719||46721<=_&&_<=46747||46749<=_&&_<=46775||46777<=_&&_<=46803||46805<=_&&_<=46831||46833<=_&&_<=46859||46861<=_&&_<=46887||46889<=_&&_<=46915||46917<=_&&_<=46943||46945<=_&&_<=46971||46973<=_&&_<=46999||47001<=_&&_<=47027||47029<=_&&_<=47055||47057<=_&&_<=47083||47085<=_&&_<=47111||47113<=_&&_<=47139||47141<=_&&_<=47167||47169<=_&&_<=47195||47197<=_&&_<=47223||47225<=_&&_<=47251||47253<=_&&_<=47279||47281<=_&&_<=47307||47309<=_&&_<=47335||47337<=_&&_<=47363||47365<=_&&_<=47391||47393<=_&&_<=47419||47421<=_&&_<=47447||47449<=_&&_<=47475||47477<=_&&_<=47503||47505<=_&&_<=47531||47533<=_&&_<=47559||47561<=_&&_<=47587||47589<=_&&_<=47615||47617<=_&&_<=47643||47645<=_&&_<=47671||47673<=_&&_<=47699||47701<=_&&_<=47727||47729<=_&&_<=47755||47757<=_&&_<=47783||47785<=_&&_<=47811||47813<=_&&_<=47839||47841<=_&&_<=47867||47869<=_&&_<=47895||47897<=_&&_<=47923||47925<=_&&_<=47951||47953<=_&&_<=47979||47981<=_&&_<=48007||48009<=_&&_<=48035||48037<=_&&_<=48063||48065<=_&&_<=48091||48093<=_&&_<=48119||48121<=_&&_<=48147||48149<=_&&_<=48175||48177<=_&&_<=48203||48205<=_&&_<=48231||48233<=_&&_<=48259||48261<=_&&_<=48287||48289<=_&&_<=48315||48317<=_&&_<=48343||48345<=_&&_<=48371||48373<=_&&_<=48399||48401<=_&&_<=48427||48429<=_&&_<=48455||48457<=_&&_<=48483||48485<=_&&_<=48511||48513<=_&&_<=48539||48541<=_&&_<=48567||48569<=_&&_<=48595||48597<=_&&_<=48623||48625<=_&&_<=48651||48653<=_&&_<=48679||48681<=_&&_<=48707||48709<=_&&_<=48735||48737<=_&&_<=48763||48765<=_&&_<=48791||48793<=_&&_<=48819||48821<=_&&_<=48847||48849<=_&&_<=48875||48877<=_&&_<=48903||48905<=_&&_<=48931||48933<=_&&_<=48959||48961<=_&&_<=48987||48989<=_&&_<=49015||49017<=_&&_<=49043||49045<=_&&_<=49071||49073<=_&&_<=49099||49101<=_&&_<=49127||49129<=_&&_<=49155||49157<=_&&_<=49183||49185<=_&&_<=49211||49213<=_&&_<=49239||49241<=_&&_<=49267||49269<=_&&_<=49295||49297<=_&&_<=49323||49325<=_&&_<=49351||49353<=_&&_<=49379||49381<=_&&_<=49407||49409<=_&&_<=49435||49437<=_&&_<=49463||49465<=_&&_<=49491||49493<=_&&_<=49519||49521<=_&&_<=49547||49549<=_&&_<=49575||49577<=_&&_<=49603||49605<=_&&_<=49631||49633<=_&&_<=49659||49661<=_&&_<=49687||49689<=_&&_<=49715||49717<=_&&_<=49743||49745<=_&&_<=49771||49773<=_&&_<=49799||49801<=_&&_<=49827||49829<=_&&_<=49855||49857<=_&&_<=49883||49885<=_&&_<=49911||49913<=_&&_<=49939||49941<=_&&_<=49967||49969<=_&&_<=49995||49997<=_&&_<=50023||50025<=_&&_<=50051||50053<=_&&_<=50079||50081<=_&&_<=50107||50109<=_&&_<=50135||50137<=_&&_<=50163||50165<=_&&_<=50191||50193<=_&&_<=50219||50221<=_&&_<=50247||50249<=_&&_<=50275||50277<=_&&_<=50303||50305<=_&&_<=50331||50333<=_&&_<=50359||50361<=_&&_<=50387||50389<=_&&_<=50415||50417<=_&&_<=50443||50445<=_&&_<=50471||50473<=_&&_<=50499||50501<=_&&_<=50527||50529<=_&&_<=50555||50557<=_&&_<=50583||50585<=_&&_<=50611||50613<=_&&_<=50639||50641<=_&&_<=50667||50669<=_&&_<=50695||50697<=_&&_<=50723||50725<=_&&_<=50751||50753<=_&&_<=50779||50781<=_&&_<=50807||50809<=_&&_<=50835||50837<=_&&_<=50863||50865<=_&&_<=50891||50893<=_&&_<=50919||50921<=_&&_<=50947||50949<=_&&_<=50975||50977<=_&&_<=51003||51005<=_&&_<=51031||51033<=_&&_<=51059||51061<=_&&_<=51087||51089<=_&&_<=51115||51117<=_&&_<=51143||51145<=_&&_<=51171||51173<=_&&_<=51199||51201<=_&&_<=51227||51229<=_&&_<=51255||51257<=_&&_<=51283||51285<=_&&_<=51311||51313<=_&&_<=51339||51341<=_&&_<=51367||51369<=_&&_<=51395||51397<=_&&_<=51423||51425<=_&&_<=51451||51453<=_&&_<=51479||51481<=_&&_<=51507||51509<=_&&_<=51535||51537<=_&&_<=51563||51565<=_&&_<=51591||51593<=_&&_<=51619||51621<=_&&_<=51647||51649<=_&&_<=51675||51677<=_&&_<=51703||51705<=_&&_<=51731||51733<=_&&_<=51759||51761<=_&&_<=51787||51789<=_&&_<=51815||51817<=_&&_<=51843||51845<=_&&_<=51871||51873<=_&&_<=51899||51901<=_&&_<=51927||51929<=_&&_<=51955||51957<=_&&_<=51983||51985<=_&&_<=52011||52013<=_&&_<=52039||52041<=_&&_<=52067||52069<=_&&_<=52095||52097<=_&&_<=52123||52125<=_&&_<=52151||52153<=_&&_<=52179||52181<=_&&_<=52207||52209<=_&&_<=52235||52237<=_&&_<=52263||52265<=_&&_<=52291||52293<=_&&_<=52319||52321<=_&&_<=52347||52349<=_&&_<=52375||52377<=_&&_<=52403||52405<=_&&_<=52431||52433<=_&&_<=52459||52461<=_&&_<=52487||52489<=_&&_<=52515||52517<=_&&_<=52543||52545<=_&&_<=52571||52573<=_&&_<=52599||52601<=_&&_<=52627||52629<=_&&_<=52655||52657<=_&&_<=52683||52685<=_&&_<=52711||52713<=_&&_<=52739||52741<=_&&_<=52767||52769<=_&&_<=52795||52797<=_&&_<=52823||52825<=_&&_<=52851||52853<=_&&_<=52879||52881<=_&&_<=52907||52909<=_&&_<=52935||52937<=_&&_<=52963||52965<=_&&_<=52991||52993<=_&&_<=53019||53021<=_&&_<=53047||53049<=_&&_<=53075||53077<=_&&_<=53103||53105<=_&&_<=53131||53133<=_&&_<=53159||53161<=_&&_<=53187||53189<=_&&_<=53215||53217<=_&&_<=53243||53245<=_&&_<=53271||53273<=_&&_<=53299||53301<=_&&_<=53327||53329<=_&&_<=53355||53357<=_&&_<=53383||53385<=_&&_<=53411||53413<=_&&_<=53439||53441<=_&&_<=53467||53469<=_&&_<=53495||53497<=_&&_<=53523||53525<=_&&_<=53551||53553<=_&&_<=53579||53581<=_&&_<=53607||53609<=_&&_<=53635||53637<=_&&_<=53663||53665<=_&&_<=53691||53693<=_&&_<=53719||53721<=_&&_<=53747||53749<=_&&_<=53775||53777<=_&&_<=53803||53805<=_&&_<=53831||53833<=_&&_<=53859||53861<=_&&_<=53887||53889<=_&&_<=53915||53917<=_&&_<=53943||53945<=_&&_<=53971||53973<=_&&_<=53999||54001<=_&&_<=54027||54029<=_&&_<=54055||54057<=_&&_<=54083||54085<=_&&_<=54111||54113<=_&&_<=54139||54141<=_&&_<=54167||54169<=_&&_<=54195||54197<=_&&_<=54223||54225<=_&&_<=54251||54253<=_&&_<=54279||54281<=_&&_<=54307||54309<=_&&_<=54335||54337<=_&&_<=54363||54365<=_&&_<=54391||54393<=_&&_<=54419||54421<=_&&_<=54447||54449<=_&&_<=54475||54477<=_&&_<=54503||54505<=_&&_<=54531||54533<=_&&_<=54559||54561<=_&&_<=54587||54589<=_&&_<=54615||54617<=_&&_<=54643||54645<=_&&_<=54671||54673<=_&&_<=54699||54701<=_&&_<=54727||54729<=_&&_<=54755||54757<=_&&_<=54783||54785<=_&&_<=54811||54813<=_&&_<=54839||54841<=_&&_<=54867||54869<=_&&_<=54895||54897<=_&&_<=54923||54925<=_&&_<=54951||54953<=_&&_<=54979||54981<=_&&_<=55007||55009<=_&&_<=55035||55037<=_&&_<=55063||55065<=_&&_<=55091||55093<=_&&_<=55119||55121<=_&&_<=55147||55149<=_&&_<=55175||55177<=_&&_<=55203?f:_==9757||_==9977||9994<=_&&_<=9997||_==127877||127938<=_&&_<=127940||_==127943||127946<=_&&_<=127948||128066<=_&&_<=128067||128070<=_&&_<=128080||_==128110||128112<=_&&_<=128120||_==128124||128129<=_&&_<=128131||128133<=_&&_<=128135||_==128170||128372<=_&&_<=128373||_==128378||_==128400||128405<=_&&_<=128406||128581<=_&&_<=128583||128587<=_&&_<=128591||_==128675||128692<=_&&_<=128694||_==128704||_==128716||129304<=_&&_<=129308||129310<=_&&_<=129311||_==129318||129328<=_&&_<=129337||129341<=_&&_<=129342||129489<=_&&_<=129501?g:127995<=_&&_<=127999?m:_==8205?x:_==9792||_==9794||9877<=_&&_<=9878||_==9992||_==10084||_==127752||_==127806||_==127859||_==127891||_==127908||_==127912||_==127979||_==127981||_==128139||128187<=_&&_<=128188||_==128295||_==128300||_==128488||_==128640||_==128658?C:128102<=_&&_<=128105?A:d}return this}typeof ZN<"u"&&ZN.exports&&(ZN.exports=y9e)});var ofe=un((QW,e7)=>{(function(e,t){typeof QW=="object"&&typeof e7<"u"?e7.exports=t():typeof define=="function"&&define.amd?define(t):e.KDBush=t()})(QW,function(){"use strict";function e(f,d,p,g,m,x){if(!(m-g<=p)){var C=g+m>>1;t(f,d,C,g,m,x%2),e(f,d,p,g,C-1,x+1),e(f,d,p,C+1,m,x+1)}}function t(f,d,p,g,m,x){for(;m>g;){if(m-g>600){var C=m-g+1,A=p-g+1,b=Math.log(C),T=.5*Math.exp(2*b/3),S=.5*Math.sqrt(b*T*(C-T)/C)*(A-C/2<0?-1:1),w=Math.max(g,Math.floor(p-A*T/C+S)),D=Math.min(m,Math.floor(p+(C-A)*T/C+S));t(f,d,p,w,D,x)}var I=d[2*p+x],O=g,B=m;for(n(f,d,g,p),d[2*m+x]>I&&n(f,d,g,m);O<B;){for(n(f,d,O,B),O++,B--;d[2*O+x]<I;)O++;for(;d[2*B+x]>I;)B--}d[2*g+x]===I?n(f,d,g,B):(B++,n(f,d,B,m)),B<=p&&(g=B+1),p<=B&&(m=B-1)}}function n(f,d,p,g){i(f,p,g),i(d,2*p,2*g),i(d,2*p+1,2*g+1)}function i(f,d,p){var g=f[d];f[d]=f[p],f[p]=g}function r(f,d,p,g,m,x,C){for(var A=[0,f.length-1,0],b=[],T,S;A.length;){var w=A.pop(),D=A.pop(),I=A.pop();if(D-I<=C){for(var O=I;O<=D;O++)T=d[2*O],S=d[2*O+1],T>=p&&T<=m&&S>=g&&S<=x&&b.push(f[O]);continue}var B=Math.floor((I+D)/2);T=d[2*B],S=d[2*B+1],T>=p&&T<=m&&S>=g&&S<=x&&b.push(f[B]);var L=(w+1)%2;(w===0?p<=T:g<=S)&&(A.push(I),A.push(B-1),A.push(L)),(w===0?m>=T:x>=S)&&(A.push(B+1),A.push(D),A.push(L))}return b}function o(f,d,p,g,m,x){for(var C=[0,f.length-1,0],A=[],b=m*m;C.length;){var T=C.pop(),S=C.pop(),w=C.pop();if(S-w<=x){for(var D=w;D<=S;D++)s(d[2*D],d[2*D+1],p,g)<=b&&A.push(f[D]);continue}var I=Math.floor((w+S)/2),O=d[2*I],B=d[2*I+1];s(O,B,p,g)<=b&&A.push(f[I]);var L=(T+1)%2;(T===0?p-m<=O:g-m<=B)&&(C.push(w),C.push(I-1),C.push(L)),(T===0?p+m>=O:g+m>=B)&&(C.push(I+1),C.push(S),C.push(L))}return A}function s(f,d,p,g){var m=f-p,x=d-g;return m*m+x*x}var a=function(f){return f[0]},c=function(f){return f[1]},u=function(d,p,g,m,x){p===void 0&&(p=a),g===void 0&&(g=c),m===void 0&&(m=64),x===void 0&&(x=Float64Array),this.nodeSize=m,this.points=d;for(var C=d.length<65536?Uint16Array:Uint32Array,A=this.ids=new C(d.length),b=this.coords=new x(d.length*2),T=0;T<d.length;T++)A[T]=T,b[2*T]=p(d[T]),b[2*T+1]=g(d[T]);e(A,b,m,0,A.length-1,0)};return u.prototype.range=function(d,p,g,m){return r(this.ids,this.coords,d,p,g,m,this.nodeSize)},u.prototype.within=function(d,p,g){return o(this.ids,this.coords,d,p,g,this.nodeSize)},u})});var Dme=un((hV,vme)=>{(function(e,t){typeof hV=="object"&&typeof vme<"u"?t(hV):typeof define=="function"&&define.amd?define(["exports"],t):(e=e||self,t(e.topojson=e.topojson||{}))})(hV,function(e){"use strict";function t(T){return T}function n(T){if(T==null)return t;var S,w,D=T.scale[0],I=T.scale[1],O=T.translate[0],B=T.translate[1];return function(L,_){_||(S=w=0);var E=2,v=L.length,P=new Array(v);for(P[0]=(S+=L[0])*D+O,P[1]=(w+=L[1])*I+B;E<v;)P[E]=L[E],++E;return P}}function i(T){var S=n(T.transform),w,D=1/0,I=D,O=-D,B=-D;function L(E){E=S(E),E[0]<D&&(D=E[0]),E[0]>O&&(O=E[0]),E[1]<I&&(I=E[1]),E[1]>B&&(B=E[1])}function _(E){switch(E.type){case"GeometryCollection":E.geometries.forEach(_);break;case"Point":L(E.coordinates);break;case"MultiPoint":E.coordinates.forEach(L);break}}T.arcs.forEach(function(E){for(var v=-1,P=E.length,R;++v<P;)R=S(E[v],v),R[0]<D&&(D=R[0]),R[0]>O&&(O=R[0]),R[1]<I&&(I=R[1]),R[1]>B&&(B=R[1])});for(w in T.objects)_(T.objects[w]);return[D,I,O,B]}function r(T,S){for(var w,D=T.length,I=D-S;I<--D;)w=T[I],T[I++]=T[D],T[D]=w}function o(T,S){return typeof S=="string"&&(S=T.objects[S]),S.type==="GeometryCollection"?{type:"FeatureCollection",features:S.geometries.map(function(w){return s(T,w)})}:s(T,S)}function s(T,S){var w=S.id,D=S.bbox,I=S.properties==null?{}:S.properties,O=a(T,S);return w==null&&D==null?{type:"Feature",properties:I,geometry:O}:D==null?{type:"Feature",id:w,properties:I,geometry:O}:{type:"Feature",id:w,bbox:D,properties:I,geometry:O}}function a(T,S){var w=n(T.transform),D=T.arcs;function I(v,P){P.length&&P.pop();for(var R=D[v<0?~v:v],F=0,U=R.length;F<U;++F)P.push(w(R[F],F));v<0&&r(P,U)}function O(v){return w(v)}function B(v){for(var P=[],R=0,F=v.length;R<F;++R)I(v[R],P);return P.length<2&&P.push(P[0]),P}function L(v){for(var P=B(v);P.length<4;)P.push(P[0]);return P}function _(v){return v.map(L)}function E(v){var P=v.type,R;switch(P){case"GeometryCollection":return{type:P,geometries:v.geometries.map(E)};case"Point":R=O(v.coordinates);break;case"MultiPoint":R=v.coordinates.map(O);break;case"LineString":R=B(v.arcs);break;case"MultiLineString":R=v.arcs.map(B);break;case"Polygon":R=_(v.arcs);break;case"MultiPolygon":R=v.arcs.map(_);break;default:return null}return{type:P,coordinates:R}}return E(S)}function c(T,S){var w={},D={},I={},O=[],B=-1;S.forEach(function(E,v){var P=T.arcs[E<0?~E:E],R;P.length<3&&!P[1][0]&&!P[1][1]&&(R=S[++B],S[B]=E,S[v]=R)}),S.forEach(function(E){var v=L(E),P=v[0],R=v[1],F,U;if(F=I[P])if(delete I[F.end],F.push(E),F.end=R,U=D[R]){delete D[U.start];var k=U===F?F:F.concat(U);D[k.start=F.start]=I[k.end=U.end]=k}else D[F.start]=I[F.end]=F;else if(F=D[R])if(delete D[F.start],F.unshift(E),F.start=P,U=I[P]){delete I[U.end];var H=U===F?F:U.concat(F);D[H.start=U.start]=I[H.end=F.end]=H}else D[F.start]=I[F.end]=F;else F=[E],D[F.start=P]=I[F.end=R]=F});function L(E){var v=T.arcs[E<0?~E:E],P=v[0],R;return T.transform?(R=[0,0],v.forEach(function(F){R[0]+=F[0],R[1]+=F[1]})):R=v[v.length-1],E<0?[R,P]:[P,R]}function _(E,v){for(var P in E){var R=E[P];delete v[R.start],delete R.start,delete R.end,R.forEach(function(F){w[F<0?~F:F]=1}),O.push(R)}}return _(I,D),_(D,I),S.forEach(function(E){w[E<0?~E:E]||O.push([E])}),O}function u(T){return a(T,f.apply(this,arguments))}function f(T,S,w){var D,I,O;if(arguments.length>1)D=d(T,S,w);else for(I=0,D=new Array(O=T.arcs.length);I<O;++I)D[I]=I;return{type:"MultiLineString",arcs:c(T,D)}}function d(T,S,w){var D=[],I=[],O;function B(P){var R=P<0?~P:P;(I[R]||(I[R]=[])).push({i:P,g:O})}function L(P){P.forEach(B)}function _(P){P.forEach(L)}function E(P){P.forEach(_)}function v(P){switch(O=P,P.type){case"GeometryCollection":P.geometries.forEach(v);break;case"LineString":L(P.arcs);break;case"MultiLineString":case"Polygon":_(P.arcs);break;case"MultiPolygon":E(P.arcs);break}}return v(S),I.forEach(w==null?function(P){D.push(P[0].i)}:function(P){w(P[0].g,P[P.length-1].g)&&D.push(P[0].i)}),D}function p(T){for(var S=-1,w=T.length,D,I=T[w-1],O=0;++S<w;)D=I,I=T[S],O+=D[0]*I[1]-D[1]*I[0];return Math.abs(O)}function g(T){return a(T,m.apply(this,arguments))}function m(T,S){var w={},D=[],I=[];S.forEach(O);function O(_){switch(_.type){case"GeometryCollection":_.geometries.forEach(O);break;case"Polygon":B(_.arcs);break;case"MultiPolygon":_.arcs.forEach(B);break}}function B(_){_.forEach(function(E){E.forEach(function(v){(w[v=v<0?~v:v]||(w[v]=[])).push(_)})}),D.push(_)}function L(_){return p(a(T,{type:"Polygon",arcs:[_]}).coordinates[0])}return D.forEach(function(_){if(!_._){var E=[],v=[_];for(_._=1,I.push(E);_=v.pop();)E.push(_),_.forEach(function(P){P.forEach(function(R){w[R<0?~R:R].forEach(function(F){F._||(F._=1,v.push(F))})})})}}),D.forEach(function(_){delete _._}),{type:"MultiPolygon",arcs:I.map(function(_){var E=[],v;if(_.forEach(function(k){k.forEach(function(H){H.forEach(function(V){w[V<0?~V:V].length<2&&E.push(V)})})}),E=c(T,E),(v=E.length)>1)for(var P=1,R=L(E[0]),F,U;P<v;++P)(F=L(E[P]))>R&&(U=E[0],E[0]=E[P],E[P]=U,R=F);return E}).filter(function(_){return _.length>0})}}function x(T,S){for(var w=0,D=T.length;w<D;){var I=w+D>>>1;T[I]<S?w=I+1:D=I}return w}function C(T){var S={},w=T.map(function(){return[]});function D(k,H){k.forEach(function(V){V<0&&(V=~V);var q=S[V];q?q.push(H):S[V]=[H]})}function I(k,H){k.forEach(function(V){D(V,H)})}function O(k,H){k.type==="GeometryCollection"?k.geometries.forEach(function(V){O(V,H)}):k.type in B&&B[k.type](k.arcs,H)}var B={LineString:D,MultiLineString:I,Polygon:I,MultiPolygon:function(k,H){k.forEach(function(V){I(V,H)})}};T.forEach(O);for(var L in S)for(var _=S[L],E=_.length,v=0;v<E;++v)for(var P=v+1;P<E;++P){var R=_[v],F=_[P],U;(U=w[R])[L=x(U,F)]!==F&&U.splice(L,0,F),(U=w[F])[L=x(U,R)]!==R&&U.splice(L,0,R)}return w}function A(T){if(T==null)return t;var S,w,D=T.scale[0],I=T.scale[1],O=T.translate[0],B=T.translate[1];return function(L,_){_||(S=w=0);var E=2,v=L.length,P=new Array(v),R=Math.round((L[0]-O)/D),F=Math.round((L[1]-B)/I);for(P[0]=R-S,S=R,P[1]=F-w,w=F;E<v;)P[E]=L[E],++E;return P}}function b(T,S){if(T.transform)throw new Error("already quantized");if(!S||!S.scale){if(!((B=Math.floor(S))>=2))throw new Error("n must be \u22652");_=T.bbox||i(T);var w=_[0],D=_[1],I=_[2],O=_[3],B;S={scale:[I-w?(I-w)/(B-1):1,O-D?(O-D)/(B-1):1],translate:[w,D]}}else _=T.bbox;var L=A(S),_,E,v=T.objects,P={};function R(k){return L(k)}function F(k){var H;switch(k.type){case"GeometryCollection":H={type:"GeometryCollection",geometries:k.geometries.map(F)};break;case"Point":H={type:"Point",coordinates:R(k.coordinates)};break;case"MultiPoint":H={type:"MultiPoint",coordinates:k.coordinates.map(R)};break;default:return k}return k.id!=null&&(H.id=k.id),k.bbox!=null&&(H.bbox=k.bbox),k.properties!=null&&(H.properties=k.properties),H}function U(k){var H=0,V=1,q=k.length,j,X=new Array(q);for(X[0]=L(k[0],0);++H<q;)((j=L(k[H],H))[0]||j[1])&&(X[V++]=j);return V===1&&(X[V++]=[0,0]),X.length=V,X}for(E in v)P[E]=F(v[E]);return{type:"Topology",bbox:_,transform:S,objects:P,arcs:T.arcs.map(U)}}e.bbox=i,e.feature=o,e.merge=g,e.mergeArcs=m,e.mesh=u,e.meshArcs=f,e.neighbors=C,e.quantize=b,e.transform=n,e.untransform=A,Object.defineProperty(e,"__esModule",{value:!0})})});var lE=un(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.throwUnhandledCaseError=vl.splitAndCapture=vl.remove=vl.indexOf=vl.ellipsis=vl.defaults=void 0;function yit(e,t){for(var n in t)t.hasOwnProperty(n)&&e[n]===void 0&&(e[n]=t[n]);return e}vl.defaults=yit;function xit(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}vl.ellipsis=xit;function Cit(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return n;return-1}vl.indexOf=Cit;function Ait(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}vl.remove=Ait;function Tit(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var n=[],i=0,r;r=t.exec(e);)n.push(e.substring(i,r.index)),n.push(r[0]),i=r.index+r[0].length;return n.push(e.substring(i)),n}vl.splitAndCapture=Tit;function bit(e){throw new Error("Unhandled case for value: '"+e+"'")}vl.throwUnhandledCaseError=bit});var xV=un(yV=>{"use strict";Object.defineProperty(yV,"__esModule",{value:!0});yV.HtmlTag=void 0;var Yme=lE(),Eit=function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.whitespaceRegex=/\s+/,this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=this.whitespaceRegex,r=n?n.split(i):[],o=t.split(i),s;s=o.shift();)Yme.indexOf(r,s)===-1&&r.push(s);return this.getAttrs().class=r.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=this.whitespaceRegex,r=n?n.split(i):[],o=t.split(i),s;r.length&&(s=o.shift());){var a=Yme.indexOf(r,s);a!==-1&&r.splice(a,1)}return this.getAttrs().class=r.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var t=this.getAttrs(),n=[];for(var i in t)t.hasOwnProperty(i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e}();yV.HtmlTag=Eit});var Xme=un(CV=>{"use strict";Object.defineProperty(CV,"__esModule",{value:!0});CV.truncateSmart=void 0;function Sit(e,t,n){var i,r;n==null?(n="…",r=3,i=8):(r=n.length,i=n.length);var o=function(b){var T={},S=b,w=S.match(/^([a-z]+):\/\//i);return w&&(T.scheme=w[1],S=S.substr(w[0].length)),w=S.match(/^(.*?)(?=(\?|#|\/|$))/i),w&&(T.host=w[1],S=S.substr(w[0].length)),w=S.match(/^\/(.*?)(?=(\?|#|$))/i),w&&(T.path=w[1],S=S.substr(w[0].length)),w=S.match(/^\?(.*?)(?=(#|$))/i),w&&(T.query=w[1],S=S.substr(w[0].length)),w=S.match(/^#(.*?)$/i),w&&(T.fragment=w[1]),T},s=function(b){var T="";return b.scheme&&b.host&&(T+=b.scheme+"://"),b.host&&(T+=b.host),b.path&&(T+="/"+b.path),b.query&&(T+="?"+b.query),b.fragment&&(T+="#"+b.fragment),T},a=function(b,T){var S=T/2,w=Math.ceil(S),D=-1*Math.floor(S),I="";return D<0&&(I=b.substr(D)),b.substr(0,w)+n+I};if(e.length<=t)return e;var c=t-r,u=o(e);if(u.query){var f=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);f&&(u.query=u.query.substr(0,f[1].length),e=s(u))}if(e.length<=t||(u.host&&(u.host=u.host.replace(/^www\./,""),e=s(u)),e.length<=t))return e;var d="";if(u.host&&(d+=u.host),d.length>=c)return u.host.length==t?(u.host.substr(0,t-r)+n).substr(0,c+i):a(d,c).substr(0,c+i);var p="";if(u.path&&(p+="/"+u.path),u.query&&(p+="?"+u.query),p)if((d+p).length>=c){if((d+p).length==t)return(d+p).substr(0,t);var g=c-d.length;return(d+a(p,g)).substr(0,c+i)}else d+=p;if(u.fragment){var m="#"+u.fragment;if((d+m).length>=c){if((d+m).length==t)return(d+m).substr(0,t);var x=c-d.length;return(d+a(m,x)).substr(0,c+i)}else d+=m}if(u.scheme&&u.host){var C=u.scheme+"://";if((d+C).length<c)return(C+d).substr(0,t)}if(d.length<=t)return d;var A="";return c>0&&(A=d.substr(-1*Math.floor(c/2))),(d.substr(0,Math.ceil(c/2))+n+A).substr(0,c+i)}CV.truncateSmart=Sit});var Kme=un(AV=>{"use strict";Object.defineProperty(AV,"__esModule",{value:!0});AV.truncateMiddle=void 0;function wit(e,t,n){if(e.length<=t)return e;var i,r;n==null?(n="…",i=8,r=3):(i=n.length,r=n.length);var o=t-r,s="";return o>0&&(s=e.substr(-1*Math.floor(o/2))),(e.substr(0,Math.ceil(o/2))+n+s).substr(0,o+i)}AV.truncateMiddle=wit});var $me=un(TV=>{"use strict";Object.defineProperty(TV,"__esModule",{value:!0});TV.truncateEnd=void 0;var vit=lE();function Dit(e,t,n){return vit.ellipsis(e,t,n)}TV.truncateEnd=Dit});var Vj=un(bV=>{"use strict";Object.defineProperty(bV,"__esModule",{value:!0});bV.AnchorTagBuilder=void 0;var Pit=xV(),Iit=Xme(),Oit=Kme(),Rit=$me(),Mit=function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new Pit.HtmlTag({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],r=t.getCssClassSuffixes(),o=0,s=r.length;o<s;o++)i.push(n+"-"+r[o]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n||!n.length)return t;var i=n.length,r=n.location;return r==="smart"?Iit.truncateSmart(t,i):r==="middle"?Oit.truncateMiddle(t,i):Rit.truncateEnd(t,i)},e}();bV.AnchorTagBuilder=Mit});var A0=un(EV=>{"use strict";Object.defineProperty(EV,"__esModule",{value:!0});EV.Match=void 0;var Bit=function(){function e(t){this.__jsduckDummyDocProp=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.getType()]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}();EV.Match=Bit});var Uc=un((tCi,wV)=>{/*! *****************************************************************************
- Copyright (c) Microsoft Corporation.
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted.
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
- ***************************************************************************** */var Zme,Jme,Qme,epe,tpe,npe,ipe,rpe,ope,SV,kj,spe,ape,uE,cpe,lpe,upe,fpe,dpe,hpe,mpe,ppe,_pe;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(i){e(n(t,n(i)))}):typeof wV=="object"&&typeof wV.exports=="object"?e(n(t,n(wV.exports))):e(n(t));function n(i,r){return i!==t&&(typeof Object.create=="function"?Object.defineProperty(i,"__esModule",{value:!0}):i.__esModule=!0),function(o,s){return i[o]=r?r(o,s):s}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)i.hasOwnProperty(r)&&(n[r]=i[r])};Zme=function(n,i){t(n,i);function r(){this.constructor=n}n.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)},Jme=Object.assign||function(n){for(var i,r=1,o=arguments.length;r<o;r++){i=arguments[r];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])}return n},Qme=function(n,i){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.indexOf(o)<0&&(r[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,o=Object.getOwnPropertySymbols(n);s<o.length;s++)i.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(n,o[s])&&(r[o[s]]=n[o[s]]);return r},epe=function(n,i,r,o){var s=arguments.length,a=s<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,r):o,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(n,i,r,o);else for(var u=n.length-1;u>=0;u--)(c=n[u])&&(a=(s<3?c(a):s>3?c(i,r,a):c(i,r))||a);return s>3&&a&&Object.defineProperty(i,r,a),a},tpe=function(n,i){return function(r,o){i(r,o,n)}},npe=function(n,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,i)},ipe=function(n,i,r,o){function s(a){return a instanceof r?a:new r(function(c){c(a)})}return new(r||(r=Promise))(function(a,c){function u(p){try{d(o.next(p))}catch(g){c(g)}}function f(p){try{d(o.throw(p))}catch(g){c(g)}}function d(p){p.done?a(p.value):s(p.value).then(u,f)}d((o=o.apply(n,i||[])).next())})},rpe=function(n,i){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(d){return function(p){return f([d,p])}}function f(d){if(o)throw new TypeError("Generator is already executing.");for(;r;)try{if(o=1,s&&(a=d[0]&2?s.return:d[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,d[1])).done)return a;switch(s=0,a&&(d=[d[0]&2,a.value]),d[0]){case 0:case 1:a=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,s=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!a||d[1]>a[0]&&d[1]<a[3])){r.label=d[1];break}if(d[0]===6&&r.label<a[1]){r.label=a[1],a=d;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(d);break}a[2]&&r.ops.pop(),r.trys.pop();continue}d=i.call(n,r)}catch(p){d=[6,p],s=0}finally{o=a=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}},_pe=function(n,i,r,o){o===void 0&&(o=r),n[o]=i[r]},ope=function(n,i){for(var r in n)r!=="default"&&!i.hasOwnProperty(r)&&(i[r]=n[r])},SV=function(n){var i=typeof Symbol=="function"&&Symbol.iterator,r=i&&n[i],o=0;if(r)return r.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&o>=n.length&&(n=void 0),{value:n&&n[o++],done:!n}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},kj=function(n,i){var r=typeof Symbol=="function"&&n[Symbol.iterator];if(!r)return n;var o=r.call(n),s,a=[],c;try{for(;(i===void 0||i-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(u){c={error:u}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(c)throw c.error}}return a},spe=function(){for(var n=[],i=0;i<arguments.length;i++)n=n.concat(kj(arguments[i]));return n},ape=function(){for(var n=0,i=0,r=arguments.length;i<r;i++)n+=arguments[i].length;for(var o=Array(n),s=0,i=0;i<r;i++)for(var a=arguments[i],c=0,u=a.length;c<u;c++,s++)o[s]=a[c];return o},uE=function(n){return this instanceof uE?(this.v=n,this):new uE(n)},cpe=function(n,i,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=r.apply(n,i||[]),s,a=[];return s={},c("next"),c("throw"),c("return"),s[Symbol.asyncIterator]=function(){return this},s;function c(m){o[m]&&(s[m]=function(x){return new Promise(function(C,A){a.push([m,x,C,A])>1||u(m,x)})})}function u(m,x){try{f(o[m](x))}catch(C){g(a[0][3],C)}}function f(m){m.value instanceof uE?Promise.resolve(m.value.v).then(d,p):g(a[0][2],m)}function d(m){u("next",m)}function p(m){u("throw",m)}function g(m,x){m(x),a.shift(),a.length&&u(a[0][0],a[0][1])}},lpe=function(n){var i,r;return i={},o("next"),o("throw",function(s){throw s}),o("return"),i[Symbol.iterator]=function(){return this},i;function o(s,a){i[s]=n[s]?function(c){return(r=!r)?{value:uE(n[s](c)),done:s==="return"}:a?a(c):c}:a}},upe=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n[Symbol.asyncIterator],r;return i?i.call(n):(n=typeof SV=="function"?SV(n):n[Symbol.iterator](),r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r);function o(a){r[a]=n[a]&&function(c){return new Promise(function(u,f){c=n[a](c),s(u,f,c.done,c.value)})}}function s(a,c,u,f){Promise.resolve(f).then(function(d){a({value:d,done:u})},c)}},fpe=function(n,i){return Object.defineProperty?Object.defineProperty(n,"raw",{value:i}):n.raw=i,n},dpe=function(n){if(n&&n.__esModule)return n;var i={};if(n!=null)for(var r in n)Object.hasOwnProperty.call(n,r)&&(i[r]=n[r]);return i.default=n,i},hpe=function(n){return n&&n.__esModule?n:{default:n}},mpe=function(n,i){if(!i.has(n))throw new TypeError("attempted to get private field on non-instance");return i.get(n)},ppe=function(n,i,r){if(!i.has(n))throw new TypeError("attempted to set private field on non-instance");return i.set(n,r),r},e("__extends",Zme),e("__assign",Jme),e("__rest",Qme),e("__decorate",epe),e("__param",tpe),e("__metadata",npe),e("__awaiter",ipe),e("__generator",rpe),e("__exportStar",ope),e("__createBinding",_pe),e("__values",SV),e("__read",kj),e("__spread",spe),e("__spreadArrays",ape),e("__await",uE),e("__asyncGenerator",cpe),e("__asyncDelegator",lpe),e("__asyncValues",upe),e("__makeTemplateObject",fpe),e("__importStar",dpe),e("__importDefault",hpe),e("__classPrivateFieldGet",mpe),e("__classPrivateFieldSet",ppe)})});var DV=un(vV=>{"use strict";Object.defineProperty(vV,"__esModule",{value:!0});vV.EmailMatch=void 0;var Lit=Uc(),Nit=A0(),Fit=function(e){Lit.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(Nit.Match);vV.EmailMatch=Fit});var IV=un(PV=>{"use strict";Object.defineProperty(PV,"__esModule",{value:!0});PV.HashtagMatch=void 0;var Vit=Uc(),kit=A0(),Uit=function(e){Vit.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.serviceName="",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;default:throw new Error("Unknown service name to point hashtag to: "+n)}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t}(kit.Match);PV.HashtagMatch=Uit});var RV=un(OV=>{"use strict";Object.defineProperty(OV,"__esModule",{value:!0});OV.MentionMatch=void 0;var zit=Uc(),Hit=A0(),Git=function(e){zit.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(Hit.Match);OV.MentionMatch=Git});var BV=un(MV=>{"use strict";Object.defineProperty(MV,"__esModule",{value:!0});MV.PhoneMatch=void 0;var Wit=Uc(),jit=A0(),qit=function(e){Wit.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(jit.Match);MV.PhoneMatch=qit});var NV=un(LV=>{"use strict";Object.defineProperty(LV,"__esModule",{value:!0});LV.UrlMatch=void 0;var Yit=Uc(),Xit=A0(),Kit=function(e){Yit.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.url="",i.urlMatchType="scheme",i.protocolUrlMatch=!1,i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.schemePrefixRegex=/^(https?:\/\/)?/i,i.wwwPrefixRegex=/^(https?:\/\/)?(www\.)?/i,i.protocolRelativeRegex=/^\/\//,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolUrlMatch=n.protocolUrlMatch,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&!this.protocolUrlMatch&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=this.stripProtocolRelativePrefix(n)),this.stripPrefix.scheme&&(n=this.stripSchemePrefix(n)),this.stripPrefix.www&&(n=this.stripWwwPrefix(n)),this.stripTrailingSlash&&(n=this.removeTrailingSlash(n)),this.decodePercentEncoding&&(n=this.removePercentEncoding(n)),n},t.prototype.stripSchemePrefix=function(n){return n.replace(this.schemePrefixRegex,"")},t.prototype.stripWwwPrefix=function(n){return n.replace(this.wwwPrefixRegex,"$1")},t.prototype.stripProtocolRelativePrefix=function(n){return n.replace(this.protocolRelativeRegex,"")},t.prototype.removeTrailingSlash=function(n){return n.charAt(n.length-1)==="/"&&(n=n.slice(0,-1)),n},t.prototype.removePercentEncoding=function(n){var i=n.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(i)}catch{return i}},t}(Xit.Match);LV.UrlMatch=Kit});var T0=un(FV=>{"use strict";Object.defineProperty(FV,"__esModule",{value:!0});FV.Matcher=void 0;var $it=function(){function e(t){this.__jsduckDummyDocProp=null,this.tagBuilder=t.tagBuilder}return e}();FV.Matcher=$it});var b0=un(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.domainNameCharRegex=Vn.domainNameRegex=Vn.getDomainNameStr=Vn.alphaNumericAndMarksCharsStr=Vn.alphaNumericCharsStr=Vn.decimalNumbersStr=Vn.alphaCharsAndMarksStr=Vn.marksStr=Vn.emojiStr=Vn.alphaCharsStr=Vn.controlCharsRe=Vn.quoteRe=Vn.whitespaceRe=Vn.nonDigitRe=Vn.digitRe=Vn.letterRe=void 0;Vn.letterRe=/[A-Za-z]/;Vn.digitRe=/[\d]/;Vn.nonDigitRe=/[\D]/;Vn.whitespaceRe=/\s/;Vn.quoteRe=/['"]/;Vn.controlCharsRe=/[\x00-\x1F\x7F]/;Vn.alphaCharsStr=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source;Vn.emojiStr=/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source;Vn.marksStr=/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source;Vn.alphaCharsAndMarksStr=Vn.alphaCharsStr+Vn.emojiStr+Vn.marksStr;Vn.decimalNumbersStr=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source;Vn.alphaNumericCharsStr=Vn.alphaCharsAndMarksStr+Vn.decimalNumbersStr;Vn.alphaNumericAndMarksCharsStr=Vn.alphaCharsAndMarksStr+Vn.decimalNumbersStr;var Zit="(?:["+Vn.decimalNumbersStr+"]{1,3}\\.){3}["+Vn.decimalNumbersStr+"]{1,3}",Jit="["+Vn.alphaNumericAndMarksCharsStr+"](?:["+Vn.alphaNumericAndMarksCharsStr+"\\-]{0,61}["+Vn.alphaNumericAndMarksCharsStr+"])?",gpe=function(e){return"(?=("+Jit+"))\\"+e},Qit=function(e){return"(?:"+gpe(e)+"(?:\\."+gpe(e+1)+"){0,126}|"+Zit+")"};Vn.getDomainNameStr=Qit;Vn.domainNameRegex=new RegExp("["+Vn.alphaNumericAndMarksCharsStr+".\\-]*["+Vn.alphaNumericAndMarksCharsStr+"\\-]");Vn.domainNameCharRegex=new RegExp("["+Vn.alphaNumericAndMarksCharsStr+"]")});var Uj=un(VV=>{"use strict";Object.defineProperty(VV,"__esModule",{value:!0});VV.tldRegex=void 0;VV.tldRegex=/(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/});var zj=un(UV=>{"use strict";Object.defineProperty(UV,"__esModule",{value:!0});UV.EmailMatcher=void 0;var HD=Uc(),ert=T0(),GD=b0(),trt=DV(),nrt=lE(),irt=Uj(),rrt=new RegExp("["+GD.alphaNumericAndMarksCharsStr+"!#$%&'*+/=?^_`{|}~-]"),ort=new RegExp("^"+irt.tldRegex.source+"$"),srt=function(e){HD.__extends(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.localPartCharRegex=rrt,n.strictTldRegex=ort,n}return t.prototype.parseMatches=function(n){for(var i=this.tagBuilder,r=this.localPartCharRegex,o=this.strictTldRegex,s=[],a=n.length,c=new kV,u={m:"a",a:"i",i:"l",l:"t",t:"o",o:":"},f=0,d=0,p=c;f<a;){var g=n.charAt(f);switch(d){case 0:m(g);break;case 1:x(n.charAt(f-1),g);break;case 2:C(g);break;case 3:A(g);break;case 4:b(g);break;case 5:T(g);break;case 6:S(g);break;case 7:w(g);break;default:nrt.throwUnhandledCaseError(d)}f++}return O(),s;function m(B){B==="m"?D(1):r.test(B)&&D()}function x(B,L){B===":"?r.test(L)?(d=2,p=new kV(HD.__assign(HD.__assign({},p),{hasMailtoPrefix:!0}))):I():u[B]===L||(r.test(L)?d=2:L==="."?d=3:L==="@"?d=4:I())}function C(B){B==="."?d=3:B==="@"?d=4:r.test(B)||I()}function A(B){B==="."||B==="@"?I():r.test(B)?d=2:I()}function b(B){GD.domainNameCharRegex.test(B)?d=5:I()}function T(B){B==="."?d=7:B==="-"?d=6:GD.domainNameCharRegex.test(B)||O()}function S(B){B==="-"||B==="."?O():GD.domainNameCharRegex.test(B)?d=5:O()}function w(B){B==="."||B==="-"?O():GD.domainNameCharRegex.test(B)?(d=5,p=new kV(HD.__assign(HD.__assign({},p),{hasDomainDot:!0}))):O()}function D(B){B===void 0&&(B=2),d=B,p=new kV({idx:f})}function I(){d=0,p=c}function O(){if(p.hasDomainDot){var B=n.slice(p.idx,f);/[-.]$/.test(B)&&(B=B.slice(0,-1));var L=p.hasMailtoPrefix?B.slice(7):B;_(L)&&s.push(new trt.EmailMatch({tagBuilder:i,matchedText:B,offset:p.idx,email:L}))}I();function _(E){var v=E.split(".").pop()||"",P=v.toLowerCase(),R=o.test(P);return R}}},t}(ert.Matcher);UV.EmailMatcher=srt;var kV=function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.hasMailtoPrefix=!!t.hasMailtoPrefix,this.hasDomainDot=!!t.hasDomainDot}return e}()});var ype=un(zV=>{"use strict";Object.defineProperty(zV,"__esModule",{value:!0});zV.UrlMatchValidator=void 0;var art=b0(),crt=function(){function e(){}return e.isValid=function(t,n){return!(n&&!this.isValidUriScheme(n)||this.urlMatchDoesNotHaveProtocolOrDot(t,n)||this.urlMatchDoesNotHaveAtLeastOneWordChar(t,n)&&!this.isValidIpAddress(t)||this.containsMultipleDots(t))},e.isValidIpAddress=function(t){var n=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source),i=t.match(n);return i!==null},e.containsMultipleDots=function(t){var n=t;return this.hasFullProtocolRegex.test(t)&&(n=t.split("://")[1]),n.split("/")[0].indexOf("..")>-1},e.isValidUriScheme=function(t){var n=t.match(this.uriSchemeRegex),i=n&&n[0].toLowerCase();return i!=="javascript:"&&i!=="vbscript:"},e.urlMatchDoesNotHaveProtocolOrDot=function(t,n){return!!t&&(!n||!this.hasFullProtocolRegex.test(n))&&t.indexOf(".")===-1},e.urlMatchDoesNotHaveAtLeastOneWordChar=function(t,n){return t&&n?!this.hasFullProtocolRegex.test(n)&&!this.hasWordCharAfterProtocolRegex.test(t):!1},e.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,e.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/,e.hasWordCharAfterProtocolRegex=new RegExp(":[^\\s]*?["+art.alphaCharsStr+"]"),e.ipRegex=/[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/,e}();zV.UrlMatchValidator=crt});var Hj=un(HV=>{"use strict";Object.defineProperty(HV,"__esModule",{value:!0});HV.UrlMatcher=void 0;var lrt=Uc(),urt=T0(),xm=b0(),frt=Uj(),drt=NV(),hrt=ype(),mrt=function(){var e=/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/,t=/(?:www\.)/,n=new RegExp("[/?#](?:["+xm.alphaNumericAndMarksCharsStr+"\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^\u2713]*["+xm.alphaNumericAndMarksCharsStr+"\\-+&@#/%=~_()|'$*\\[\\]{}\u2713])?");return new RegExp(["(?:","(",e.source,xm.getDomainNameStr(2),")","|","(","(//)?",t.source,xm.getDomainNameStr(6),")","|","(","(//)?",xm.getDomainNameStr(10)+"\\.",frt.tldRegex.source,"(?![-"+xm.alphaNumericCharsStr+"])",")",")","(?::[0-9]+)?","(?:"+n.source+")?"].join(""),"gi")}(),prt=new RegExp("["+xm.alphaNumericAndMarksCharsStr+"]"),_rt=function(e){lrt.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.matcherRegex=mrt,i.wordCharRegExp=prt,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.parseMatches=function(n){for(var i=this.matcherRegex,r=this.stripPrefix,o=this.stripTrailingSlash,s=this.decodePercentEncoding,a=this.tagBuilder,c=[],u,f=function(){var p=u[0],g=u[1],m=u[4],x=u[5],C=u[9],A=u.index,b=x||C,T=n.charAt(A-1);if(!hrt.UrlMatchValidator.isValid(p,g)||A>0&&T==="@"||A>0&&b&&d.wordCharRegExp.test(T))return"continue";if(/\?$/.test(p)&&(p=p.substr(0,p.length-1)),d.matchHasUnbalancedClosingParen(p))p=p.substr(0,p.length-1);else{var S=d.matchHasInvalidCharAfterTld(p,g);S>-1&&(p=p.substr(0,S))}var w=["http://","https://"].find(function(B){return!!g&&g.indexOf(B)!==-1});if(w){var D=p.indexOf(w);p=p.substr(D),g=g.substr(D),A=A+D}var I=g?"scheme":m?"www":"tld",O=!!g;c.push(new drt.UrlMatch({tagBuilder:a,matchedText:p,offset:A,urlMatchType:I,url:p,protocolUrlMatch:O,protocolRelativeMatch:!!b,stripPrefix:r,stripTrailingSlash:o,decodePercentEncoding:s}))},d=this;(u=i.exec(n))!==null;)f();return c},t.prototype.matchHasUnbalancedClosingParen=function(n){var i=n.charAt(n.length-1),r;if(i===")")r="(";else if(i==="]")r="[";else if(i==="}")r="{";else return!1;for(var o=0,s=0,a=n.length-1;s<a;s++){var c=n.charAt(s);c===r?o++:c===i&&(o=Math.max(o-1,0))}return o===0},t.prototype.matchHasInvalidCharAfterTld=function(n,i){if(!n)return-1;var r=0;i&&(r=n.indexOf(":"),n=n.slice(r));var o=new RegExp("^((.?//)?[-."+xm.alphaNumericAndMarksCharsStr+"]*[-"+xm.alphaNumericAndMarksCharsStr+"]\\.[-"+xm.alphaNumericAndMarksCharsStr+"]+)"),s=o.exec(n);return s===null?-1:(r+=s[1].length,n=n.slice(s[1].length),/^[^-.A-Za-z0-9:\/?#]/.test(n)?r:-1)},t}(urt.Matcher);HV.UrlMatcher=_rt});var Wj=un(GV=>{"use strict";Object.defineProperty(GV,"__esModule",{value:!0});GV.HashtagMatcher=void 0;var grt=Uc(),yrt=T0(),Gj=b0(),xrt=IV(),Crt=new RegExp("#[_"+Gj.alphaNumericAndMarksCharsStr+"]{1,139}(?![_"+Gj.alphaNumericAndMarksCharsStr+"])","g"),Art=new RegExp("[^"+Gj.alphaNumericAndMarksCharsStr+"]"),Trt=function(e){grt.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.serviceName="twitter",i.matcherRegex=Crt,i.nonWordCharRegex=Art,i.serviceName=n.serviceName,i}return t.prototype.parseMatches=function(n){for(var i=this.matcherRegex,r=this.nonWordCharRegex,o=this.serviceName,s=this.tagBuilder,a=[],c;(c=i.exec(n))!==null;){var u=c.index,f=n.charAt(u-1);if(u===0||r.test(f)){var d=c[0],p=c[0].slice(1);a.push(new xrt.HashtagMatch({tagBuilder:s,matchedText:d,offset:u,serviceName:o,hashtag:p}))}}return a},t}(yrt.Matcher);GV.HashtagMatcher=Trt});var jj=un(WV=>{"use strict";Object.defineProperty(WV,"__esModule",{value:!0});WV.PhoneMatcher=void 0;var brt=Uc(),Ert=T0(),Srt=BV(),wrt=b0(),vrt=/(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/,Drt=/(0([1-9]{1}-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,Prt=new RegExp(vrt.source+"|"+Drt.source,"g"),Irt=function(e){brt.__extends(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.matcherRegex=Prt,n}return t.prototype.parseMatches=function(n){for(var i=this.matcherRegex,r=this.tagBuilder,o=[],s;(s=i.exec(n))!==null;){var a=s[0],c=a.replace(/[^0-9,;#]/g,""),u=!!(s[1]||s[2]),f=s.index==0?"":n.substr(s.index-1,1),d=n.substr(s.index+a.length,1),p=!f.match(/\d/)&&!d.match(/\d/);this.testMatch(s[3])&&this.testMatch(a)&&p&&o.push(new Srt.PhoneMatch({tagBuilder:r,matchedText:a,offset:s.index,number:c,plusSign:u}))}return o},t.prototype.testMatch=function(n){return wrt.nonDigitRe.test(n)},t}(Ert.Matcher);WV.PhoneMatcher=Irt});var qj=un(jV=>{"use strict";Object.defineProperty(jV,"__esModule",{value:!0});jV.MentionMatcher=void 0;var Ort=Uc(),Rrt=T0(),tC=b0(),Mrt=RV(),Brt=new RegExp("@[_"+tC.alphaNumericAndMarksCharsStr+"]{1,50}(?![_"+tC.alphaNumericAndMarksCharsStr+"])","g"),Lrt=new RegExp("@[_."+tC.alphaNumericAndMarksCharsStr+"]{1,30}(?![_"+tC.alphaNumericAndMarksCharsStr+"])","g"),Nrt=new RegExp("@[-_."+tC.alphaNumericAndMarksCharsStr+"]{1,50}(?![-_"+tC.alphaNumericAndMarksCharsStr+"])","g"),Frt=new RegExp("[^"+tC.alphaNumericAndMarksCharsStr+"]"),Vrt=function(e){Ort.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.serviceName="twitter",i.matcherRegexes={twitter:Brt,instagram:Lrt,soundcloud:Nrt},i.nonWordCharRegex=Frt,i.serviceName=n.serviceName,i}return t.prototype.parseMatches=function(n){var i=this.serviceName,r=this.matcherRegexes[this.serviceName],o=this.nonWordCharRegex,s=this.tagBuilder,a=[],c;if(!r)return a;for(;(c=r.exec(n))!==null;){var u=c.index,f=n.charAt(u-1);if(u===0||o.test(f)){var d=c[0].replace(/\.+$/g,""),p=d.slice(1);a.push(new Mrt.MentionMatch({tagBuilder:s,matchedText:d,offset:u,serviceName:i,mention:p}))}}return a},t}(Rrt.Matcher);jV.MentionMatcher=Vrt});var xpe=un(qV=>{"use strict";Object.defineProperty(qV,"__esModule",{value:!0});qV.parseHtml=void 0;var tc=Uc(),zc=b0(),krt=lE();function Urt(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,r=t.onText,o=t.onComment,s=t.onDoctype,a=new Cm,c=0,u=e.length,f=0,d=0,p=a;c<u;){var g=e.charAt(c);switch(f){case 0:m(g);break;case 1:x(g);break;case 2:A(g);break;case 3:C(g);break;case 4:b(g);break;case 5:T(g);break;case 6:S(g);break;case 7:w(g);break;case 8:D(g);break;case 9:I(g);break;case 10:O(g);break;case 11:B(g);break;case 12:L(g);break;case 13:_(g);break;case 14:E(g);break;case 15:v(g);break;case 16:P(g);break;case 17:R(g);break;case 18:F(g);break;case 19:U(g);break;case 20:k(g);break;default:krt.throwUnhandledCaseError(f)}c++}d<c&&j();function m($){$==="<"&&V()}function x($){$==="!"?f=13:$==="/"?(f=2,p=new Cm(tc.__assign(tc.__assign({},p),{isClosing:!0}))):$==="<"?V():zc.letterRe.test($)?(f=3,p=new Cm(tc.__assign(tc.__assign({},p),{isOpening:!0}))):(f=0,p=a)}function C($){zc.whitespaceRe.test($)?(p=new Cm(tc.__assign(tc.__assign({},p),{name:X()})),f=4):$==="<"?V():$==="/"?(p=new Cm(tc.__assign(tc.__assign({},p),{name:X()})),f=12):$===">"?(p=new Cm(tc.__assign(tc.__assign({},p),{name:X()})),q()):!zc.letterRe.test($)&&!zc.digitRe.test($)&&$!==":"&&H()}function A($){$===">"?H():zc.letterRe.test($)?f=3:H()}function b($){zc.whitespaceRe.test($)||($==="/"?f=12:$===">"?q():$==="<"?V():$==="="||zc.quoteRe.test($)||zc.controlCharsRe.test($)?H():f=5)}function T($){zc.whitespaceRe.test($)?f=6:$==="/"?f=12:$==="="?f=7:$===">"?q():$==="<"?V():zc.quoteRe.test($)&&H()}function S($){zc.whitespaceRe.test($)||($==="/"?f=12:$==="="?f=7:$===">"?q():$==="<"?V():zc.quoteRe.test($)?H():f=5)}function w($){zc.whitespaceRe.test($)||($==='"'?f=8:$==="'"?f=9:/[>=`]/.test($)?H():$==="<"?V():f=10)}function D($){$==='"'&&(f=11)}function I($){$==="'"&&(f=11)}function O($){zc.whitespaceRe.test($)?f=4:$===">"?q():$==="<"&&V()}function B($){zc.whitespaceRe.test($)?f=4:$==="/"?f=12:$===">"?q():$==="<"?V():(f=4,G())}function L($){$===">"?(p=new Cm(tc.__assign(tc.__assign({},p),{isClosing:!0})),q()):f=4}function _($){e.substr(c,2)==="--"?(c+=2,p=new Cm(tc.__assign(tc.__assign({},p),{type:"comment"})),f=14):e.substr(c,7).toUpperCase()==="DOCTYPE"?(c+=7,p=new Cm(tc.__assign(tc.__assign({},p),{type:"doctype"})),f=20):H()}function E($){$==="-"?f=15:$===">"?H():f=16}function v($){$==="-"?f=18:$===">"?H():f=16}function P($){$==="-"&&(f=17)}function R($){$==="-"?f=18:f=16}function F($){$===">"?q():$==="!"?f=19:$==="-"||(f=16)}function U($){$==="-"?f=17:$===">"?q():f=16}function k($){$===">"?q():$==="<"&&V()}function H(){f=0,p=a}function V(){f=1,p=new Cm({idx:c})}function q(){var $=e.slice(d,p.idx);$&&r($,d),p.type==="comment"?o(p.idx):p.type==="doctype"?s(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),H(),d=c+1}function j(){var $=e.slice(d,c);r($,d),d=c+1}function X(){var $=p.idx+(p.isClosing?2:1);return e.slice($,c).toLowerCase()}function G(){c--}}qV.parseHtml=Urt;var Cm=function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e}()});var YV=un(Yj=>{"use strict";Object.defineProperty(Yj,"__esModule",{value:!0});var t_=lE(),Cpe=Vj(),zrt=A0(),Hrt=DV(),Grt=IV(),Wrt=RV(),jrt=BV(),qrt=NV(),Yrt=T0(),Ape=xV(),Tpe=zj(),bpe=Hj(),Epe=Wj(),Spe=jj(),wpe=qj(),Xrt=xpe(),Krt=function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.matchers=null,this.tagBuilder=null,this.urls=this.normalizeUrlsCfg(t.urls),this.email=typeof t.email=="boolean"?t.email:this.email,this.phone=typeof t.phone=="boolean"?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=typeof t.newWindow=="boolean"?t.newWindow:this.newWindow,this.stripPrefix=this.normalizeStripPrefixCfg(t.stripPrefix),this.stripTrailingSlash=typeof t.stripTrailingSlash=="boolean"?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=typeof t.decodePercentEncoding=="boolean"?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&n!=="twitter"&&n!=="instagram"&&n!=="soundcloud")throw new Error("invalid `mention` cfg - see docs");var i=this.hashtag;if(i!==!1&&i!=="twitter"&&i!=="facebook"&&i!=="instagram")throw new Error("invalid `hashtag` cfg - see docs");this.truncate=this.normalizeTruncateCfg(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.normalizeUrlsCfg=function(t){return t==null&&(t=!0),typeof t=="boolean"?{schemeMatches:t,wwwMatches:t,tldMatches:t}:{schemeMatches:typeof t.schemeMatches=="boolean"?t.schemeMatches:!0,wwwMatches:typeof t.wwwMatches=="boolean"?t.wwwMatches:!0,tldMatches:typeof t.tldMatches=="boolean"?t.tldMatches:!0}},e.prototype.normalizeStripPrefixCfg=function(t){return t==null&&(t=!0),typeof t=="boolean"?{scheme:t,www:t}:{scheme:typeof t.scheme=="boolean"?t.scheme:!0,www:typeof t.www=="boolean"?t.www:!0}},e.prototype.normalizeTruncateCfg=function(t){return typeof t=="number"?{length:t,location:"end"}:t_.defaults(t||{},{length:Number.POSITIVE_INFINITY,location:"end"})},e.prototype.parse=function(t){var n=this,i=["a","style","script"],r=0,o=[];return Xrt.parseHtml(t,{onOpenTag:function(s){i.indexOf(s)>=0&&r++},onText:function(s,a){if(r===0){var c=/( | |<|<|>|>|"|"|')/gi,u=t_.splitAndCapture(s,c),f=a;u.forEach(function(d,p){if(p%2===0){var g=n.parseText(d,f);o.push.apply(o,g)}f+=d.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(r=Math.max(r-1,0))},onComment:function(s){},onDoctype:function(s){}}),o=this.compactMatches(o),o=this.removeUnwantedMatches(o),o},e.prototype.compactMatches=function(t){t.sort(function(c,u){return c.getOffset()-u.getOffset()});for(var n=0;n<t.length-1;n++){var i=t[n],r=i.getOffset(),o=i.getMatchedText().length,s=r+o;if(n+1<t.length){if(t[n+1].getOffset()===r){var a=t[n+1].getMatchedText().length>o?n:n+1;t.splice(a,1);continue}t[n+1].getOffset()<s&&t.splice(n+1,1)}}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||t_.remove(t,function(n){return n.getType()==="hashtag"}),this.email||t_.remove(t,function(n){return n.getType()==="email"}),this.phone||t_.remove(t,function(n){return n.getType()==="phone"}),this.mention||t_.remove(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||t_.remove(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.wwwMatches||t_.remove(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="www"}),this.urls.tldMatches||t_.remove(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),t},e.prototype.parseText=function(t,n){n===void 0&&(n=0),n=n||0;for(var i=this.getMatchers(),r=[],o=0,s=i.length;o<s;o++){for(var a=i[o].parseMatches(t),c=0,u=a.length;c<u;c++)a[c].setOffset(n+a[c].getOffset());r.push.apply(r,a)}return r},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"<").replace(/>/g,">"));for(var n=this.parse(t),i=[],r=0,o=0,s=n.length;o<s;o++){var a=n[o];i.push(t.substring(r,a.getOffset())),i.push(this.createMatchReturnVal(a)),r=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(r)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof Ape.HtmlTag)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getMatchers=function(){if(this.matchers)return this.matchers;var t=this.getTagBuilder(),n=[new Epe.HashtagMatcher({tagBuilder:t,serviceName:this.hashtag}),new Tpe.EmailMatcher({tagBuilder:t}),new Spe.PhoneMatcher({tagBuilder:t}),new wpe.MentionMatcher({tagBuilder:t,serviceName:this.mention}),new bpe.UrlMatcher({tagBuilder:t,stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];return this.matchers=n},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new Cpe.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version="3.14.3",e.AnchorTagBuilder=Cpe.AnchorTagBuilder,e.HtmlTag=Ape.HtmlTag,e.matcher={Email:Tpe.EmailMatcher,Hashtag:Epe.HashtagMatcher,Matcher:Yrt.Matcher,Mention:wpe.MentionMatcher,Phone:Spe.PhoneMatcher,Url:bpe.UrlMatcher},e.match={Email:Hrt.EmailMatch,Hashtag:Grt.HashtagMatch,Match:zrt.Match,Mention:Wrt.MentionMatch,Phone:jrt.PhoneMatch,Url:qrt.UrlMatch},e}();Yj.default=Krt});var vpe=un(E0=>{"use strict";Object.defineProperty(E0,"__esModule",{value:!0});var fE=Uc();fE.__exportStar(DV(),E0);fE.__exportStar(IV(),E0);fE.__exportStar(A0(),E0);fE.__exportStar(RV(),E0);fE.__exportStar(BV(),E0);fE.__exportStar(NV(),E0)});var Dpe=un(S0=>{"use strict";Object.defineProperty(S0,"__esModule",{value:!0});var dE=Uc();dE.__exportStar(zj(),S0);dE.__exportStar(Wj(),S0);dE.__exportStar(T0(),S0);dE.__exportStar(qj(),S0);dE.__exportStar(jj(),S0);dE.__exportStar(Hj(),S0)});var Ope=un((jd,Ipe)=>{"use strict";jd=Ipe.exports=YV().default;Object.defineProperty(jd,"__esModule",{value:!0});jd.Autolinker=void 0;var hE=Uc(),Ppe=hE.__importDefault(YV());jd.Autolinker=Ppe.default;jd.default=Ppe.default;hE.__exportStar(YV(),jd);hE.__exportStar(Vj(),jd);hE.__exportStar(xV(),jd);hE.__exportStar(vpe(),jd);hE.__exportStar(Dpe(),jd)});var Xxe=un(Wr=>{var X0,zxe,KE,_z,Bl,gz,K0,$0,Hxe=new Uint8Array([0]),Da=[171,75,84,88,32,50,48,187,13,10,26,10];(X0=Wr.KTX2SupercompressionScheme||(Wr.KTX2SupercompressionScheme={}))[X0.NONE=0]="NONE",X0[X0.BASISLZ=1]="BASISLZ",X0[X0.ZSTD=2]="ZSTD",X0[X0.ZLIB=3]="ZLIB",(zxe=Wr.KTX2DescriptorType||(Wr.KTX2DescriptorType={}))[zxe.BASICFORMAT=0]="BASICFORMAT",(KE=Wr.KTX2Model||(Wr.KTX2Model={}))[KE.UNSPECIFIED=0]="UNSPECIFIED",KE[KE.ETC1S=163]="ETC1S",KE[KE.UASTC=166]="UASTC",(_z=Wr.KTX2Primaries||(Wr.KTX2Primaries={}))[_z.UNSPECIFIED=0]="UNSPECIFIED",_z[_z.SRGB=1]="SRGB",(Bl=Wr.KTX2Transfer||(Wr.KTX2Transfer={}))[Bl.UNSPECIFIED=0]="UNSPECIFIED",Bl[Bl.LINEAR=1]="LINEAR",Bl[Bl.SRGB=2]="SRGB",Bl[Bl.ITU=3]="ITU",Bl[Bl.NTSC=4]="NTSC",Bl[Bl.SLOG=5]="SLOG",Bl[Bl.SLOG2=6]="SLOG2",(gz=Wr.KTX2Flags||(Wr.KTX2Flags={}))[gz.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",gz[gz.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED",(K0=Wr.KTX2ChannelETC1S||(Wr.KTX2ChannelETC1S={}))[K0.RGB=0]="RGB",K0[K0.RRR=3]="RRR",K0[K0.GGG=4]="GGG",K0[K0.AAA=15]="AAA",($0=Wr.KTX2ChannelUASTC||(Wr.KTX2ChannelUASTC={}))[$0.RGB=0]="RGB",$0[$0.RGBA=3]="RGBA",$0[$0.RRR=4]="RRR",$0[$0.RRRG=5]="RRRG";var Gxe=function(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=Wr.KTX2SupercompressionScheme.NONE,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:Wr.KTX2DescriptorType.BASICFORMAT,versionNumber:2,descriptorBlockSize:40,colorModel:Wr.KTX2Model.UNSPECIFIED,colorPrimaries:Wr.KTX2Primaries.SRGB,transferFunction:Wr.KTX2Primaries.SRGB,flags:Wr.KTX2Flags.ALPHA_STRAIGHT,texelBlockDimension:{x:4,y:4,z:1,w:1},bytesPlane:[],samples:[]}],this.keyValue={},this.globalData=null},$1=function(){function e(n,i,r,o){this._dataView=new DataView(n.buffer,n.byteOffset+i,r),this._littleEndian=o,this._offset=0}var t=e.prototype;return t._nextUint8=function(){var n=this._dataView.getUint8(this._offset);return this._offset+=1,n},t._nextUint16=function(){var n=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,n},t._nextUint32=function(){var n=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,n},t._nextUint64=function(){var n=this._dataView.getUint32(this._offset,this._littleEndian),i=this._dataView.getUint32(this._offset+4,this._littleEndian),r=n+Math.pow(2,32)*i;return this._offset+=8,r},t._skip=function(n){return this._offset+=n,this},t._scan=function(n,i){i===void 0&&(i=0);for(var r=this._offset,o=0;this._dataView.getUint8(this._offset)!==i&&o<n;)o++,this._offset++;return o<n&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+r,o)},e}();function iX(){return(iX=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function Wxe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function jxe(e,t){var n;if(typeof Symbol>"u"||e[Symbol.iterator]==null){if(Array.isArray(e)||(n=function(r,o){if(r){if(typeof r=="string")return Wxe(r,void 0);var s=Object.prototype.toString.call(r).slice(8,-1);return s==="Object"&&r.constructor&&(s=r.constructor.name),s==="Map"||s==="Set"?Array.from(r):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?Wxe(r,void 0):void 0}}(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return(n=e[Symbol.iterator]()).next.bind(n)}function qxe(e){return typeof TextEncoder<"u"?new TextEncoder().encode(e):Buffer.from(e)}function Yxe(e){return typeof TextDecoder<"u"?new TextDecoder().decode(e):Buffer.from(e).toString("utf8")}function yz(e){for(var t,n=0,i=jxe(e);!(t=i()).done;)n+=t.value.byteLength;for(var r,o=new Uint8Array(n),s=0,a=jxe(e);!(r=a()).done;){var c=r.value;o.set(new Uint8Array(c),s),s+=c.byteLength}return o}var nxt={keepWriter:!1};Wr.KTX2Container=Gxe,Wr.read=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,Da.length);if(t[0]!==Da[0]||t[1]!==Da[1]||t[2]!==Da[2]||t[3]!==Da[3]||t[4]!==Da[4]||t[5]!==Da[5]||t[6]!==Da[6]||t[7]!==Da[7]||t[8]!==Da[8]||t[9]!==Da[9]||t[10]!==Da[10]||t[11]!==Da[11])throw new Error("Missing KTX 2.0 identifier.");var n=new Gxe,i=17*Uint32Array.BYTES_PER_ELEMENT,r=new $1(e,Da.length,i,!0);n.vkFormat=r._nextUint32(),n.typeSize=r._nextUint32(),n.pixelWidth=r._nextUint32(),n.pixelHeight=r._nextUint32(),n.pixelDepth=r._nextUint32(),n.layerCount=r._nextUint32(),n.faceCount=r._nextUint32();var o=r._nextUint32();n.supercompressionScheme=r._nextUint32();for(var s=r._nextUint32(),a=r._nextUint32(),c=r._nextUint32(),u=r._nextUint32(),f=r._nextUint64(),d=r._nextUint64(),p=new $1(e,Da.length+i,3*o*8,!0),g=0;g<o;g++)n.levels.push({levelData:new Uint8Array(e.buffer,e.byteOffset+p._nextUint64(),p._nextUint64()),uncompressedByteLength:p._nextUint64()});for(var m=new $1(e,s,a,!0),x={vendorId:m._skip(4)._nextUint16(),descriptorType:m._nextUint16(),versionNumber:m._nextUint16(),descriptorBlockSize:m._nextUint16(),colorModel:m._nextUint8(),colorPrimaries:m._nextUint8(),transferFunction:m._nextUint8(),flags:m._nextUint8(),texelBlockDimension:{x:m._nextUint8()+1,y:m._nextUint8()+1,z:m._nextUint8()+1,w:m._nextUint8()+1},bytesPlane:[m._nextUint8(),m._nextUint8(),m._nextUint8(),m._nextUint8(),m._nextUint8(),m._nextUint8(),m._nextUint8(),m._nextUint8()],samples:[]},C=(x.descriptorBlockSize/4-6)/4,A=0;A<C;A++)x.samples[A]={bitOffset:m._nextUint16(),bitLength:m._nextUint8(),channelID:m._nextUint8(),samplePosition:[m._nextUint8(),m._nextUint8(),m._nextUint8(),m._nextUint8()],sampleLower:m._nextUint32(),sampleUpper:m._nextUint32()};n.dataFormatDescriptor.length=0,n.dataFormatDescriptor.push(x);for(var b=new $1(e,c,u,!0);b._offset<u;){var T=b._nextUint32(),S=b._scan(T),w=Yxe(S),D=b._scan(T-S.byteLength);n.keyValue[w]=w.match(/^ktx/i)?Yxe(D):D,b._offset%4&&b._skip(4-b._offset%4)}if(d<=0)return n;for(var I=new $1(e,f,d,!0),O=I._nextUint16(),B=I._nextUint16(),L=I._nextUint32(),_=I._nextUint32(),E=I._nextUint32(),v=I._nextUint32(),P=[],R=0;R<o;R++)P.push({imageFlags:I._nextUint32(),rgbSliceByteOffset:I._nextUint32(),rgbSliceByteLength:I._nextUint32(),alphaSliceByteOffset:I._nextUint32(),alphaSliceByteLength:I._nextUint32()});var F=f+I._offset,U=F+L,k=U+_,H=k+E,V=new Uint8Array(e.buffer,e.byteOffset+F,L),q=new Uint8Array(e.buffer,e.byteOffset+U,_),j=new Uint8Array(e.buffer,e.byteOffset+k,E),X=new Uint8Array(e.buffer,e.byteOffset+H,v);return n.globalData={endpointCount:O,selectorCount:B,imageDescs:P,endpointsData:V,selectorsData:q,tablesData:j,extendedData:X},n},Wr.write=function(e,t){t===void 0&&(t={}),t=iX({},nxt,t);var n=new ArrayBuffer(0);if(e.globalData){var i=new ArrayBuffer(20+5*e.globalData.imageDescs.length*4),r=new DataView(i);r.setUint16(0,e.globalData.endpointCount,!0),r.setUint16(2,e.globalData.selectorCount,!0),r.setUint32(4,e.globalData.endpointsData.byteLength,!0),r.setUint32(8,e.globalData.selectorsData.byteLength,!0),r.setUint32(12,e.globalData.tablesData.byteLength,!0),r.setUint32(16,e.globalData.extendedData.byteLength,!0);for(var o=0;o<e.globalData.imageDescs.length;o++){var s=e.globalData.imageDescs[o];r.setUint32(20+5*o*4+0,s.imageFlags,!0),r.setUint32(20+5*o*4+4,s.rgbSliceByteOffset,!0),r.setUint32(20+5*o*4+8,s.rgbSliceByteLength,!0),r.setUint32(20+5*o*4+12,s.alphaSliceByteOffset,!0),r.setUint32(20+5*o*4+16,s.alphaSliceByteLength,!0)}n=yz([i,e.globalData.endpointsData,e.globalData.selectorsData,e.globalData.tablesData,e.globalData.extendedData])}var a=[],c=e.keyValue;for(var u in t.keepWriter||(c=iX({},e.keyValue,{KTXwriter:"KTX-Parse v0.2.1"})),c){var f=c[u],d=qxe(u),p=typeof f=="string"?qxe(f):f,g=d.byteLength+1+p.byteLength+1,m=g%4?4-g%4:0;a.push(yz([new Uint32Array([g]),d,Hxe,p,Hxe,new Uint8Array(m).fill(0)]))}var x=yz(a),C=new ArrayBuffer(44),A=new DataView(C);if(e.dataFormatDescriptor.length!==1||e.dataFormatDescriptor[0].descriptorType!==Wr.KTX2DescriptorType.BASICFORMAT)throw new Error("Only BASICFORMAT Data Format Descriptor output supported.");var b=e.dataFormatDescriptor[0];A.setUint32(0,44,!0),A.setUint16(4,b.vendorId,!0),A.setUint16(6,b.descriptorType,!0),A.setUint16(8,b.versionNumber,!0),A.setUint16(10,b.descriptorBlockSize,!0),A.setUint8(12,b.colorModel),A.setUint8(13,b.colorPrimaries),A.setUint8(14,b.transferFunction),A.setUint8(15,b.flags),A.setUint8(16,b.texelBlockDimension.x-1),A.setUint8(17,b.texelBlockDimension.y-1),A.setUint8(18,b.texelBlockDimension.z-1),A.setUint8(19,b.texelBlockDimension.w-1);for(var T=0;T<8;T++)A.setUint8(20+T,b.bytesPlane[T]);for(var S=0;S<b.samples.length;S++){var w=b.samples[S],D=28+16*S;A.setUint16(D+0,w.bitOffset,!0),A.setUint8(D+2,w.bitLength),A.setUint8(D+3,w.channelID),A.setUint8(D+4,w.samplePosition[0]),A.setUint8(D+5,w.samplePosition[1]),A.setUint8(D+6,w.samplePosition[2]),A.setUint8(D+7,w.samplePosition[3]),A.setUint32(D+8,w.sampleLower,!0),A.setUint32(D+12,w.sampleUpper,!0)}var I=Da.length+68+3*e.levels.length*8,O=I+C.byteLength,B=O+x.byteLength;B%8&&(B+=8-B%8);for(var L=[],_=new DataView(new ArrayBuffer(3*e.levels.length*8)),E=B+n.byteLength,v=0;v<e.levels.length;v++){var P=e.levels[v];L.push(P.levelData),_.setBigUint64(24*v+0,BigInt(E),!0),_.setBigUint64(24*v+8,BigInt(P.levelData.byteLength),!0),_.setBigUint64(24*v+16,BigInt(P.uncompressedByteLength),!0),E+=P.levelData.byteLength}var R=new ArrayBuffer(68),F=new DataView(R);return F.setUint32(0,e.vkFormat,!0),F.setUint32(4,e.typeSize,!0),F.setUint32(8,e.pixelWidth,!0),F.setUint32(12,e.pixelHeight,!0),F.setUint32(16,e.pixelDepth,!0),F.setUint32(20,e.layerCount,!0),F.setUint32(24,e.faceCount,!0),F.setUint32(28,e.levels.length,!0),F.setUint32(32,e.supercompressionScheme,!0),F.setUint32(36,I,!0),F.setUint32(40,C.byteLength,!0),F.setUint32(44,O,!0),F.setUint32(48,x.byteLength,!0),F.setBigUint64(52,BigInt(B),!0),F.setBigUint64(60,BigInt(n.byteLength),!0),new Uint8Array(yz([new Uint8Array(Da).buffer,R,_.buffer,C,x,new ArrayBuffer(B-(O+x.byteLength)),n].concat(L)))}});var Kxe=un((JWi,xz)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var r={};r.defaultNoDataValue=-34027999387901484e22,r.decode=function(f,d){d=d||{};var p=d.encodedMaskData||d.encodedMaskData===null,g=c(f,d.inputOffset||0,p),m=d.noDataValue!==null?d.noDataValue:r.defaultNoDataValue,x=o(g,d.pixelType||Float32Array,d.encodedMaskData,m,d.returnMask),C={width:g.width,height:g.height,pixelData:x.resultPixels,minValue:x.minValue,maxValue:g.pixels.maxValue,noDataValue:m};return x.resultMask&&(C.maskData=x.resultMask),d.returnEncodedMask&&g.mask&&(C.encodedMaskData=g.mask.bitset?g.mask.bitset:null),d.returnFileInfo&&(C.fileInfo=s(g),d.computeUsedBitDepths&&(C.fileInfo.bitDepths=a(g))),C};var o=function(f,d,p,g,m){var x=0,C=f.pixels.numBlocksX,A=f.pixels.numBlocksY,b=Math.floor(f.width/C),T=Math.floor(f.height/A),S=2*f.maxZError,w=Number.MAX_VALUE,D;p=p||(f.mask?f.mask.bitset:null);var I,O;I=new d(f.width*f.height),m&&p&&(O=new Uint8Array(f.width*f.height));for(var B=new Float32Array(b*T),L,_,E=0;E<=A;E++){var v=E!==A?T:f.height%A;if(v!==0)for(var P=0;P<=C;P++){var R=P!==C?b:f.width%C;if(R!==0){var F=E*f.width*T+P*b,U=f.width-R,k=f.pixels.blocks[x],H,V,q;k.encoding<2?(k.encoding===0?H=k.rawData:(u(k.stuffedData,k.bitsPerPixel,k.numValidPixels,k.offset,S,B,f.pixels.maxValue),H=B),V=0):k.encoding===2?q=0:q=k.offset;var j;if(p)for(_=0;_<v;_++){for(F&7&&(j=p[F>>3],j<<=F&7),L=0;L<R;L++)F&7||(j=p[F>>3]),j&128?(O&&(O[F]=1),D=k.encoding<2?H[V++]:q,w=w>D?D:w,I[F++]=D):(O&&(O[F]=0),I[F++]=g),j<<=1;F+=U}else if(k.encoding<2)for(_=0;_<v;_++){for(L=0;L<R;L++)D=H[V++],w=w>D?D:w,I[F++]=D;F+=U}else for(w=w>q?q:w,_=0;_<v;_++){for(L=0;L<R;L++)I[F++]=q;F+=U}if(k.encoding===1&&V!==k.numValidPixels)throw"Block and Mask do not match";x++}}}return{resultPixels:I,resultMask:O,minValue:w}},s=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},a=function(f){for(var d=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},g=0;g<d;g++){var m=f.pixels.blocks[g];m.encoding===0?p.float32=!0:m.encoding===1?p[m.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(f,d,p){var g={},m=new Uint8Array(f,d,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,m),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;d+=10;var x=new DataView(f,d,24);if(g.fileVersion=x.getInt32(0,!0),g.imageType=x.getInt32(4,!0),g.height=x.getUint32(8,!0),g.width=x.getUint32(12,!0),g.maxZError=x.getFloat64(16,!0),d+=24,!p)if(x=new DataView(f,d,16),g.mask={},g.mask.numBlocksY=x.getUint32(0,!0),g.mask.numBlocksX=x.getUint32(4,!0),g.mask.numBytes=x.getUint32(8,!0),g.mask.maxValue=x.getFloat32(12,!0),d+=16,g.mask.numBytes>0){var C=new Uint8Array(Math.ceil(g.width*g.height/8));x=new DataView(f,d,g.mask.numBytes);var A=x.getInt16(0,!0),b=2,T=0;do{if(A>0)for(;A--;)C[T++]=x.getUint8(b++);else{var S=x.getUint8(b++);for(A=-A;A--;)C[T++]=S}A=x.getInt16(b,!0),b+=2}while(b<g.mask.numBytes);if(A!==-32768||T<C.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=C,d+=g.mask.numBytes}else(g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue)===0&&(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));x=new DataView(f,d,16),g.pixels={},g.pixels.numBlocksY=x.getUint32(0,!0),g.pixels.numBlocksX=x.getUint32(4,!0),g.pixels.numBytes=x.getUint32(8,!0),g.pixels.maxValue=x.getFloat32(12,!0),d+=16;var w=g.pixels.numBlocksX,D=g.pixels.numBlocksY,I=w+(g.width%w>0?1:0),O=D+(g.height%D>0?1:0);g.pixels.blocks=new Array(I*O);for(var B=0,L=0;L<O;L++)for(var _=0;_<I;_++){var E=0,v=f.byteLength-d;x=new DataView(f,d,Math.min(10,v));var P={};g.pixels.blocks[B++]=P;var R=x.getUint8(0);if(E++,P.encoding=R&63,P.encoding>3)throw"Invalid block encoding ("+P.encoding+")";if(P.encoding===2){d++;continue}if(R!==0&&R!==2){if(R>>=6,P.offsetType=R,R===2)P.offset=x.getInt8(1),E++;else if(R===1)P.offset=x.getInt16(1,!0),E+=2;else if(R===0)P.offset=x.getFloat32(1,!0),E+=4;else throw"Invalid block offset type";if(P.encoding===1)if(R=x.getUint8(E),E++,P.bitsPerPixel=R&63,R>>=6,P.numValidPixelsType=R,R===2)P.numValidPixels=x.getUint8(E),E++;else if(R===1)P.numValidPixels=x.getUint16(E,!0),E+=2;else if(R===0)P.numValidPixels=x.getUint32(E,!0),E+=4;else throw"Invalid valid pixel count type"}if(d+=E,P.encoding!==3){var F,U;if(P.encoding===0){var k=(g.pixels.numBytes-1)/4;if(k!==Math.floor(k))throw"uncompressed block has invalid length";F=new ArrayBuffer(k*4),U=new Uint8Array(F),U.set(new Uint8Array(f,d,k*4));var H=new Float32Array(F);P.rawData=H,d+=k*4}else if(P.encoding===1){var V=Math.ceil(P.numValidPixels*P.bitsPerPixel/8),q=Math.ceil(V/4);F=new ArrayBuffer(q*4),U=new Uint8Array(F),U.set(new Uint8Array(f,d,V)),P.stuffedData=new Uint32Array(F),d+=V}}}return g.eofOffset=d,g},u=function(f,d,p,g,m,x,C){var A=(1<<d)-1,b=0,T,S=0,w,D,I=Math.ceil((C-g)/m),O=f.length*4-Math.ceil(d*p/8);for(f[f.length-1]<<=8*O,T=0;T<p;T++){if(S===0&&(D=f[b++],S=32),S>=d)w=D>>>S-d&A,S-=d;else{var B=d-S;w=(D&A)<<B&A,D=f[b++],S=32-B,w+=D>>>S}x[T]=w<I?g+w*m:C}return x};return r}(),t=function(){"use strict";var r={unstuff:function(c,u,f,d,p,g,m,x){var C=(1<<f)-1,A=0,b,T=0,S,w,D,I,O=c.length*4-Math.ceil(f*d/8);if(c[c.length-1]<<=8*O,p)for(b=0;b<d;b++)T===0&&(w=c[A++],T=32),T>=f?(S=w>>>T-f&C,T-=f):(D=f-T,S=(w&C)<<D&C,w=c[A++],T=32-D,S+=w>>>T),u[b]=p[S];else for(I=Math.ceil((x-g)/m),b=0;b<d;b++)T===0&&(w=c[A++],T=32),T>=f?(S=w>>>T-f&C,T-=f):(D=f-T,S=(w&C)<<D&C,w=c[A++],T=32-D,S+=w>>>T),u[b]=S<I?g+S*m:x},unstuffLUT:function(c,u,f,d,p,g){var m=(1<<u)-1,x=0,C=0,A=0,b=0,T=0,S,w=[],D=c.length*4-Math.ceil(u*f/8);c[c.length-1]<<=8*D;var I=Math.ceil((g-d)/p);for(C=0;C<f;C++)b===0&&(S=c[x++],b=32),b>=u?(T=S>>>b-u&m,b-=u):(A=u-b,T=(S&m)<<A&m,S=c[x++],b=32-A,T+=S>>>b),w[C]=T<I?d+T*p:g;return w.unshift(d),w},unstuff2:function(c,u,f,d,p,g,m,x){var C=(1<<f)-1,A=0,b,T=0,S=0,w,D,I;if(p)for(b=0;b<d;b++)T===0&&(D=c[A++],T=32,S=0),T>=f?(w=D>>>S&C,T-=f,S+=f):(I=f-T,w=D>>>S&C,D=c[A++],T=32-I,w|=(D&(1<<I)-1)<<f-I,S=I),u[b]=p[w];else{var O=Math.ceil((x-g)/m);for(b=0;b<d;b++)T===0&&(D=c[A++],T=32,S=0),T>=f?(w=D>>>S&C,T-=f,S+=f):(I=f-T,w=D>>>S&C,D=c[A++],T=32-I,w|=(D&(1<<I)-1)<<f-I,S=I),u[b]=w<O?g+w*m:x}return u},unstuffLUT2:function(c,u,f,d,p,g){var m=(1<<u)-1,x=0,C=0,A=0,b=0,T=0,S=0,w,D=[],I=Math.ceil((g-d)/p);for(C=0;C<f;C++)b===0&&(w=c[x++],b=32,S=0),b>=u?(T=w>>>S&m,b-=u,S+=u):(A=u-b,T=w>>>S&m,w=c[x++],b=32-A,T|=(w&(1<<A)-1)<<u-A,S=A),D[C]=T<I?d+T*p:g;return D.unshift(d),D},originalUnstuff:function(c,u,f,d){var p=(1<<f)-1,g=0,m,x=0,C,A,b,T=c.length*4-Math.ceil(f*d/8);for(c[c.length-1]<<=8*T,m=0;m<d;m++)x===0&&(A=c[g++],x=32),x>=f?(C=A>>>x-f&p,x-=f):(b=f-x,C=(A&p)<<b&p,A=c[g++],x=32-b,C+=A>>>x),u[m]=C;return u},originalUnstuff2:function(c,u,f,d){var p=(1<<f)-1,g=0,m,x=0,C=0,A,b,T;for(m=0;m<d;m++)x===0&&(b=c[g++],x=32,C=0),x>=f?(A=b>>>C&p,x-=f,C+=f):(T=f-x,A=b>>>C&p,b=c[g++],x=32-T,A|=(b&(1<<T)-1)<<f-T,C=T),u[m]=A;return u}},o={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var u=65535,f=65535,d=c.length,p=Math.floor(d/2),g=0;p;){var m=p>=359?359:p;p-=m;do u+=c[g++]<<8,f+=u+=c[g++];while(--m);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return d&1&&(f+=u+=c[g]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,d=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,d),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var g=new DataView(c,f,8),m=g.getInt32(0,!0);p.fileVersion=m,f+=4,m>=3&&(p.checksum=g.getUint32(4,!0),f+=4),g=new DataView(c,f,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),f+=8,m>=4?(p.numDims=g.getUint32(8,!0),f+=4):p.numDims=1,g=new DataView(c,f,40),p.numValidPixel=g.getUint32(0,!0),p.microBlockSize=g.getInt32(4,!0),p.blobSize=g.getInt32(8,!0),p.imageType=g.getInt32(12,!0),p.maxZError=g.getFloat64(16,!0),p.zMin=g.getFloat64(24,!0),p.zMax=g.getFloat64(32,!0),f+=40,u.headerInfo=p,u.ptr=f;var x,C;if(m>=3&&(C=m>=4?52:48,x=this.computeChecksumFletcher32(new Uint8Array(c,f-C,p.blobSize-14)),x!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,d=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(c,u.ptr,d,p),m=this.readSubArray(c,u.ptr+p,d,p);u.ptr+=2*p;var x,C=!0;for(x=0;x<f.numDims;x++)if(g[x]!==m[x]){C=!1;break}return f.minValues=g,f.maxValues=m,C},readSubArray:function(c,u,f,d){var p;if(f===Uint8Array)p=new Uint8Array(c,u,d);else{var g=new ArrayBuffer(d),m=new Uint8Array(g);m.set(new Uint8Array(c,u,d)),p=new f(g)}return p},readMask:function(c,u){var f=u.ptr,d=u.headerInfo,p=d.width*d.height,g=d.numValidPixel,m=new DataView(c,f,4),x={};if(x.numBytes=m.getUint32(0,!0),f+=4,(g===0||p===g)&&x.numBytes!==0)throw"invalid mask";var C,A;if(g===0)C=new Uint8Array(Math.ceil(p/8)),x.bitset=C,A=new Uint8Array(p),u.pixels.resultMask=A,f+=x.numBytes;else if(x.numBytes>0){C=new Uint8Array(Math.ceil(p/8)),m=new DataView(c,f,x.numBytes);var b=m.getInt16(0,!0),T=2,S=0,w=0;do{if(b>0)for(;b--;)C[S++]=m.getUint8(T++);else for(w=m.getUint8(T++),b=-b;b--;)C[S++]=w;b=m.getInt16(T,!0),T+=2}while(T<x.numBytes);if(b!==-32768||S<C.length)throw"Unexpected end of mask RLE encoding";A=new Uint8Array(p);var D=0,I=0;for(I=0;I<p;I++)I&7?(D=C[I>>3],D<<=I&7):D=C[I>>3],D&128&&(A[I]=1);u.pixels.resultMask=A,x.bitset=C,f+=x.numBytes}return u.ptr=f,u.mask=x,!0},readDataOneSweep:function(c,u,f){var d=u.ptr,p=u.headerInfo,g=p.numDims,m=p.width*p.height,x=p.imageType,C=p.numValidPixel*o.getDataTypeSize(x)*g,A,b=u.pixels.resultMask;if(f===Uint8Array)A=new Uint8Array(c,d,C);else{var T=new ArrayBuffer(C),S=new Uint8Array(T);S.set(new Uint8Array(c,d,C)),A=new f(T)}if(A.length===m*g)u.pixels.resultPixels=A;else{u.pixels.resultPixels=new f(m*g);var w=0,D=0,I=0,O=0;if(g>1)for(I=0;I<g;I++)for(O=I*m,D=0;D<m;D++)b[D]&&(u.pixels.resultPixels[O+D]=A[w++]);else for(D=0;D<m;D++)b[D]&&(u.pixels.resultPixels[D]=A[w++])}return d+=C,u.ptr=d,!0},readHuffmanTree:function(c,u){var f=this.HUFFMAN_LUT_BITS_MAX,d=new DataView(c,u.ptr,16);u.ptr+=16;var p=d.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var g=d.getInt32(4,!0),m=d.getInt32(8,!0),x=d.getInt32(12,!0);if(m>=x)return!1;var C=new Uint32Array(x-m);o.decodeBits(c,u,C);var A=[],b,T,S,w;for(b=m;b<x;b++)T=b-(b<g?0:g),A[T]={first:C[b-m],second:null};var D=c.byteLength-u.ptr,I=Math.ceil(D/4),O=new ArrayBuffer(I*4),B=new Uint8Array(O);B.set(new Uint8Array(c,u.ptr,D));var L=new Uint32Array(O),_=0,E,v=0;for(E=L[0],b=m;b<x;b++)T=b-(b<g?0:g),w=A[T].first,w>0&&(A[T].second=E<<_>>>32-w,32-_>=w?(_+=w,_===32&&(_=0,v++,E=L[v])):(_+=w-32,v++,E=L[v],A[T].second|=E>>>32-_));var P=0,R=0,F=new s;for(b=0;b<A.length;b++)A[b]!==void 0&&(P=Math.max(P,A[b].first));P>=f?R=f:R=P,P>=30&&console.log("WARning, large NUM LUT BITS IS "+P);var U=[],k,H,V,q,j,X;for(b=m;b<x;b++)if(T=b-(b<g?0:g),w=A[T].first,w>0)if(k=[w,T],w<=R)for(H=A[T].second<<R-w,V=1<<R-w,S=0;S<V;S++)U[H|S]=k;else for(H=A[T].second,X=F,q=w-1;q>=0;q--)j=H>>>q&1,j?(X.right||(X.right=new s),X=X.right):(X.left||(X.left=new s),X=X.left),q===0&&!X.val&&(X.val=k[1]);return{decodeLut:U,numBitsLUTQick:R,numBitsLUT:P,tree:F,stuffedData:L,srcPtr:v,bitPos:_}},readHuffman:function(c,u,f){var d=u.headerInfo,p=d.numDims,g=u.headerInfo.height,m=u.headerInfo.width,x=m*g,C=this.readHuffmanTree(c,u),A=C.decodeLut,b=C.tree,T=C.stuffedData,S=C.srcPtr,w=C.bitPos,D=C.numBitsLUTQick,I=C.numBitsLUT,O=u.headerInfo.imageType===0?128:0,B,L,_,E=u.pixels.resultMask,v,P,R,F,U,k,H,V=0;w>0&&(S++,w=0);var q=T[S],j=u.encodeMode===1,X=new f(x*p),G=X,$;for($=0;$<d.numDims;$++){if(p>1&&(G=new f(X.buffer,x*$,x),V=0),u.headerInfo.numValidPixel===m*g)for(k=0,F=0;F<g;F++)for(U=0;U<m;U++,k++){if(L=0,v=q<<w>>>32-D,P=v,32-w<D&&(v|=T[S+1]>>>64-w-D,P=v),A[P])L=A[P][1],w+=A[P][0];else for(v=q<<w>>>32-I,P=v,32-w<I&&(v|=T[S+1]>>>64-w-I,P=v),B=b,H=0;H<I;H++)if(R=v>>>I-H-1&1,B=R?B.right:B.left,!(B.left||B.right)){L=B.val,w=w+H+1;break}w>=32&&(w-=32,S++,q=T[S]),_=L-O,j?(U>0?_+=V:F>0?_+=G[k-m]:_+=V,_&=255,G[k]=_,V=_):G[k]=_}else for(k=0,F=0;F<g;F++)for(U=0;U<m;U++,k++)if(E[k]){if(L=0,v=q<<w>>>32-D,P=v,32-w<D&&(v|=T[S+1]>>>64-w-D,P=v),A[P])L=A[P][1],w+=A[P][0];else for(v=q<<w>>>32-I,P=v,32-w<I&&(v|=T[S+1]>>>64-w-I,P=v),B=b,H=0;H<I;H++)if(R=v>>>I-H-1&1,B=R?B.right:B.left,!(B.left||B.right)){L=B.val,w=w+H+1;break}w>=32&&(w-=32,S++,q=T[S]),_=L-O,j?(U>0&&E[k-1]?_+=V:F>0&&E[k-m]?_+=G[k-m]:_+=V,_&=255,G[k]=_,V=_):G[k]=_}u.ptr=u.ptr+(S+1)*4+(w>0?4:0)}u.pixels.resultPixels=X},decodeBits:function(c,u,f,d,p){{var g=u.headerInfo,m=g.fileVersion,x=0,C=new DataView(c,u.ptr,5),A=C.getUint8(0);x++;var b=A>>6,T=b===0?4:3-b,S=(A&32)>0,w=A&31,D=0;if(T===1)D=C.getUint8(x),x++;else if(T===2)D=C.getUint16(x,!0),x+=2;else if(T===4)D=C.getUint32(x,!0),x+=4;else throw"Invalid valid pixel count type";var I=2*g.maxZError,O,B,L,_,E,v,P,R,F,U,k=g.numDims>1?g.maxValues[p]:g.zMax;if(S){for(u.counter.lut++,R=C.getUint8(x),F=w,x++,_=Math.ceil((R-1)*w/8),E=Math.ceil(_/4),B=new ArrayBuffer(E*4),L=new Uint8Array(B),u.ptr+=x,L.set(new Uint8Array(c,u.ptr,_)),P=new Uint32Array(B),u.ptr+=_,U=0;R-1>>>U;)U++;_=Math.ceil(D*U/8),E=Math.ceil(_/4),B=new ArrayBuffer(E*4),L=new Uint8Array(B),L.set(new Uint8Array(c,u.ptr,_)),O=new Uint32Array(B),u.ptr+=_,m>=3?v=r.unstuffLUT2(P,w,R-1,d,I,k):v=r.unstuffLUT(P,w,R-1,d,I,k),m>=3?r.unstuff2(O,f,U,D,v):r.unstuff(O,f,U,D,v)}else u.counter.bitstuffer++,U=w,u.ptr+=x,U>0&&(_=Math.ceil(D*U/8),E=Math.ceil(_/4),B=new ArrayBuffer(E*4),L=new Uint8Array(B),L.set(new Uint8Array(c,u.ptr,_)),O=new Uint32Array(B),u.ptr+=_,m>=3?d==null?r.originalUnstuff2(O,f,U,D):r.unstuff2(O,f,U,D,!1,d,I,k):d==null?r.originalUnstuff(O,f,U,D):r.unstuff(O,f,U,D,!1,d,I,k))}},readTiles:function(c,u,f){var d=u.headerInfo,p=d.width,g=d.height,m=d.microBlockSize,x=d.imageType,C=o.getDataTypeSize(x),A=Math.ceil(p/m),b=Math.ceil(g/m);u.pixels.numBlocksY=b,u.pixels.numBlocksX=A,u.pixels.ptr=0;var T=0,S=0,w=0,D=0,I=0,O=0,B=0,L=0,_=0,E=0,v=0,P=0,R=0,F=0,U=0,k=0,H,V,q,j,X,G,$=new f(m*m),J=g%m||m,ce=p%m||m,de,ie,ae=d.numDims,_e,be=u.pixels.resultMask,Te=u.pixels.resultPixels;for(w=0;w<b;w++)for(I=w!==b-1?m:J,D=0;D<A;D++)for(O=D!==A-1?m:ce,v=w*p*m+D*m,P=p-O,_e=0;_e<ae;_e++){if(ae>1&&(Te=new f(u.pixels.resultPixels.buffer,p*g*_e*C,p*g)),B=c.byteLength-u.ptr,H=new DataView(c,u.ptr,Math.min(10,B)),V={},k=0,L=H.getUint8(0),k++,_=L>>6&255,E=L>>2&15,E!==(D*m>>3&15))throw"integrity issue";if(G=L&3,G>3)throw u.ptr+=k,"Invalid block encoding ("+G+")";if(G===2){u.counter.constant++,u.ptr+=k;continue}else if(G===0){if(u.counter.uncompressed++,u.ptr+=k,R=I*O*C,F=c.byteLength-u.ptr,R=R<F?R:F,q=new ArrayBuffer(R%C===0?R:R+C-R%C),j=new Uint8Array(q),j.set(new Uint8Array(c,u.ptr,R)),X=new f(q),U=0,be)for(T=0;T<I;T++){for(S=0;S<O;S++)be[v]&&(Te[v]=X[U++]),v++;v+=P}else for(T=0;T<I;T++){for(S=0;S<O;S++)Te[v++]=X[U++];v+=P}u.ptr+=U*C}else if(de=o.getDataTypeUsed(x,_),ie=o.getOnePixel(V,k,de,H),k+=o.getDataTypeSize(de),G===3)if(u.ptr+=k,u.counter.constantoffset++,be)for(T=0;T<I;T++){for(S=0;S<O;S++)be[v]&&(Te[v]=ie),v++;v+=P}else for(T=0;T<I;T++){for(S=0;S<O;S++)Te[v++]=ie;v+=P}else if(u.ptr+=k,o.decodeBits(c,u,$,ie,_e),k=0,be)for(T=0;T<I;T++){for(S=0;S<O;S++)be[v]&&(Te[v]=$[k++]),v++;v+=P}else for(T=0;T<I;T++){for(S=0;S<O;S++)Te[v++]=$[k++];v+=P}}},formatFileInfo:function(c){return{fileIdentifierString:c.headerInfo.fileIdentifierString,fileVersion:c.headerInfo.fileVersion,imageType:c.headerInfo.imageType,height:c.headerInfo.height,width:c.headerInfo.width,numValidPixel:c.headerInfo.numValidPixel,microBlockSize:c.headerInfo.microBlockSize,blobSize:c.headerInfo.blobSize,maxZError:c.headerInfo.maxZError,pixelType:o.getPixelType(c.headerInfo.imageType),eofOffset:c.eofOffset,mask:c.mask?{numBytes:c.mask.numBytes}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,maxValue:c.headerInfo.zMax,minValue:c.headerInfo.zMin,noDataValue:c.noDataValue}}},constructConstantSurface:function(c){var u=c.headerInfo.zMax,f=c.headerInfo.numDims,d=c.headerInfo.height*c.headerInfo.width,p=d*f,g=0,m=0,x=0,C=c.pixels.resultMask;if(C)if(f>1)for(g=0;g<f;g++)for(x=g*d,m=0;m<d;m++)C[m]&&(c.pixels.resultPixels[x+m]=u);else for(m=0;m<d;m++)C[m]&&(c.pixels.resultPixels[m]=u);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(u);else for(m=0;m<p;m++)c.pixels.resultPixels[m]=u},getDataTypeArray:function(c){var u;switch(c){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(c){var u;switch(c){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(c,u){if(u==null)return!1;var f;switch(c){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,d){var p=0;switch(f){case 0:p=d.getInt8(u);break;case 1:p=d.getUint8(u);break;case 2:p=d.getInt16(u,!0);break;case 3:p=d.getUint16(u,!0);break;case 4:p=d.getInt32(u,!0);break;case 5:p=d.getUInt32(u,!0);break;case 6:p=d.getFloat32(u,!0);break;case 7:p=d.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,u,f){this.val=c,this.left=u,this.right=f},a={decode:function(c,u){u=u||{};var f=u.noDataValue,d=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!o.readHeaderInfo(c,p)){var g=p.headerInfo,m=g.fileVersion,x=o.getDataTypeArray(g.imageType);o.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var C=g.width*g.height;if(p.pixels.resultPixels=new x(C*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)o.constructConstantSurface(p);else if(m>=4&&o.checkMinMaxRanges(c,p))o.constructConstantSurface(p);else{var A=new DataView(c,p.ptr,2),b=A.getUint8(0);if(p.ptr++,b)o.readDataOneSweep(c,p,x);else if(m>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var T=A.getUint8(1);if(p.ptr++,p.encodeMode=T,T>2||m<4&&T>1)throw"Invalid Huffman flag "+T;T?o.readHuffman(c,p,x):o.readTiles(c,p,x)}else o.readTiles(c,p,x)}p.eofOffset=p.ptr;var S;u.inputOffset?(S=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(S)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(S=p.headerInfo.blobSize-p.ptr,Math.abs(S)>=1&&(p.eofOffset=p.headerInfo.blobSize));var w={width:g.width,height:g.height,pixelData:p.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&o.isValidPixelValue(g.imageType,f)){var D=p.pixels.resultMask;for(d=0;d<C;d++)D[d]||(w.pixelData[d]=f);w.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(w.fileInfo=o.formatFileInfo(p)),w}},getBandCount:function(c){var u=0,f=0,d={};for(d.ptr=0,d.pixels={};f<c.byteLength-58;)o.readHeaderInfo(c,d),f+=d.headerInfo.blobSize,u++,d.ptr=f;return u}};return a}(),n=function(){var r=new ArrayBuffer(4),o=new Uint8Array(r),s=new Uint32Array(r);return s[0]=1,o[0]===1}(),i={decode:function(r,o){if(!n)throw"Big endian system is not supported.";o=o||{};var s=o.inputOffset||0,a=new Uint8Array(r,s,10),c=String.fromCharCode.apply(null,a),u,f;if(c.trim()==="CntZImage")u=e,f=1;else if(c.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+c;for(var d=0,p=r.byteLength-10,g,m=[],x,C,A={width:0,height:0,pixels:[],pixelType:o.pixelType,mask:null,statistics:[]};s<p;){var b=u.decode(r,{inputOffset:s,encodedMaskData:g,maskData:C,returnMask:d===0,returnEncodedMask:d===0,returnFileInfo:!0,pixelType:o.pixelType||null,noDataValue:o.noDataValue||null});s=b.fileInfo.eofOffset,d===0&&(g=b.encodedMaskData,C=b.maskData,A.width=b.width,A.height=b.height,A.dimCount=b.dimCount||1,A.pixelType=b.pixelType||b.fileInfo.pixelType,A.mask=b.maskData),f>1&&b.fileInfo.mask&&b.fileInfo.mask.numBytes>0&&m.push(b.maskData),d++,A.pixels.push(b.pixelData),A.statistics.push({minValue:b.minValue,maxValue:b.maxValue,noDataValue:b.noDataValue,dimStats:b.dimStats})}var T,S,w;if(f>1&&m.length>1){for(w=A.width*A.height,A.bandMasks=m,C=new Uint8Array(w),C.set(m[0]),T=1;T<m.length;T++)for(x=m[T],S=0;S<w;S++)C[S]=C[S]&x[S];A.maskData=C}return A}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof xz<"u"&&xz.exports?xz.exports=i:this.Lerc=i})()});var $xe=un((Z1,sX)=>{/*! NoSleep.min.js v0.9.0 - git.io/vfn01 - Rich Tibbett - MIT license */(function(e,t){typeof Z1=="object"&&typeof sX=="object"?sX.exports=t():typeof define=="function"&&define.amd?define([],t):typeof Z1=="object"?Z1.NoSleep=t():e.NoSleep=t()})(typeof self<"u"?self:Z1,function(){return function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(i,r,o){t.o(i,r)||Object.defineProperty(i,r,{configurable:!1,enumerable:!0,get:o})},t.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return t.d(r,"a",r),r},t.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";function i(f,d){if(!(f instanceof d))throw new TypeError("Cannot call a class as a function")}var r=function(){function f(d,p){for(var g=0;g<p.length;g++){var m=p[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(d,m.key,m)}}return function(d,p,g){return p&&f(d.prototype,p),g&&f(d,g),d}}(),o=n(1),s=o.webm,a=o.mp4,c=typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,u=function(){function f(){var d=this;i(this,f),c?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("muted",""),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",s),this._addSourceToVideo(this.noSleepVideo,"mp4",a),this.noSleepVideo.addEventListener("loadedmetadata",function(){d.noSleepVideo.duration<=1?d.noSleepVideo.setAttribute("loop",""):d.noSleepVideo.addEventListener("timeupdate",function(){d.noSleepVideo.currentTime>.5&&(d.noSleepVideo.currentTime=Math.random())})}))}return r(f,[{key:"_addSourceToVideo",value:function(d,p,g){var m=document.createElement("source");m.src=g,m.type="video/"+p,d.appendChild(m)}},{key:"enable",value:function(){c?(this.disable(),console.warn(`
- NoSleep enabled for older iOS devices. This can interrupt
- active or long-running network requests from completing successfully.
- See https://github.com/richtr/NoSleep.js/issues/15 for more details.
- `),this.noSleepTimer=window.setInterval(function(){document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3)):this.noSleepVideo.play()}},{key:"disable",value:function(){c?this.noSleepTimer&&(console.warn(`
- NoSleep now disabled for older iOS devices.
- `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause()}}]),f}();e.exports=u},function(e,t,n){"use strict";e.exports={webm:"data:video/webm;base64,GkXfo0AgQoaBAUL3gQFC8oEEQvOBCEKCQAR3ZWJtQoeBAkKFgQIYU4BnQI0VSalmQCgq17FAAw9CQE2AQAZ3aGFtbXlXQUAGd2hhbW15RIlACECPQAAAAAAAFlSua0AxrkAu14EBY8WBAZyBACK1nEADdW5khkAFVl9WUDglhohAA1ZQOIOBAeBABrCBCLqBCB9DtnVAIueBAKNAHIEAAIAwAQCdASoIAAgAAUAmJaQAA3AA/vz0AAA=",mp4:"data:video/mp4;base64,AAAAIGZ0eXBtcDQyAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC8wYF///v3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE0MiByMjQ3OSBkZDc5YTYxIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxNCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTEgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDExMSBtZT1oZXggc3VibWU9MiBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0wIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MCA4eDhkY3Q9MCBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0wIHRocmVhZHM9NiBsb29rYWhlYWRfdGhyZWFkcz0xIHNsaWNlZF90aHJlYWRzPTAgbnI9MCBkZWNpbWF0ZT0xIGludGVybGFjZWQ9MCBibHVyYXlfY29tcGF0PTAgY29uc3RyYWluZWRfaW50cmE9MCBiZnJhbWVzPTMgYl9weXJhbWlkPTIgYl9hZGFwdD0xIGJfYmlhcz0wIGRpcmVjdD0xIHdlaWdodGI9MSBvcGVuX2dvcD0wIHdlaWdodHA9MSBrZXlpbnQ9MzAwIGtleWludF9taW49MzAgc2NlbmVjdXQ9NDAgaW50cmFfcmVmcmVzaD0wIHJjX2xvb2thaGVhZD0xMCByYz1jcmYgbWJ0cmVlPTEgY3JmPTIwLjAgcWNvbXA9MC42MCBxcG1pbj0wIHFwbWF4PTY5IHFwc3RlcD00IHZidl9tYXhyYXRlPTIwMDAwIHZidl9idWZzaXplPTI1MDAwIGNyZl9tYXg9MC4wIG5hbF9ocmQ9bm9uZSBmaWxsZXI9MCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAAAOWWIhAA3//p+C7v8tDDSTjf97w55i3SbRPO4ZY+hkjD5hbkAkL3zpJ6h/LR1CAABzgB1kqqzUorlhQAAAAxBmiQYhn/+qZYADLgAAAAJQZ5CQhX/AAj5IQADQGgcIQADQGgcAAAACQGeYUQn/wALKCEAA0BoHAAAAAkBnmNEJ/8ACykhAANAaBwhAANAaBwAAAANQZpoNExDP/6plgAMuSEAA0BoHAAAAAtBnoZFESwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBnqVEJ/8ACykhAANAaBwAAAAJAZ6nRCf/AAsoIQADQGgcIQADQGgcAAAADUGarDRMQz/+qZYADLghAANAaBwAAAALQZ7KRRUsK/8ACPkhAANAaBwAAAAJAZ7pRCf/AAsoIQADQGgcIQADQGgcAAAACQGe60Qn/wALKCEAA0BoHAAAAA1BmvA0TEM//qmWAAy5IQADQGgcIQADQGgcAAAAC0GfDkUVLCv/AAj5IQADQGgcAAAACQGfLUQn/wALKSEAA0BoHCEAA0BoHAAAAAkBny9EJ/8ACyghAANAaBwAAAANQZs0NExDP/6plgAMuCEAA0BoHAAAAAtBn1JFFSwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBn3FEJ/8ACyghAANAaBwAAAAJAZ9zRCf/AAsoIQADQGgcIQADQGgcAAAADUGbeDRMQz/+qZYADLkhAANAaBwAAAALQZ+WRRUsK/8ACPghAANAaBwhAANAaBwAAAAJAZ+1RCf/AAspIQADQGgcAAAACQGft0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bm7w0TEM//qmWAAy4IQADQGgcAAAAC0Gf2kUVLCv/AAj5IQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHAAAAAkBn/tEJ/8ACykhAANAaBwAAAANQZvgNExDP/6plgAMuSEAA0BoHCEAA0BoHAAAAAtBnh5FFSwr/wAI+CEAA0BoHAAAAAkBnj1EJ/8ACyghAANAaBwhAANAaBwAAAAJAZ4/RCf/AAspIQADQGgcAAAADUGaJDRMQz/+qZYADLghAANAaBwAAAALQZ5CRRUsK/8ACPkhAANAaBwhAANAaBwAAAAJAZ5hRCf/AAsoIQADQGgcAAAACQGeY0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bmmg0TEM//qmWAAy5IQADQGgcAAAAC0GehkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGepUQn/wALKSEAA0BoHAAAAAkBnqdEJ/8ACyghAANAaBwAAAANQZqsNExDP/6plgAMuCEAA0BoHCEAA0BoHAAAAAtBnspFFSwr/wAI+SEAA0BoHAAAAAkBnulEJ/8ACyghAANAaBwhAANAaBwAAAAJAZ7rRCf/AAsoIQADQGgcAAAADUGa8DRMQz/+qZYADLkhAANAaBwhAANAaBwAAAALQZ8ORRUsK/8ACPkhAANAaBwAAAAJAZ8tRCf/AAspIQADQGgcIQADQGgcAAAACQGfL0Qn/wALKCEAA0BoHAAAAA1BmzQ0TEM//qmWAAy4IQADQGgcAAAAC0GfUkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGfcUQn/wALKCEAA0BoHAAAAAkBn3NEJ/8ACyghAANAaBwhAANAaBwAAAANQZt4NExC//6plgAMuSEAA0BoHAAAAAtBn5ZFFSwr/wAI+CEAA0BoHCEAA0BoHAAAAAkBn7VEJ/8ACykhAANAaBwAAAAJAZ+3RCf/AAspIQADQGgcAAAADUGbuzRMQn/+nhAAYsAhAANAaBwhAANAaBwAAAAJQZ/aQhP/AAspIQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHAAACiFtb292AAAAbG12aGQAAAAA1YCCX9WAgl8AAAPoAAAH/AABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAGGlvZHMAAAAAEICAgAcAT////v7/AAAF+XRyYWsAAABcdGtoZAAAAAPVgIJf1YCCXwAAAAEAAAAAAAAH0AAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAygAAAMoAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAB9AAABdwAAEAAAAABXFtZGlhAAAAIG1kaGQAAAAA1YCCX9WAgl8AAV+QAAK/IFXEAAAAAAAtaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAFZpZGVvSGFuZGxlcgAAAAUcbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAAE3HN0YmwAAACYc3RzZAAAAAAAAAABAAAAiGF2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAygDKAEgAAABIAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAAyYXZjQwFNQCj/4QAbZ01AKOyho3ySTUBAQFAAAAMAEAAr8gDxgxlgAQAEaO+G8gAAABhzdHRzAAAAAAAAAAEAAAA8AAALuAAAABRzdHNzAAAAAAAAAAEAAAABAAAB8GN0dHMAAAAAAAAAPAAAAAEAABdwAAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAAC7gAAAAAQAAF3AAAAABAAAAAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAEEc3RzegAAAAAAAAAAAAAAPAAAAzQAAAAQAAAADQAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAANAAAADQAAAQBzdGNvAAAAAAAAADwAAAAwAAADZAAAA3QAAAONAAADoAAAA7kAAAPQAAAD6wAAA/4AAAQXAAAELgAABEMAAARcAAAEbwAABIwAAAShAAAEugAABM0AAATkAAAE/wAABRIAAAUrAAAFQgAABV0AAAVwAAAFiQAABaAAAAW1AAAFzgAABeEAAAX+AAAGEwAABiwAAAY/AAAGVgAABnEAAAaEAAAGnQAABrQAAAbPAAAG4gAABvUAAAcSAAAHJwAAB0AAAAdTAAAHcAAAB4UAAAeeAAAHsQAAB8gAAAfjAAAH9gAACA8AAAgmAAAIQQAACFQAAAhnAAAIhAAACJcAAAMsdHJhawAAAFx0a2hkAAAAA9WAgl/VgIJfAAAAAgAAAAAAAAf8AAAAAAAAAAAAAAABAQAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAACsm1kaWEAAAAgbWRoZAAAAADVgIJf1YCCXwAArEQAAWAAVcQAAAAAACdoZGxyAAAAAAAAAABzb3VuAAAAAAAAAAAAAAAAU3RlcmVvAAAAAmNtaW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAidzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAIABICAgBRAFQAAAAADDUAAAAAABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAABYAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAAUc3RzegAAAAAAAAAGAAAAWAAAAXBzdGNvAAAAAAAAAFgAAAOBAAADhwAAA5oAAAOtAAADswAAA8oAAAPfAAAD5QAAA/gAAAQLAAAEEQAABCgAAAQ9AAAEUAAABFYAAARpAAAEgAAABIYAAASbAAAErgAABLQAAATHAAAE3gAABPMAAAT5AAAFDAAABR8AAAUlAAAFPAAABVEAAAVXAAAFagAABX0AAAWDAAAFmgAABa8AAAXCAAAFyAAABdsAAAXyAAAF+AAABg0AAAYgAAAGJgAABjkAAAZQAAAGZQAABmsAAAZ+AAAGkQAABpcAAAauAAAGwwAABskAAAbcAAAG7wAABwYAAAcMAAAHIQAABzQAAAc6AAAHTQAAB2QAAAdqAAAHfwAAB5IAAAeYAAAHqwAAB8IAAAfXAAAH3QAAB/AAAAgDAAAICQAACCAAAAg1AAAIOwAACE4AAAhhAAAIeAAACH4AAAiRAAAIpAAACKoAAAiwAAAItgAACLwAAAjCAAAAFnVkdGEAAAAObmFtZVN0ZXJlbwAAAHB1ZHRhAAAAaG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAO2lsc3QAAAAzqXRvbwAAACtkYXRhAAAAAQAAAABIYW5kQnJha2UgMC4xMC4yIDIwMTUwNjExMDA="}}])})});var Q1=un(qc=>{"use strict";var ixt=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function rxt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}qc.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(!!n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(var i in n)rxt(n,i)&&(e[i]=n[i])}}return e};qc.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var oxt={arraySet:function(e,t,n,i,r){if(t.subarray&&e.subarray){e.set(t.subarray(n,n+i),r);return}for(var o=0;o<i;o++)e[r+o]=t[n+o]},flattenChunks:function(e){var t,n,i,r,o,s;for(i=0,t=0,n=e.length;t<n;t++)i+=e[t].length;for(s=new Uint8Array(i),r=0,t=0,n=e.length;t<n;t++)o=e[t],s.set(o,r),r+=o.length;return s}},sxt={arraySet:function(e,t,n,i,r){for(var o=0;o<i;o++)e[r+o]=t[n+o]},flattenChunks:function(e){return[].concat.apply([],e)}};qc.setTyped=function(e){e?(qc.Buf8=Uint8Array,qc.Buf16=Uint16Array,qc.Buf32=Int32Array,qc.assign(qc,oxt)):(qc.Buf8=Array,qc.Buf16=Array,qc.Buf32=Array,qc.assign(qc,sxt))};qc.setTyped(ixt)});var Jxe=un((n7i,Zxe)=>{"use strict";function axt(e,t,n,i){for(var r=e&65535|0,o=e>>>16&65535|0,s=0;n!==0;){s=n>2e3?2e3:n,n-=s;do r=r+t[i++]|0,o=o+r|0;while(--s);r%=65521,o%=65521}return r|o<<16|0}Zxe.exports=axt});var eCe=un((i7i,Qxe)=>{"use strict";function cxt(){for(var e,t=[],n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t}var lxt=cxt();function uxt(e,t,n,i){var r=lxt,o=i+n;e^=-1;for(var s=i;s<o;s++)e=e>>>8^r[(e^t[s])&255];return e^-1}Qxe.exports=uxt});var nCe=un((r7i,tCe)=>{"use strict";var Cz=30,fxt=12;tCe.exports=function(t,n){var i,r,o,s,a,c,u,f,d,p,g,m,x,C,A,b,T,S,w,D,I,O,B,L,_;i=t.state,r=t.next_in,L=t.input,o=r+(t.avail_in-5),s=t.next_out,_=t.output,a=s-(n-t.avail_out),c=s+(t.avail_out-257),u=i.dmax,f=i.wsize,d=i.whave,p=i.wnext,g=i.window,m=i.hold,x=i.bits,C=i.lencode,A=i.distcode,b=(1<<i.lenbits)-1,T=(1<<i.distbits)-1;e:do{x<15&&(m+=L[r++]<<x,x+=8,m+=L[r++]<<x,x+=8),S=C[m&b];t:for(;;){if(w=S>>>24,m>>>=w,x-=w,w=S>>>16&255,w===0)_[s++]=S&65535;else if(w&16){D=S&65535,w&=15,w&&(x<w&&(m+=L[r++]<<x,x+=8),D+=m&(1<<w)-1,m>>>=w,x-=w),x<15&&(m+=L[r++]<<x,x+=8,m+=L[r++]<<x,x+=8),S=A[m&T];n:for(;;){if(w=S>>>24,m>>>=w,x-=w,w=S>>>16&255,w&16){if(I=S&65535,w&=15,x<w&&(m+=L[r++]<<x,x+=8,x<w&&(m+=L[r++]<<x,x+=8)),I+=m&(1<<w)-1,I>u){t.msg="invalid distance too far back",i.mode=Cz;break e}if(m>>>=w,x-=w,w=s-a,I>w){if(w=I-w,w>d&&i.sane){t.msg="invalid distance too far back",i.mode=Cz;break e}if(O=0,B=g,p===0){if(O+=f-w,w<D){D-=w;do _[s++]=g[O++];while(--w);O=s-I,B=_}}else if(p<w){if(O+=f+p-w,w-=p,w<D){D-=w;do _[s++]=g[O++];while(--w);if(O=0,p<D){w=p,D-=w;do _[s++]=g[O++];while(--w);O=s-I,B=_}}}else if(O+=p-w,w<D){D-=w;do _[s++]=g[O++];while(--w);O=s-I,B=_}for(;D>2;)_[s++]=B[O++],_[s++]=B[O++],_[s++]=B[O++],D-=3;D&&(_[s++]=B[O++],D>1&&(_[s++]=B[O++]))}else{O=s-I;do _[s++]=_[O++],_[s++]=_[O++],_[s++]=_[O++],D-=3;while(D>2);D&&(_[s++]=_[O++],D>1&&(_[s++]=_[O++]))}}else if((w&64)===0){S=A[(S&65535)+(m&(1<<w)-1)];continue n}else{t.msg="invalid distance code",i.mode=Cz;break e}break}}else if((w&64)===0){S=C[(S&65535)+(m&(1<<w)-1)];continue t}else if(w&32){i.mode=fxt;break e}else{t.msg="invalid literal/length code",i.mode=Cz;break e}break}}while(r<o&&s<c);D=x>>3,r-=D,x-=D<<3,m&=(1<<x)-1,t.next_in=r,t.next_out=s,t.avail_in=r<o?5+(o-r):5-(r-o),t.avail_out=s<c?257+(c-s):257-(s-c),i.hold=m,i.bits=x}});var lCe=un((o7i,cCe)=>{"use strict";var iCe=Q1(),$E=15,rCe=852,oCe=592,sCe=0,aX=1,aCe=2,dxt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],hxt=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],mxt=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],pxt=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];cCe.exports=function(t,n,i,r,o,s,a,c){var u=c.bits,f=0,d=0,p=0,g=0,m=0,x=0,C=0,A=0,b=0,T=0,S,w,D,I,O,B=null,L=0,_,E=new iCe.Buf16($E+1),v=new iCe.Buf16($E+1),P=null,R=0,F,U,k;for(f=0;f<=$E;f++)E[f]=0;for(d=0;d<r;d++)E[n[i+d]]++;for(m=u,g=$E;g>=1&&E[g]===0;g--);if(m>g&&(m=g),g===0)return o[s++]=1<<24|64<<16|0,o[s++]=1<<24|64<<16|0,c.bits=1,0;for(p=1;p<g&&E[p]===0;p++);for(m<p&&(m=p),A=1,f=1;f<=$E;f++)if(A<<=1,A-=E[f],A<0)return-1;if(A>0&&(t===sCe||g!==1))return-1;for(v[1]=0,f=1;f<$E;f++)v[f+1]=v[f]+E[f];for(d=0;d<r;d++)n[i+d]!==0&&(a[v[n[i+d]]++]=d);if(t===sCe?(B=P=a,_=19):t===aX?(B=dxt,L-=257,P=hxt,R-=257,_=256):(B=mxt,P=pxt,_=-1),T=0,d=0,f=p,O=s,x=m,C=0,D=-1,b=1<<m,I=b-1,t===aX&&b>rCe||t===aCe&&b>oCe)return 1;for(;;){F=f-C,a[d]<_?(U=0,k=a[d]):a[d]>_?(U=P[R+a[d]],k=B[L+a[d]]):(U=32+64,k=0),S=1<<f-C,w=1<<x,p=w;do w-=S,o[O+(T>>C)+w]=F<<24|U<<16|k|0;while(w!==0);for(S=1<<f-1;T&S;)S>>=1;if(S!==0?(T&=S-1,T+=S):T=0,d++,--E[f]===0){if(f===g)break;f=n[i+a[d]]}if(f>m&&(T&I)!==D){for(C===0&&(C=m),O+=p,x=f-C,A=1<<x;x+C<g&&(A-=E[x+C],!(A<=0));)x++,A<<=1;if(b+=1<<x,t===aX&&b>rCe||t===aCe&&b>oCe)return 1;D=T&I,o[D]=m<<24|x<<16|O-s|0}}return T!==0&&(o[O+T]=f-C<<24|64<<16|0),c.bits=m,0}});var WCe=un(rh=>{"use strict";var Ou=Q1(),hX=Jxe(),Im=eCe(),_xt=nCe(),eP=lCe(),gxt=0,LCe=1,NCe=2,uCe=4,yxt=5,Az=6,DC=0,xxt=1,Cxt=2,zf=-2,FCe=-3,mX=-4,Axt=-5,fCe=8,VCe=1,dCe=2,hCe=3,mCe=4,pCe=5,_Ce=6,gCe=7,yCe=8,xCe=9,CCe=10,Ez=11,f_=12,cX=13,ACe=14,lX=15,TCe=16,bCe=17,ECe=18,SCe=19,Tz=20,bz=21,wCe=22,vCe=23,DCe=24,PCe=25,ICe=26,uX=27,OCe=28,RCe=29,Do=30,pX=31,Txt=32,bxt=852,Ext=592,Sxt=15,wxt=Sxt;function MCe(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function vxt(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Ou.Buf16(320),this.work=new Ou.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function kCe(e){var t;return!e||!e.state?zf:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=VCe,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Ou.Buf32(bxt),t.distcode=t.distdyn=new Ou.Buf32(Ext),t.sane=1,t.back=-1,DC)}function UCe(e){var t;return!e||!e.state?zf:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,kCe(e))}function zCe(e,t){var n,i;return!e||!e.state||(i=e.state,t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?zf:(i.window!==null&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,UCe(e))}function HCe(e,t){var n,i;return e?(i=new vxt,e.state=i,i.window=null,n=zCe(e,t),n!==DC&&(e.state=null),n):zf}function Dxt(e){return HCe(e,wxt)}var BCe=!0,fX,dX;function Pxt(e){if(BCe){var t;for(fX=new Ou.Buf32(512),dX=new Ou.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(eP(LCe,e.lens,0,288,fX,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;eP(NCe,e.lens,0,32,dX,0,e.work,{bits:5}),BCe=!1}e.lencode=fX,e.lenbits=9,e.distcode=dX,e.distbits=5}function GCe(e,t,n,i){var r,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Ou.Buf8(o.wsize)),i>=o.wsize?(Ou.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(r=o.wsize-o.wnext,r>i&&(r=i),Ou.arraySet(o.window,t,n-i,r,o.wnext),i-=r,i?(Ou.arraySet(o.window,t,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=r,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=r))),0}function Ixt(e,t){var n,i,r,o,s,a,c,u,f,d,p,g,m,x,C=0,A,b,T,S,w,D,I,O,B=new Ou.Buf8(4),L,_,E=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return zf;n=e.state,n.mode===f_&&(n.mode=cX),s=e.next_out,r=e.output,c=e.avail_out,o=e.next_in,i=e.input,a=e.avail_in,u=n.hold,f=n.bits,d=a,p=c,O=DC;e:for(;;)switch(n.mode){case VCe:if(n.wrap===0){n.mode=cX;break}for(;f<16;){if(a===0)break e;a--,u+=i[o++]<<f,f+=8}if(n.wrap&2&&u===35615){n.check=0,B[0]=u&255,B[1]=u>>>8&255,n.check=Im(n.check,B,2,0),u=0,f=0,n.mode=dCe;break}if(n.flags=0,n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){e.msg="incorrect header check",n.mode=Do;break}if((u&15)!==fCe){e.msg="unknown compression method",n.mode=Do;break}if(u>>>=4,f-=4,I=(u&15)+8,n.wbits===0)n.wbits=I;else if(I>n.wbits){e.msg="invalid window size",n.mode=Do;break}n.dmax=1<<I,e.adler=n.check=1,n.mode=u&512?CCe:f_,u=0,f=0;break;case dCe:for(;f<16;){if(a===0)break e;a--,u+=i[o++]<<f,f+=8}if(n.flags=u,(n.flags&255)!==fCe){e.msg="unknown compression method",n.mode=Do;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=Do;break}n.head&&(n.head.text=u>>8&1),n.flags&512&&(B[0]=u&255,B[1]=u>>>8&255,n.check=Im(n.check,B,2,0)),u=0,f=0,n.mode=hCe;case hCe:for(;f<32;){if(a===0)break e;a--,u+=i[o++]<<f,f+=8}n.head&&(n.head.time=u),n.flags&512&&(B[0]=u&255,B[1]=u>>>8&255,B[2]=u>>>16&255,B[3]=u>>>24&255,n.check=Im(n.check,B,4,0)),u=0,f=0,n.mode=mCe;case mCe:for(;f<16;){if(a===0)break e;a--,u+=i[o++]<<f,f+=8}n.head&&(n.head.xflags=u&255,n.head.os=u>>8),n.flags&512&&(B[0]=u&255,B[1]=u>>>8&255,n.check=Im(n.check,B,2,0)),u=0,f=0,n.mode=pCe;case pCe:if(n.flags&1024){for(;f<16;){if(a===0)break e;a--,u+=i[o++]<<f,f+=8}n.length=u,n.head&&(n.head.extra_len=u),n.flags&512&&(B[0]=u&255,B[1]=u>>>8&255,n.check=Im(n.check,B,2,0)),u=0,f=0}else n.head&&(n.head.extra=null);n.mode=_Ce;case _Ce:if(n.flags&1024&&(g=n.length,g>a&&(g=a),g&&(n.head&&(I=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),Ou.arraySet(n.head.extra,i,o,g,I)),n.flags&512&&(n.check=Im(n.check,i,g,o)),a-=g,o+=g,n.length-=g),n.length))break e;n.length=0,n.mode=gCe;case gCe:if(n.flags&2048){if(a===0)break e;g=0;do I=i[o+g++],n.head&&I&&n.length<65536&&(n.head.name+=String.fromCharCode(I));while(I&&g<a);if(n.flags&512&&(n.check=Im(n.check,i,g,o)),a-=g,o+=g,I)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=yCe;case yCe:if(n.flags&4096){if(a===0)break e;g=0;do I=i[o+g++],n.head&&I&&n.length<65536&&(n.head.comment+=String.fromCharCode(I));while(I&&g<a);if(n.flags&512&&(n.check=Im(n.check,i,g,o)),a-=g,o+=g,I)break e}else n.head&&(n.head.comment=null);n.mode=xCe;case xCe:if(n.flags&512){for(;f<16;){if(a===0)break e;a--,u+=i[o++]<<f,f+=8}if(u!==(n.check&65535)){e.msg="header crc mismatch",n.mode=Do;break}u=0,f=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=f_;break;case CCe:for(;f<32;){if(a===0)break e;a--,u+=i[o++]<<f,f+=8}e.adler=n.check=MCe(u),u=0,f=0,n.mode=Ez;case Ez:if(n.havedict===0)return e.next_out=s,e.avail_out=c,e.next_in=o,e.avail_in=a,n.hold=u,n.bits=f,Cxt;e.adler=n.check=1,n.mode=f_;case f_:if(t===yxt||t===Az)break e;case cX:if(n.last){u>>>=f&7,f-=f&7,n.mode=uX;break}for(;f<3;){if(a===0)break e;a--,u+=i[o++]<<f,f+=8}switch(n.last=u&1,u>>>=1,f-=1,u&3){case 0:n.mode=ACe;break;case 1:if(Pxt(n),n.mode=Tz,t===Az){u>>>=2,f-=2;break e}break;case 2:n.mode=bCe;break;case 3:e.msg="invalid block type",n.mode=Do}u>>>=2,f-=2;break;case ACe:for(u>>>=f&7,f-=f&7;f<32;){if(a===0)break e;a--,u+=i[o++]<<f,f+=8}if((u&65535)!==(u>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Do;break}if(n.length=u&65535,u=0,f=0,n.mode=lX,t===Az)break e;case lX:n.mode=TCe;case TCe:if(g=n.length,g){if(g>a&&(g=a),g>c&&(g=c),g===0)break e;Ou.arraySet(r,i,o,g,s),a-=g,o+=g,c-=g,s+=g,n.length-=g;break}n.mode=f_;break;case bCe:for(;f<14;){if(a===0)break e;a--,u+=i[o++]<<f,f+=8}if(n.nlen=(u&31)+257,u>>>=5,f-=5,n.ndist=(u&31)+1,u>>>=5,f-=5,n.ncode=(u&15)+4,u>>>=4,f-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Do;break}n.have=0,n.mode=ECe;case ECe:for(;n.have<n.ncode;){for(;f<3;){if(a===0)break e;a--,u+=i[o++]<<f,f+=8}n.lens[E[n.have++]]=u&7,u>>>=3,f-=3}for(;n.have<19;)n.lens[E[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,L={bits:n.lenbits},O=eP(gxt,n.lens,0,19,n.lencode,0,n.work,L),n.lenbits=L.bits,O){e.msg="invalid code lengths set",n.mode=Do;break}n.have=0,n.mode=SCe;case SCe:for(;n.have<n.nlen+n.ndist;){for(;C=n.lencode[u&(1<<n.lenbits)-1],A=C>>>24,b=C>>>16&255,T=C&65535,!(A<=f);){if(a===0)break e;a--,u+=i[o++]<<f,f+=8}if(T<16)u>>>=A,f-=A,n.lens[n.have++]=T;else{if(T===16){for(_=A+2;f<_;){if(a===0)break e;a--,u+=i[o++]<<f,f+=8}if(u>>>=A,f-=A,n.have===0){e.msg="invalid bit length repeat",n.mode=Do;break}I=n.lens[n.have-1],g=3+(u&3),u>>>=2,f-=2}else if(T===17){for(_=A+3;f<_;){if(a===0)break e;a--,u+=i[o++]<<f,f+=8}u>>>=A,f-=A,I=0,g=3+(u&7),u>>>=3,f-=3}else{for(_=A+7;f<_;){if(a===0)break e;a--,u+=i[o++]<<f,f+=8}u>>>=A,f-=A,I=0,g=11+(u&127),u>>>=7,f-=7}if(n.have+g>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Do;break}for(;g--;)n.lens[n.have++]=I}}if(n.mode===Do)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=Do;break}if(n.lenbits=9,L={bits:n.lenbits},O=eP(LCe,n.lens,0,n.nlen,n.lencode,0,n.work,L),n.lenbits=L.bits,O){e.msg="invalid literal/lengths set",n.mode=Do;break}if(n.distbits=6,n.distcode=n.distdyn,L={bits:n.distbits},O=eP(NCe,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,L),n.distbits=L.bits,O){e.msg="invalid distances set",n.mode=Do;break}if(n.mode=Tz,t===Az)break e;case Tz:n.mode=bz;case bz:if(a>=6&&c>=258){e.next_out=s,e.avail_out=c,e.next_in=o,e.avail_in=a,n.hold=u,n.bits=f,_xt(e,p),s=e.next_out,r=e.output,c=e.avail_out,o=e.next_in,i=e.input,a=e.avail_in,u=n.hold,f=n.bits,n.mode===f_&&(n.back=-1);break}for(n.back=0;C=n.lencode[u&(1<<n.lenbits)-1],A=C>>>24,b=C>>>16&255,T=C&65535,!(A<=f);){if(a===0)break e;a--,u+=i[o++]<<f,f+=8}if(b&&(b&240)===0){for(S=A,w=b,D=T;C=n.lencode[D+((u&(1<<S+w)-1)>>S)],A=C>>>24,b=C>>>16&255,T=C&65535,!(S+A<=f);){if(a===0)break e;a--,u+=i[o++]<<f,f+=8}u>>>=S,f-=S,n.back+=S}if(u>>>=A,f-=A,n.back+=A,n.length=T,b===0){n.mode=ICe;break}if(b&32){n.back=-1,n.mode=f_;break}if(b&64){e.msg="invalid literal/length code",n.mode=Do;break}n.extra=b&15,n.mode=wCe;case wCe:if(n.extra){for(_=n.extra;f<_;){if(a===0)break e;a--,u+=i[o++]<<f,f+=8}n.length+=u&(1<<n.extra)-1,u>>>=n.extra,f-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=vCe;case vCe:for(;C=n.distcode[u&(1<<n.distbits)-1],A=C>>>24,b=C>>>16&255,T=C&65535,!(A<=f);){if(a===0)break e;a--,u+=i[o++]<<f,f+=8}if((b&240)===0){for(S=A,w=b,D=T;C=n.distcode[D+((u&(1<<S+w)-1)>>S)],A=C>>>24,b=C>>>16&255,T=C&65535,!(S+A<=f);){if(a===0)break e;a--,u+=i[o++]<<f,f+=8}u>>>=S,f-=S,n.back+=S}if(u>>>=A,f-=A,n.back+=A,b&64){e.msg="invalid distance code",n.mode=Do;break}n.offset=T,n.extra=b&15,n.mode=DCe;case DCe:if(n.extra){for(_=n.extra;f<_;){if(a===0)break e;a--,u+=i[o++]<<f,f+=8}n.offset+=u&(1<<n.extra)-1,u>>>=n.extra,f-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Do;break}n.mode=PCe;case PCe:if(c===0)break e;if(g=p-c,n.offset>g){if(g=n.offset-g,g>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Do;break}g>n.wnext?(g-=n.wnext,m=n.wsize-g):m=n.wnext-g,g>n.length&&(g=n.length),x=n.window}else x=r,m=s-n.offset,g=n.length;g>c&&(g=c),c-=g,n.length-=g;do r[s++]=x[m++];while(--g);n.length===0&&(n.mode=bz);break;case ICe:if(c===0)break e;r[s++]=n.length,c--,n.mode=bz;break;case uX:if(n.wrap){for(;f<32;){if(a===0)break e;a--,u|=i[o++]<<f,f+=8}if(p-=c,e.total_out+=p,n.total+=p,p&&(e.adler=n.check=n.flags?Im(n.check,r,p,s-p):hX(n.check,r,p,s-p)),p=c,(n.flags?u:MCe(u))!==n.check){e.msg="incorrect data check",n.mode=Do;break}u=0,f=0}n.mode=OCe;case OCe:if(n.wrap&&n.flags){for(;f<32;){if(a===0)break e;a--,u+=i[o++]<<f,f+=8}if(u!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=Do;break}u=0,f=0}n.mode=RCe;case RCe:O=xxt;break e;case Do:O=FCe;break e;case pX:return mX;case Txt:default:return zf}return e.next_out=s,e.avail_out=c,e.next_in=o,e.avail_in=a,n.hold=u,n.bits=f,(n.wsize||p!==e.avail_out&&n.mode<Do&&(n.mode<uX||t!==uCe))&&GCe(e,e.output,e.next_out,p-e.avail_out)?(n.mode=pX,mX):(d-=e.avail_in,p-=e.avail_out,e.total_in+=d,e.total_out+=p,n.total+=p,n.wrap&&p&&(e.adler=n.check=n.flags?Im(n.check,r,p,e.next_out-p):hX(n.check,r,p,e.next_out-p)),e.data_type=n.bits+(n.last?64:0)+(n.mode===f_?128:0)+(n.mode===Tz||n.mode===lX?256:0),(d===0&&p===0||t===uCe)&&O===DC&&(O=Axt),O)}function Oxt(e){if(!e||!e.state)return zf;var t=e.state;return t.window&&(t.window=null),e.state=null,DC}function Rxt(e,t){var n;return!e||!e.state||(n=e.state,(n.wrap&2)===0)?zf:(n.head=t,t.done=!1,DC)}function Mxt(e,t){var n=t.length,i,r,o;return!e||!e.state||(i=e.state,i.wrap!==0&&i.mode!==Ez)?zf:i.mode===Ez&&(r=1,r=hX(r,t,n,0),r!==i.check)?FCe:(o=GCe(e,t,n,n),o?(i.mode=pX,mX):(i.havedict=1,DC))}rh.inflateReset=UCe;rh.inflateReset2=zCe;rh.inflateResetKeep=kCe;rh.inflateInit=Dxt;rh.inflateInit2=HCe;rh.inflate=Ixt;rh.inflateEnd=Oxt;rh.inflateGetHeader=Rxt;rh.inflateSetDictionary=Mxt;rh.inflateInfo="pako inflate (from Nodeca project)"});var XCe=un(ZE=>{"use strict";var Sz=Q1(),jCe=!0,qCe=!0;try{String.fromCharCode.apply(null,[0])}catch{jCe=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{qCe=!1}var tP=new Sz.Buf8(256);for(d_=0;d_<256;d_++)tP[d_]=d_>=252?6:d_>=248?5:d_>=240?4:d_>=224?3:d_>=192?2:1;var d_;tP[254]=tP[254]=1;ZE.string2buf=function(e){var t,n,i,r,o,s=e.length,a=0;for(r=0;r<s;r++)n=e.charCodeAt(r),(n&64512)===55296&&r+1<s&&(i=e.charCodeAt(r+1),(i&64512)===56320&&(n=65536+(n-55296<<10)+(i-56320),r++)),a+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Sz.Buf8(a),o=0,r=0;o<a;r++)n=e.charCodeAt(r),(n&64512)===55296&&r+1<s&&(i=e.charCodeAt(r+1),(i&64512)===56320&&(n=65536+(n-55296<<10)+(i-56320),r++)),n<128?t[o++]=n:n<2048?(t[o++]=192|n>>>6,t[o++]=128|n&63):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|n&63):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|n&63);return t};function YCe(e,t){if(t<65534&&(e.subarray&&qCe||!e.subarray&&jCe))return String.fromCharCode.apply(null,Sz.shrinkBuf(e,t));for(var n="",i=0;i<t;i++)n+=String.fromCharCode(e[i]);return n}ZE.buf2binstring=function(e){return YCe(e,e.length)};ZE.binstring2buf=function(e){for(var t=new Sz.Buf8(e.length),n=0,i=t.length;n<i;n++)t[n]=e.charCodeAt(n);return t};ZE.buf2string=function(e,t){var n,i,r,o,s=t||e.length,a=new Array(s*2);for(i=0,n=0;n<s;){if(r=e[n++],r<128){a[i++]=r;continue}if(o=tP[r],o>4){a[i++]=65533,n+=o-1;continue}for(r&=o===2?31:o===3?15:7;o>1&&n<s;)r=r<<6|e[n++]&63,o--;if(o>1){a[i++]=65533;continue}r<65536?a[i++]=r:(r-=65536,a[i++]=55296|r>>10&1023,a[i++]=56320|r&1023)}return YCe(a,i)};ZE.utf8border=function(e,t){var n;for(t=t||e.length,t>e.length&&(t=e.length),n=t-1;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+tP[e[n]]>t?n:t}});var $Ce=un((c7i,KCe)=>{"use strict";KCe.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var JCe=un((l7i,ZCe)=>{"use strict";ZCe.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var eAe=un((u7i,QCe)=>{"use strict";function Bxt(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}QCe.exports=Bxt});var nAe=un((f7i,tAe)=>{"use strict";function Lxt(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}tAe.exports=Lxt});var rAe=un(iP=>{"use strict";var JE=WCe(),nP=Q1(),wz=XCe(),us=$Ce(),_X=JCe(),Nxt=eAe(),Fxt=nAe(),iAe=Object.prototype.toString;function PC(e){if(!(this instanceof PC))return new PC(e);this.options=nP.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Nxt,this.strm.avail_out=0;var n=JE.inflateInit2(this.strm,t.windowBits);if(n!==us.Z_OK)throw new Error(_X[n]);if(this.header=new Fxt,JE.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=wz.string2buf(t.dictionary):iAe.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=JE.inflateSetDictionary(this.strm,t.dictionary),n!==us.Z_OK)))throw new Error(_X[n])}PC.prototype.push=function(e,t){var n=this.strm,i=this.options.chunkSize,r=this.options.dictionary,o,s,a,c,u,f=!1;if(this.ended)return!1;s=t===~~t?t:t===!0?us.Z_FINISH:us.Z_NO_FLUSH,typeof e=="string"?n.input=wz.binstring2buf(e):iAe.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;do{if(n.avail_out===0&&(n.output=new nP.Buf8(i),n.next_out=0,n.avail_out=i),o=JE.inflate(n,us.Z_NO_FLUSH),o===us.Z_NEED_DICT&&r&&(o=JE.inflateSetDictionary(this.strm,r)),o===us.Z_BUF_ERROR&&f===!0&&(o=us.Z_OK,f=!1),o!==us.Z_STREAM_END&&o!==us.Z_OK)return this.onEnd(o),this.ended=!0,!1;n.next_out&&(n.avail_out===0||o===us.Z_STREAM_END||n.avail_in===0&&(s===us.Z_FINISH||s===us.Z_SYNC_FLUSH))&&(this.options.to==="string"?(a=wz.utf8border(n.output,n.next_out),c=n.next_out-a,u=wz.buf2string(n.output,a),n.next_out=c,n.avail_out=i-c,c&&nP.arraySet(n.output,n.output,a,c,0),this.onData(u)):this.onData(nP.shrinkBuf(n.output,n.next_out))),n.avail_in===0&&n.avail_out===0&&(f=!0)}while((n.avail_in>0||n.avail_out===0)&&o!==us.Z_STREAM_END);return o===us.Z_STREAM_END&&(s=us.Z_FINISH),s===us.Z_FINISH?(o=JE.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===us.Z_OK):(s===us.Z_SYNC_FLUSH&&(this.onEnd(us.Z_OK),n.avail_out=0),!0)};PC.prototype.onData=function(e){this.chunks.push(e)};PC.prototype.onEnd=function(e){e===us.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=nP.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function gX(e,t){var n=new PC(t);if(n.push(e,!0),n.err)throw n.msg||_X[n.err];return n.result}function Vxt(e,t){return t=t||{},t.raw=!0,gX(e,t)}iP.Inflate=PC;iP.inflate=gX;iP.inflateRaw=Vxt;iP.ungzip=gX});var uAt={};MX(uAt,{AlphaMode:()=>vp,AlphaPipelineStage:()=>IF,Animation:()=>Mz,AnimationViewModel:()=>Bz,Appearance:()=>ar,ApproximateTerrainHeights:()=>fi,ArcGISTiledElevationTerrainProvider:()=>nZ,ArcGisMapServerImageryProvider:()=>O0,ArcType:()=>Kt,ArticulationStageType:()=>_c,AssociativeArray:()=>xt,AttributeCompression:()=>In,AttributeType:()=>qt,AutoExposure:()=>yk,Autolinker:()=>nC.default,AutomaticUniforms:()=>dg,Axis:()=>On,AxisAlignedBoundingBox:()=>ly,B3dmLoader:()=>_2,B3dmParser:()=>WT,BaseLayerPicker:()=>Fz,BaseLayerPickerViewModel:()=>Lz,BatchTable:()=>bT,BatchTableHierarchy:()=>Ic,BatchTexture:()=>Cr,BatchTexturePipelineStage:()=>OF,Batched3DModel3DTileContent:()=>gN,Billboard:()=>Tr,BillboardCollection:()=>uf,BillboardGraphics:()=>Ec,BillboardVisualizer:()=>rR,BingMapsGeocoderService:()=>cZ,BingMapsImageryProvider:()=>Ak,BingMapsStyle:()=>xk,BlendEquation:()=>Wa,BlendFunction:()=>Pr,BlendOption:()=>Ir,BlendingState:()=>hn,BoundingRectangle:()=>je,BoundingSphere:()=>re,BoundingSphereState:()=>st,BoxEmitter:()=>v_e,BoxGeometry:()=>Vl,BoxGeometryUpdater:()=>RL,BoxGraphics:()=>PT,BoxOutlineGeometry:()=>Ch,BrdfLutGenerator:()=>bk,Buffer:()=>at,BufferLoader:()=>Rc,BufferUsage:()=>Ne,CPUStylingPipelineStage:()=>HF,CallbackProperty:()=>qh,Camera:()=>_r,CameraEventAggregator:()=>Rk,CameraEventType:()=>ki,CameraFlightPath:()=>Ek,Cartesian2:()=>W,Cartesian3:()=>h,Cartesian4:()=>se,Cartographic:()=>me,CartographicGeocoderService:()=>hI,CatmullRomSpline:()=>SZ,Cesium3DContentGroup:()=>yg,Cesium3DTile:()=>sD,Cesium3DTileBatchTable:()=>ml,Cesium3DTileColorBlendMode:()=>Kl,Cesium3DTileContent:()=>oge,Cesium3DTileContentFactory:()=>Ab,Cesium3DTileContentState:()=>Mr,Cesium3DTileContentType:()=>Ks,Cesium3DTileFeature:()=>bo,Cesium3DTileFeatureTable:()=>pl,Cesium3DTileOptimizationHint:()=>Ed,Cesium3DTileOptimizations:()=>R2,Cesium3DTilePass:()=>mo,Cesium3DTilePassState:()=>Kd,Cesium3DTilePointFeature:()=>Vg,Cesium3DTileRefine:()=>Eo,Cesium3DTileStyle:()=>TE,Cesium3DTileStyleEngine:()=>F2,Cesium3DTilesInspector:()=>Gz,Cesium3DTilesInspectorViewModel:()=>zz,Cesium3DTileset:()=>Cf,Cesium3DTilesetCache:()=>M2,Cesium3DTilesetGraphics:()=>NT,Cesium3DTilesetHeatmap:()=>L2,Cesium3DTilesetMetadata:()=>O2,Cesium3DTilesetMostDetailedTraversal:()=>Zv,Cesium3DTilesetStatistics:()=>Jg,Cesium3DTilesetTraversal:()=>jp,Cesium3DTilesetVisualizer:()=>k2,CesiumInspector:()=>qz,CesiumInspectorViewModel:()=>Wz,CesiumTerrainProvider:()=>gI,CesiumWidget:()=>Yz,Check:()=>Nl,CheckerboardMaterialProperty:()=>uD,CircleEmitter:()=>Bk,CircleGeometry:()=>hJ,CircleOutlineGeometry:()=>gJ,ClassificationModel:()=>cN,ClassificationPrimitive:()=>bw,ClassificationType:()=>qn,ClearCommand:()=>li,ClippingPlane:()=>QT,ClippingPlaneCollection:()=>vs,Clock:()=>Sh,ClockRange:()=>jo,ClockStep:()=>xr,ClockViewModel:()=>vz,CloudCollection:()=>hge,CloudType:()=>r1,Color:()=>z,ColorBlendMode:()=>Ds,ColorGeometryInstanceAttribute:()=>Ot,ColorMaterialProperty:()=>Dt,Command:()=>oAe,ComponentDatatype:()=>K,Composite3DTileContent:()=>yN,CompositeEntityCollection:()=>Uue,CompositeMaterialProperty:()=>dD,CompositePositionProperty:()=>Ta,CompositeProperty:()=>Lc,CompressedTextureBuffer:()=>RI,ComputeCommand:()=>cd,ComputeEngine:()=>fk,ConditionsExpression:()=>Mk,ConeEmitter:()=>mge,ConstantPositionProperty:()=>hl,ConstantProperty:()=>Jn,ConstantSpline:()=>vA,ContentMetadata:()=>au,Context:()=>pk,ContextLimits:()=>Bt,CoplanarPolygonGeometry:()=>VI,CoplanarPolygonGeometryLibrary:()=>M_,CoplanarPolygonOutlineGeometry:()=>Qf,CornerType:()=>Li,CorridorGeometry:()=>BA,CorridorGeometryLibrary:()=>zi,CorridorGeometryUpdater:()=>H2,CorridorGraphics:()=>OT,CorridorOutlineGeometry:()=>YI,Credit:()=>Gt,CreditDisplay:()=>Qk,CubeMap:()=>Sc,CubeMapFace:()=>ap,CubicRealPolynomial:()=>eA,CullFace:()=>Yi,CullingVolume:()=>da,CumulusCloud:()=>Bf,CustomDataSource:()=>q2,CustomHeightmapTerrainProvider:()=>wQ,CustomShader:()=>RC,CustomShaderMode:()=>Gg,CustomShaderPipelineStage:()=>kF,CylinderGeometry:()=>$I,CylinderGeometryLibrary:()=>NA,CylinderGeometryUpdater:()=>Y2,CylinderGraphics:()=>RT,CylinderOutlineGeometry:()=>ZI,CzmlDataSource:()=>e3,DataSource:()=>Jo,DataSourceClock:()=>fm,DataSourceCollection:()=>n3,DataSourceDisplay:()=>b3,DebugAppearance:()=>zge,DebugCameraPrimitive:()=>r_,DebugInspector:()=>tU,DebugModelMatrixPrimitive:()=>iU,DefaultProxy:()=>IQ,DepthFunction:()=>wc,DepthPlane:()=>aU,DequantizationPipelineStage:()=>GF,DerivedCommand:()=>V0,DeveloperError:()=>ye,DeviceOrientationCameraController:()=>lU,DirectionalLight:()=>Yge,DiscardEmptyTileImagePolicy:()=>QD,DiscardMissingTileImagePolicy:()=>gk,DistanceDisplayCondition:()=>Tt,DistanceDisplayConditionGeometryInstanceAttribute:()=>kn,DoubleEndedPriorityQueue:()=>MQ,DoublyLinkedList:()=>tO,DracoLoader:()=>_l,DrawCommand:()=>Ze,DynamicGeometryBatch:()=>Hb,DynamicGeometryUpdater:()=>ai,EarthOrientationParameters:()=>WP,EarthOrientationParametersSample:()=>fy,EasingFunction:()=>qo,EllipseGeometry:()=>il,EllipseGeometryLibrary:()=>kl,EllipseGeometryUpdater:()=>o3,EllipseGraphics:()=>MT,EllipseOutlineGeometry:()=>Fu,Ellipsoid:()=>oe,EllipsoidGeodesic:()=>ed,EllipsoidGeometry:()=>Us,EllipsoidGeometryUpdater:()=>s3,EllipsoidGraphics:()=>BT,EllipsoidOutlineGeometry:()=>zu,EllipsoidPrimitive:()=>fU,EllipsoidRhumbLine:()=>ka,EllipsoidSurfaceAppearance:()=>Kge,EllipsoidTangentPlane:()=>La,EllipsoidTerrainProvider:()=>H_,EllipsoidalOccluder:()=>g_,Empty3DTileContent:()=>rD,EncodedCartesian3:()=>zn,Entity:()=>uo,EntityCluster:()=>bf,EntityCollection:()=>Zs,EntityView:()=>w3,Event:()=>ge,EventHelper:()=>Yo,ExperimentalFeatures:()=>zA,Expression:()=>ud,ExpressionNodeType:()=>ft,ExtrapolationType:()=>Hu,FeatureDetection:()=>Et,FeatureIdPipelineStage:()=>Ex,Fog:()=>pU,ForEach:()=>Ae,FrameRateMonitor:()=>_U,FrameState:()=>gU,Framebuffer:()=>ya,FramebufferManager:()=>pi,FrustumCommands:()=>yU,FrustumGeometry:()=>GA,FrustumOutlineGeometry:()=>oO,Fullscreen:()=>Oo,FullscreenButton:()=>Zz,FullscreenButtonViewModel:()=>Kz,GeoJsonDataSource:()=>gV,GeoJsonLoader:()=>_f,GeocodeType:()=>Ry,Geocoder:()=>e8,GeocoderService:()=>KQ,GeocoderViewModel:()=>Jz,GeographicProjection:()=>Ii,GeographicTilingScheme:()=>Qi,Geometry:()=>ot,Geometry3DTileContent:()=>xN,GeometryAttribute:()=>Ee,GeometryAttributes:()=>dn,GeometryFactory:()=>ZQ,GeometryInstance:()=>pt,GeometryInstanceAttribute:()=>Ac,GeometryOffsetAttribute:()=>nn,GeometryPipeline:()=>Bn,GeometryPipelineStage:()=>qF,GeometryType:()=>$f,GeometryUpdater:()=>ci,GeometryVisualizer:()=>m3,GetFeatureInfoFormat:()=>PE,Globe:()=>qU,GlobeDepth:()=>YU,GlobeSurfaceShaderSet:()=>AU,GlobeSurfaceTile:()=>Qd,GlobeSurfaceTileProvider:()=>LU,GlobeTranslucency:()=>NU,GlobeTranslucencyFramebuffer:()=>XU,GlobeTranslucencyState:()=>KU,GltfBufferViewLoader:()=>Jl,GltfDracoLoader:()=>Ql,GltfImageLoader:()=>yl,GltfIndexBufferLoader:()=>eu,GltfJsonLoader:()=>tu,GltfLoader:()=>Ca,GltfLoaderUtil:()=>nu,GltfStructuralMetadataLoader:()=>mf,GltfTextureLoader:()=>iu,GltfVertexBufferLoader:()=>ru,GoogleEarthEnterpriseImageryProvider:()=>W0e,GoogleEarthEnterpriseMapsProvider:()=>qk,GoogleEarthEnterpriseMetadata:()=>Mh,GoogleEarthEnterpriseTerrainData:()=>qS,GoogleEarthEnterpriseTerrainProvider:()=>aee,GoogleEarthEnterpriseTileInformation:()=>aO,GpxDataSource:()=>KV,GregorianDate:()=>y_,GridImageryProvider:()=>j0e,GridMaterialProperty:()=>_D,GroundGeometryUpdater:()=>Gn,GroundPolylineGeometry:()=>qA,GroundPolylinePrimitive:()=>zh,GroundPrimitive:()=>dl,GroupMetadata:()=>aD,HeadingPitchRange:()=>ju,HeadingPitchRoll:()=>Yf,Heap:()=>wP,HeightReference:()=>ze,HeightmapEncoding:()=>km,HeightmapTerrainData:()=>Fa,HeightmapTessellator:()=>xS,HermitePolynomialApproximation:()=>pO,HermiteSpline:()=>_y,HilbertOrder:()=>XS,HomeButton:()=>i8,HomeButtonViewModel:()=>t8,HorizontalOrigin:()=>gi,I3dmLoader:()=>x2,I3dmParser:()=>nb,Iau2000Orientation:()=>gO,Iau2006XysData:()=>jP,Iau2006XysSample:()=>nA,IauOrientationAxes:()=>yO,IauOrientationParameters:()=>_O,ImageBasedLighting:()=>Pc,ImageBasedLightingPipelineStage:()=>xF,ImageMaterialProperty:()=>nx,Imagery:()=>x1,ImageryLayer:()=>Nf,ImageryLayerCollection:()=>VU,ImageryLayerFeatureInfo:()=>Tm,ImageryProvider:()=>Il,ImageryState:()=>ui,Implicit3DTileContent:()=>ga,ImplicitAvailabilityBitstream:()=>Rg,ImplicitMetadataView:()=>gl,ImplicitSubdivisionScheme:()=>cs,ImplicitSubtree:()=>gs,ImplicitSubtreeMetadata:()=>AN,ImplicitTileCoordinates:()=>hr,ImplicitTileset:()=>lD,IndexDatatype:()=>Le,InfoBox:()=>s8,InfoBoxViewModel:()=>r8,InspectorShared:()=>Z0,InstanceAttributeSemantic:()=>Zo,Instanced3DModel3DTileContent:()=>FN,InstancingPipelineStage:()=>vF,InterpolationAlgorithm:()=>$ee,InterpolationType:()=>Bh,Intersect:()=>Jt,IntersectionTests:()=>er,Intersections2D:()=>I_,Interval:()=>$c,InvertClassification:()=>v1,Ion:()=>vh,IonGeocoderService:()=>CO,IonImageryProvider:()=>L0,IonResource:()=>Dh,IonWorldImageryStyle:()=>N0,Iso8601:()=>ke,JobScheduler:()=>ZU,JobType:()=>ss,JsonMetadataTable:()=>Td,JulianDate:()=>ee,KTX2Transcoder:()=>AO,KeyboardEventModifier:()=>ha,KmlCamera:()=>$V,KmlDataSource:()=>lk,KmlLookAt:()=>ZV,KmlTour:()=>QV,KmlTourFlyTo:()=>tk,KmlTourWait:()=>nk,Label:()=>xx,LabelCollection:()=>Bp,LabelGraphics:()=>Hh,LabelStyle:()=>$r,LabelVisualizer:()=>p3,LagrangePolynomialApproximation:()=>TO,LeapSecond:()=>Wi,Light:()=>Y0e,LightingModel:()=>Gp,LightingPipelineStage:()=>XF,LinearApproximation:()=>XA,LinearSpline:()=>jm,ManagedArray:()=>qu,MapMode2D:()=>bu,MapProjection:()=>nte,MapboxImageryProvider:()=>Yk,MapboxStyleImageryProvider:()=>K0e,Mars3DEx:()=>g_e,Material:()=>cr,MaterialAppearance:()=>lr,MaterialPipelineStage:()=>$F,MaterialProperty:()=>lo,Math:()=>M,Matrix2:()=>Ri,Matrix3:()=>Q,Matrix4:()=>N,MetadataClass:()=>$h,MetadataClassProperty:()=>dx,MetadataComponentType:()=>Dn,MetadataEntity:()=>Nn,MetadataEnum:()=>IN,MetadataEnumValue:()=>PN,MetadataPipelineStage:()=>Hp,MetadataSchema:()=>Zh,MetadataSchemaLoader:()=>of,MetadataSemantic:()=>RN,MetadataTable:()=>hd,MetadataTableProperty:()=>bN,MetadataType:()=>Fn,MipmapHint:()=>cp,Model:()=>bp,ModelAlphaOptions:()=>zv,ModelAnimation:()=>uN,ModelAnimationCache:()=>ux,ModelAnimationCollection:()=>dN,ModelAnimationLoop:()=>Xr,ModelAnimationState:()=>Ws,ModelClippingPlanesPipelineStage:()=>TF,ModelColorPipelineStage:()=>bx,ModelComponents:()=>kt,ModelExperimental:()=>wi,ModelExperimental3DTileContent:()=>Rr,ModelExperimentalAnimation:()=>dF,ModelExperimentalAnimationChannel:()=>fF,ModelExperimentalAnimationCollection:()=>mF,ModelExperimentalArticulation:()=>Hg,ModelExperimentalArticulationStage:()=>Tx,ModelExperimentalDrawCommand:()=>pF,ModelExperimentalNode:()=>yb,ModelExperimentalRuntimeNode:()=>om,ModelExperimentalRuntimePrimitive:()=>xb,ModelExperimentalSceneGraph:()=>Aa,ModelExperimentalSkin:()=>wx,ModelExperimentalStatistics:()=>am,ModelExperimentalType:()=>Os,ModelExperimentalUtility:()=>Ut,ModelFeature:()=>pf,ModelFeatureTable:()=>Gr,ModelGraphics:()=>mg,ModelInstance:()=>LN,ModelInstanceCollection:()=>NN,ModelLightingOptions:()=>jv,ModelLoadResources:()=>jT,ModelMaterial:()=>mN,ModelMatrixUpdateStage:()=>DF,ModelMesh:()=>pN,ModelNode:()=>_N,ModelOutlineLoader:()=>Kw,ModelRenderResources:()=>Hv,ModelSilhouettePipelineStage:()=>d2,ModelSplitterPipelineStage:()=>m2,ModelUtility:()=>$t,ModelVisualizer:()=>_3,Moon:()=>e4,MorphTargetsPipelineStage:()=>JF,MorphWeightSpline:()=>EO,MortonOrder:()=>Ly,Multiple3DTileContent:()=>Bc,MultisampleFramebuffer:()=>zN,NavigationHelpButton:()=>l8,NavigationHelpButtonViewModel:()=>a8,NearFarScalar:()=>St,NeverTileDiscardPolicy:()=>$0e,NodeRenderResources:()=>Wv,NodeStatisticsPipelineStage:()=>PF,NodeTransformationProperty:()=>LT,OIT:()=>n4,Occluder:()=>DO,OctahedralProjectedCubeMap:()=>Xl,OffsetGeometryInstanceAttribute:()=>nr,OpenCageGeocoderService:()=>ate,OpenStreetMapImageryProvider:()=>FE,OrderedGroundPrimitiveCollection:()=>r3,OrientedBoundingBox:()=>Ai,OrthographicFrustum:()=>en,OrthographicOffCenterFrustum:()=>Xo,Packable:()=>cte,PackableForInterpolation:()=>lte,Particle:()=>I1,ParticleBurst:()=>tye,ParticleEmitter:()=>iye,ParticleSystem:()=>sye,Pass:()=>Ce,PassState:()=>Hc,PathGraphics:()=>pg,PathVisualizer:()=>g3,PeliasGeocoderService:()=>xO,PerInstanceColorAppearance:()=>rn,PerformanceDisplay:()=>H0,PerformanceWatchdog:()=>d8,PerformanceWatchdogViewModel:()=>u8,PerspectiveFrustum:()=>bi,PerspectiveOffCenterFrustum:()=>cl,PickDepth:()=>s4,PickDepthFramebuffer:()=>a4,PickFramebuffer:()=>c4,Picking:()=>_4,PickingPipelineStage:()=>QF,PinBuilder:()=>X_,PixelDatatype:()=>qe,PixelFormat:()=>ct,Plane:()=>an,PlaneGeometry:()=>RO,PlaneGeometryUpdater:()=>a3,PlaneGraphics:()=>OL,PlaneOutlineGeometry:()=>BO,PntsLoader:()=>gf,PntsParser:()=>rb,PointCloud:()=>ob,PointCloud3DTileContent:()=>GN,PointCloudEyeDomeLighting:()=>Lg,PointCloudShading:()=>_d,PointCloudStylingPipelineStage:()=>t2,PointGraphics:()=>FT,PointPrimitive:()=>Js,PointPrimitiveCollection:()=>mD,PointVisualizer:()=>y3,PolygonGeometry:()=>tT,PolygonGeometryLibrary:()=>Hn,PolygonGeometryUpdater:()=>c3,PolygonGraphics:()=>Gh,PolygonHierarchy:()=>ul,PolygonOutlineGeometry:()=>FO,PolygonPipeline:()=>si,Polyline:()=>gd,PolylineArrowMaterialProperty:()=>gD,PolylineCollection:()=>kg,PolylineColorAppearance:()=>os,PolylineDashMaterialProperty:()=>yD,PolylineGeometry:()=>Z_,PolylineGeometryUpdater:()=>C3,PolylineGlowMaterialProperty:()=>xD,PolylineGraphics:()=>vc,PolylineMaterialAppearance:()=>pa,PolylineOutlineMaterialProperty:()=>Gx,PolylinePipeline:()=>Ni,PolylineVisualizer:()=>T3,PolylineVolumeGeometry:()=>VO,PolylineVolumeGeometryLibrary:()=>wh,PolylineVolumeGeometryUpdater:()=>l3,PolylineVolumeGraphics:()=>VT,PolylineVolumeOutlineGeometry:()=>kO,PositionProperty:()=>hg,PositionPropertyArray:()=>i0,PostProcessStage:()=>Sr,PostProcessStageCollection:()=>N4,PostProcessStageComposite:()=>Ml,PostProcessStageLibrary:()=>nh,PostProcessStageSampleMode:()=>kf,PostProcessStageTextureCache:()=>GE,Primitive:()=>Tn,PrimitiveCollection:()=>du,PrimitiveLoadPlan:()=>gb,PrimitiveOutlineGenerator:()=>im,PrimitiveOutlinePipelineStage:()=>r2,PrimitivePipeline:()=>ET,PrimitiveRenderResources:()=>qv,PrimitiveState:()=>Lo,PrimitiveStatisticsPipelineStage:()=>o2,PrimitiveType:()=>Me,ProjectionPicker:()=>_8,ProjectionPickerViewModel:()=>m8,Property:()=>Y,PropertyArray:()=>CD,PropertyAttribute:()=>Vp,PropertyAttributeProperty:()=>pb,PropertyBag:()=>ql,PropertyTable:()=>Tl,PropertyTexture:()=>mb,PropertyTextureProperty:()=>cF,ProviderViewModel:()=>Bs,Proxy:()=>Ite,QuadraticRealPolynomial:()=>Zc,QuadtreeOccluders:()=>kU,QuadtreePrimitive:()=>jU,QuadtreeTile:()=>zU,QuadtreeTileLoadState:()=>oa,QuadtreeTileProvider:()=>Mye,QuantizedMeshTerrainData:()=>pA,QuarticRealPolynomial:()=>VP,Quaternion:()=>Re,QuaternionSpline:()=>iT,Queue:()=>rl,Ray:()=>En,Rectangle:()=>he,RectangleCollisionChecker:()=>rT,RectangleGeometry:()=>aT,RectangleGeometryLibrary:()=>Ss,RectangleGeometryUpdater:()=>u3,RectangleGraphics:()=>Wh,RectangleOutlineGeometry:()=>uT,ReferenceFrame:()=>sr,ReferenceProperty:()=>o0,RenderState:()=>Ve,Renderbuffer:()=>sf,RenderbufferFormat:()=>Cl,Request:()=>oo,RequestErrorEvent:()=>Bm,RequestScheduler:()=>uc,RequestState:()=>mi,RequestType:()=>ro,Resource:()=>De,ResourceCache:()=>Ar,ResourceCacheKey:()=>ou,ResourceCacheStatistics:()=>Dp,ResourceLoader:()=>hi,ResourceLoaderState:()=>Vt,Rotation:()=>Id,RuntimeError:()=>fe,S2Cell:()=>ng,SDFSettings:()=>Xs,SampledPositionProperty:()=>ba,SampledProperty:()=>Ef,Sampler:()=>on,ScaledPositionProperty:()=>Qp,Scene:()=>Q4,SceneFramebuffer:()=>VE,SceneMode:()=>te,SceneMode2DPipelineStage:()=>s2,SceneModePicker:()=>C8,SceneModePickerViewModel:()=>y8,SceneTransforms:()=>rr,SceneTransitioner:()=>V4,ScreenSpaceCameraController:()=>Y4,ScreenSpaceEventHandler:()=>Ku,ScreenSpaceEventType:()=>_n,SelectedFeatureIdPipelineStage:()=>Sx,SelectionIndicator:()=>E8,SelectionIndicatorViewModel:()=>T8,ShaderBuilder:()=>Rs,ShaderCache:()=>dk,ShaderDestination:()=>Se,ShaderFunction:()=>Dx,ShaderProgram:()=>Wt,ShaderSource:()=>Fe,ShaderStruct:()=>vx,ShadowMap:()=>W0,ShadowMapShader:()=>c_,ShadowMode:()=>Zt,ShadowVolumeAppearance:()=>ef,ShowGeometryInstanceAttribute:()=>gn,Simon1994PlanetaryPositions:()=>Wy,SimplePolylineGeometry:()=>Hne,SingleTileImageryProvider:()=>Xk,SkinningPipelineStage:()=>c2,SkyAtmosphere:()=>nz,SkyBox:()=>sz,SphereEmitter:()=>vxe,SphereGeometry:()=>Gne,SphereOutlineGeometry:()=>og,Spherical:()=>$O,Spline:()=>qi,SplitDirection:()=>as,Splitter:()=>vg,StaticGeometryColorBatch:()=>Ld,StaticGeometryPerMaterialBatch:()=>Fd,StaticGroundGeometryColorBatch:()=>vD,StaticGroundGeometryPerMaterialBatch:()=>d3,StaticGroundPolylinePerMaterialBatch:()=>A3,StaticOutlineGeometryBatch:()=>DD,StencilConstants:()=>tn,StencilFunction:()=>yi,StencilOperation:()=>Ft,SteppedSpline:()=>ZO,StripeMaterialProperty:()=>AD,StripeOrientation:()=>dm,StructuralMetadata:()=>Ka,StyleCommandsNeeded:()=>Mc,StyleExpression:()=>Dxe,Sun:()=>uz,SunLight:()=>I0,SunPostProcess:()=>$4,SupportedImageFormats:()=>Ov,SvgPathBindingHandler:()=>pz,TaskProcessor:()=>Mi,TerrainData:()=>gh,TerrainEncoding:()=>mc,TerrainExaggeration:()=>el,TerrainFillMesh:()=>T1,TerrainMesh:()=>Kf,TerrainOffsetProperty:()=>zT,TerrainProvider:()=>ns,TerrainQuantization:()=>Vs,TerrainState:()=>Er,Texture:()=>wt,TextureAtlas:()=>gx,TextureCache:()=>hk,TextureMagnificationFilter:()=>Xi,TextureManager:()=>Om,TextureMinificationFilter:()=>It,TextureUniform:()=>CX,TextureWrap:()=>mn,TileAvailability:()=>yh,TileBoundingRegion:()=>wd,TileBoundingS2Cell:()=>D2,TileBoundingSphere:()=>$g,TileBoundingVolume:()=>Pxe,TileCoordinatesImageryProvider:()=>fz,TileDiscardPolicy:()=>Ixe,TileEdge:()=>pn,TileImagery:()=>C1,TileMapServiceImageryProvider:()=>cC,TileMetadata:()=>cu,TileOrientedBoundingBox:()=>vd,TileProviderError:()=>jn,TileReplacementQueue:()=>GU,TileSelectionResult:()=>Kn,TileState:()=>Oxe,Tileset3DTileContent:()=>WN,TilesetMetadata:()=>I2,TilingScheme:()=>Wne,TimeConstants:()=>Yn,TimeDynamicImagery:()=>IE,TimeDynamicPointCloud:()=>X1,TimeInterval:()=>Cn,TimeIntervalCollection:()=>$o,TimeIntervalCollectionPositionProperty:()=>a0,TimeIntervalCollectionProperty:()=>c0,TimeStandard:()=>Wn,Timeline:()=>v8,TimelineHighlightRange:()=>S8,TimelineTrack:()=>w8,Tipsify:()=>xI,ToggleButtonViewModel:()=>IC,Tonemapper:()=>AC,Transforms:()=>yt,TranslationRotationScale:()=>sp,TranslucentTileClassification:()=>f4,TridiagonalSystemSolver:()=>bS,TrustedServers:()=>aS,Tween:()=>Ti.default,TweenCollection:()=>WE,UniformState:()=>mk,UniformType:()=>oP,Uri:()=>oi.default,UrlTemplateImageryProvider:()=>oc,VERSION:()=>lAt,VRButton:()=>O8,VRButtonViewModel:()=>P8,VRTheWorldTerrainProvider:()=>Kne,VaryingType:()=>uAe,Vector3DTileBatch:()=>rf,Vector3DTileClampedPolylines:()=>sF,Vector3DTileContent:()=>aF,Vector3DTileGeometry:()=>Og,Vector3DTilePoints:()=>tF,Vector3DTilePolygons:()=>nF,Vector3DTilePolylines:()=>hb,Vector3DTilePrimitive:()=>Eg,VelocityOrientationProperty:()=>K2,VelocityVectorProperty:()=>Ub,VertexArray:()=>Qn,VertexArrayFacade:()=>Ng,VertexAttributeSemantic:()=>jt,VertexFormat:()=>Pe,VerticalOrigin:()=>vn,VideoSynchronizer:()=>Yne,View:()=>UE,Viewer:()=>VAe,ViewportQuad:()=>Lxe,Visibility:()=>xo,Visualizer:()=>__e,VulkanConstants:()=>$ne,WallGeometry:()=>tR,WallGeometryLibrary:()=>yT,WallGeometryUpdater:()=>h3,WallGraphics:()=>_g,WallOutlineGeometry:()=>nR,WebGLConstants:()=>Z,WebMapServiceImageryProvider:()=>$k,WebMapTileServiceImageryProvider:()=>Zk,WebMercatorProjection:()=>ji,WebMercatorTilingScheme:()=>is,WindingOrder:()=>hs,WireframeIndexGenerator:()=>hw,WireframePipelineStage:()=>l2,_shadersAcesTonemappingStage:()=>g4,_shadersAdditiveBlend:()=>X4,_shadersAdjustTranslucentFS:()=>P1,_shadersAllMaterialAppearanceFS:()=>oR,_shadersAllMaterialAppearanceVS:()=>sR,_shadersAmbientOcclusionGenerate:()=>y4,_shadersAmbientOcclusionModulate:()=>x4,_shadersAspectRampMaterial:()=>pR,_shadersAtmosphereCommon:()=>k0,_shadersBasicMaterialAppearanceFS:()=>aR,_shadersBasicMaterialAppearanceVS:()=>cR,_shadersBillboardCollectionFS:()=>jN,_shadersBillboardCollectionVS:()=>qN,_shadersBlackAndWhite:()=>C4,_shadersBloomComposite:()=>A4,_shadersBrdfLutGeneratorFS:()=>Tk,_shadersBrightPass:()=>K4,_shadersBrightness:()=>T4,_shadersBumpMapMaterial:()=>_R,_shadersCPUStylingStageFS:()=>zF,_shadersCPUStylingStageVS:()=>UF,_shadersCheckerboardMaterial:()=>gR,_shadersCloudCollectionFS:()=>Lk,_shadersCloudCollectionVS:()=>Nk,_shadersCloudNoiseFS:()=>Fk,_shadersCloudNoiseVS:()=>Vk,_shadersCompareAndPackTranslucentDepth:()=>u4,_shadersCompositeOITFS:()=>t4,_shadersCompositeTranslucentClassification:()=>kE,_shadersContrastBias:()=>b4,_shadersCustomShaderStageFS:()=>MF,_shadersCustomShaderStageVS:()=>RF,_shadersCzmBuiltins:()=>TT,_shadersDepthOfField:()=>E4,_shadersDepthPlaneFS:()=>rU,_shadersDepthPlaneVS:()=>oU,_shadersDepthView:()=>S4,_shadersDepthViewPacked:()=>fAe,_shadersDotMaterial:()=>yR,_shadersEdgeDetection:()=>w4,_shadersElevationBandMaterial:()=>xR,_shadersElevationContourMaterial:()=>CR,_shadersElevationRampMaterial:()=>AR,_shadersEllipsoidFS:()=>_1,_shadersEllipsoidSurfaceAppearanceFS:()=>dU,_shadersEllipsoidSurfaceAppearanceVS:()=>hU,_shadersEllipsoidVS:()=>g1,_shadersFXAA:()=>D4,_shadersFXAA3_11:()=>B4,_shadersFadeMaterial:()=>TR,_shadersFeatureIdStageFS:()=>BF,_shadersFeatureIdStageVS:()=>LF,_shadersFilmicTonemapping:()=>v4,_shadersGaussianBlur1D:()=>xC,_shadersGeometryStageFS:()=>WF,_shadersGeometryStageVS:()=>jF,_shadersGlobeFS:()=>xU,_shadersGlobeVS:()=>CU,_shadersGridMaterial:()=>bR,_shadersGroundAtmosphere:()=>y1,_shadersHSBToRGB:()=>cB,_shadersHSLToRGB:()=>lB,_shadersImageBasedLightingStageFS:()=>yF,_shadersInstancingStageCommon:()=>bF,_shadersInstancingStageVS:()=>EF,_shadersLegacyInstancingStageVS:()=>SF,_shadersLensFlare:()=>P4,_shadersLightingStageFS:()=>YF,_shadersMaterialStageFS:()=>KF,_shadersMetadataStageFS:()=>NF,_shadersMetadataStageVS:()=>FF,_shadersModelClippingPlanesStageFS:()=>AF,_shadersModelColorStageFS:()=>CF,_shadersModelExperimentalFS:()=>_F,_shadersModelExperimentalVS:()=>gF,_shadersModelSilhouetteStageFS:()=>u2,_shadersModelSilhouetteStageVS:()=>f2,_shadersModelSplitterStageFS:()=>h2,_shadersModifiedReinhardTonemapping:()=>I4,_shadersMorphTargetsStageVS:()=>ZF,_shadersNightVision:()=>O4,_shadersNormalMapMaterial:()=>ER,_shadersOctahedralProjectionAtlasFS:()=>ML,_shadersOctahedralProjectionFS:()=>BL,_shadersOctahedralProjectionVS:()=>LL,_shadersPassThrough:()=>vu,_shadersPassThroughDepth:()=>fC,_shadersPerInstanceColorAppearanceFS:()=>MR,_shadersPerInstanceColorAppearanceVS:()=>BR,_shadersPerInstanceFlatColorAppearanceFS:()=>CT,_shadersPerInstanceFlatColorAppearanceVS:()=>LR,_shadersPointCloudEyeDomeLighting:()=>HN,_shadersPointCloudStylingStageVS:()=>e2,_shadersPointPrimitiveCollectionFS:()=>zx,_shadersPointPrimitiveCollectionVS:()=>W2,_shadersPolylineArrowMaterial:()=>SR,_shadersPolylineColorAppearanceVS:()=>PL,_shadersPolylineCommon:()=>tf,_shadersPolylineDashMaterial:()=>wR,_shadersPolylineFS:()=>vT,_shadersPolylineGlowMaterial:()=>vR,_shadersPolylineMaterialAppearanceVS:()=>IL,_shadersPolylineOutlineMaterial:()=>DR,_shadersPolylineShadowVolumeFS:()=>SL,_shadersPolylineShadowVolumeMorphFS:()=>wL,_shadersPolylineShadowVolumeMorphVS:()=>vL,_shadersPolylineShadowVolumeVS:()=>DL,_shadersPolylineVS:()=>JN,_shadersPrimitiveOutlineStageFS:()=>i2,_shadersPrimitiveOutlineStageVS:()=>n2,_shadersRGBToHSB:()=>LB,_shadersRGBToHSL:()=>NB,_shadersRGBToXYZ:()=>FB,_shadersReinhardTonemapping:()=>R4,_shadersReprojectWebMercatorFS:()=>TU,_shadersReprojectWebMercatorVS:()=>bU,_shadersRimLightingMaterial:()=>PR,_shadersSelectedFeatureIdStageCommon:()=>kv,_shadersShadowVolumeAppearanceFS:()=>Tw,_shadersShadowVolumeAppearanceVS:()=>yL,_shadersShadowVolumeFS:()=>Zy,_shadersSilhouette:()=>M4,_shadersSkinningStageVS:()=>a2,_shadersSkyAtmosphereCommon:()=>G1,_shadersSkyAtmosphereFS:()=>ez,_shadersSkyAtmosphereVS:()=>tz,_shadersSkyBoxFS:()=>iz,_shadersSkyBoxVS:()=>rz,_shadersSlopeRampMaterial:()=>IR,_shadersStripeMaterial:()=>OR,_shadersSunFS:()=>az,_shadersSunTextureFS:()=>cz,_shadersSunVS:()=>lz,_shadersTexturedMaterialAppearanceFS:()=>lR,_shadersTexturedMaterialAppearanceVS:()=>uR,_shadersVector3DTileClampedPolylinesFS:()=>oF,_shadersVector3DTileClampedPolylinesVS:()=>rF,_shadersVector3DTilePolylinesVS:()=>iF,_shadersVectorTileVS:()=>jw,_shadersViewportQuadFS:()=>dz,_shadersViewportQuadVS:()=>_E,_shadersWater:()=>RR,_shadersXYZToRGB:()=>sL,_shadersacesTonemapping:()=>RM,_shadersalphaWeight:()=>MM,_shadersantialias:()=>BM,_shadersapproximateSphericalCoordinates:()=>LM,_shadersbackFacing:()=>NM,_shadersbranchFreeTernary:()=>FM,_shaderscascadeColor:()=>VM,_shaderscascadeDistance:()=>kM,_shaderscascadeMatrix:()=>UM,_shaderscascadeWeights:()=>zM,_shaderscolumbusViewMorph:()=>HM,_shaderscomputePosition:()=>GM,_shaderscosineAndSine:()=>WM,_shadersdecompressTextureCoordinates:()=>jM,_shadersdefaultPbrMaterial:()=>qM,_shadersdegreesPerRadian:()=>UR,_shadersdepthClamp:()=>YM,_shadersdepthRange:()=>zR,_shadersdepthRangeStruct:()=>bM,_shaderseastNorthUpToEyeCoordinates:()=>XM,_shadersellipsoidContainsPoint:()=>KM,_shadersellipsoidWgs84TextureCoordinates:()=>$M,_shadersepsilon1:()=>HR,_shadersepsilon2:()=>GR,_shadersepsilon3:()=>WR,_shadersepsilon4:()=>jR,_shadersepsilon5:()=>qR,_shadersepsilon6:()=>YR,_shadersepsilon7:()=>XR,_shadersequalsEpsilon:()=>ZM,_shaderseyeOffset:()=>JM,_shaderseyeToWindowCoordinates:()=>QM,_shadersfastApproximateAtan:()=>eB,_shadersfog:()=>tB,_shadersfromCartesian:()=>aL,_shadersgammaCorrect:()=>nB,_shadersgeodeticSurfaceNormal:()=>iB,_shadersgetDefaultMaterial:()=>rB,_shadersgetFloodRect:()=>cL,_shadersgetIndexMat:()=>lL,_shadersgetLambertDiffuse:()=>oB,_shadersgetMaxIndex:()=>uL,_shadersgetMaxIndexVal:()=>fL,_shadersgetSpecular:()=>sB,_shadersgetWaterNoise:()=>aB,_shadershue:()=>uB,_shadersinfinity:()=>KR,_shadersinverseGamma:()=>fB,_shadersisEmpty:()=>dB,_shadersisFull:()=>hB,_shadersisInEllipsoid:()=>dL,_shadersisInObliq:()=>hL,_shaderslatitudeToWebMercatorFraction:()=>mB,_shaderslineDistance:()=>_B,_shaderslinearToSrgb:()=>pB,_shadersluminance:()=>gB,_shadersmagnitude:()=>mL,_shadersmagnitudeSquared:()=>pL,_shadersmaterial:()=>EM,_shadersmaterialInput:()=>SM,_shadersmetersPerPixel:()=>yB,_shadersmodelMaterial:()=>wM,_shadersmodelToWindowCoordinates:()=>xB,_shadersmodelVertexOutput:()=>vM,_shadersmultiplyComponents:()=>_L,_shadersmultiplyWithColorBalance:()=>CB,_shadersnearFarScalar:()=>AB,_shadersoctDecode:()=>TB,_shadersoneOverPi:()=>$R,_shadersoneOverTwoPi:()=>ZR,_shaderspackDepth:()=>bB,_shaderspassCesium3DTile:()=>JR,_shaderspassCesium3DTileClassification:()=>QR,_shaderspassCesium3DTileClassificationIgnoreShow:()=>eM,_shaderspassClassification:()=>tM,_shaderspassCompute:()=>nM,_shaderspassEnvironment:()=>iM,_shaderspassGlobe:()=>rM,_shaderspassOpaque:()=>oM,_shaderspassOverlay:()=>sM,_shaderspassTerrainClassification:()=>aM,_shaderspassTranslucent:()=>cM,_shaderspbrLighting:()=>EB,_shaderspbrMetallicRoughnessMaterial:()=>SB,_shaderspbrParameters:()=>DM,_shaderspbrSpecularGlossinessMaterial:()=>wB,_shadersphong:()=>vB,_shaderspi:()=>lM,_shaderspiOverFour:()=>uM,_shaderspiOverSix:()=>fM,_shaderspiOverThree:()=>dM,_shaderspiOverTwo:()=>hM,_shadersplaneDistance:()=>DB,_shaderspointAlongRay:()=>PB,_shadersradiansPerDegree:()=>mM,_shadersray:()=>PM,_shadersrayEllipsoidIntersectionInterval:()=>IB,_shadersraySegment:()=>IM,_shadersraySphereIntersectionInterval:()=>OB,_shadersreadDepth:()=>RB,_shadersreadNonPerspective:()=>MB,_shadersreverseLogDepth:()=>BB,_shadersround:()=>VB,_shaderssampleOctahedralProjection:()=>kB,_shaderssaturation:()=>UB,_shadersscaleToGeodeticSurface:()=>gL,_shaderssceneMode2D:()=>pM,_shaderssceneMode3D:()=>_M,_shaderssceneModeColumbusView:()=>gM,_shaderssceneModeMorphing:()=>yM,_shadersshadowDepthCompare:()=>zB,_shadersshadowParameters:()=>OM,_shadersshadowVisibility:()=>HB,_shaderssignNotZero:()=>GB,_shaderssolarRadius:()=>xM,_shaderssphericalHarmonics:()=>WB,_shaderssrgbToLinear:()=>jB,_shaderstangentToEyeSpaceMatrix:()=>qB,_shadersthreePiOver2:()=>CM,_shaderstransformPlane:()=>YB,_shaderstranslateRelativeToEye:()=>XB,_shaderstranslucentPhong:()=>KB,_shaderstranspose:()=>$B,_shaderstwoPi:()=>AM,_shadersunpackDepth:()=>ZB,_shadersunpackFloat:()=>JB,_shadersunpackUint:()=>QB,_shadersvalueTransform:()=>eL,_shadersvertexLogDepth:()=>tL,_shaderswebMercatorMaxLatitude:()=>TM,_shaderswindowToEyeCoordinates:()=>nL,_shaderswriteDepthClamp:()=>iL,_shaderswriteLogDepth:()=>rL,_shaderswriteNonPerspective:()=>oL,addBuffer:()=>jL,addDefaults:()=>Cg,addExtensionsRequired:()=>HL,addExtensionsUsed:()=>Yh,addPipelineExtras:()=>yp,addToArray:()=>fr,appendForwardSlash:()=>hP,arrayRemoveDuplicates:()=>vr,barycentricCoordinates:()=>uA,binarySearch:()=>ao,bitmap_sdf:()=>_v.default,buildDrawCommand:()=>Bv,buildModuleUrl:()=>Qt,cancelAnimationFrame:()=>gZ,clone:()=>$e,combine:()=>rt,computeFlyToLocationForRectangle:()=>bE,createBillboardPointCallback:()=>lb,createCommand:()=>An,createDefaultImageryProviderViewModels:()=>Vz,createDefaultTerrainProviderViewModels:()=>kz,createElevationBandMaterial:()=>yge,createGuid:()=>Ln,createMaterialPropertyDescriptor:()=>kr,createOsmBuildings:()=>xge,createPropertyDescriptor:()=>le,createRawPropertyDescriptor:()=>jl,createTangentSpaceDebugPrimitive:()=>Cge,createTaskProcessorWorker:()=>WAe,createUniform:()=>NR,createUniformArray:()=>FR,createWorldImagery:()=>F0,createWorldTerrain:()=>KI,decodeGoogleEarthEnterpriseData:()=>JI,decodeVectorPolylinePositions:()=>QI,defaultValue:()=>y,defer:()=>ts,defined:()=>l,deprecationWarning:()=>di,destroyObject:()=>ue,dompurify:()=>dS.default,earcut:()=>RS.default,exportKml:()=>wme,findAccessorMinMax:()=>Gw,findContentMetadata:()=>Tb,findGroupMetadata:()=>Mx,findTileMetadata:()=>S2,forEachTextureInMaterial:()=>Ww,formatError:()=>Gm,freezeRenderState:()=>lie,getAbsoluteUri:()=>Wf,getAccessorByteStride:()=>_s,getBaseUri:()=>bP,getBinaryAccessor:()=>nf,getClipAndStyleCode:()=>eb,getClippingFunction:()=>wg,getComponentReader:()=>Ag,getElement:()=>Pn,getExtensionFromUri:()=>jC,getFilenameFromUri:()=>W_,getImageFromTypedArray:()=>sO,getImagePixels:()=>ch,getJsonFromTypedArray:()=>Vr,getMagic:()=>Gu,getStringFromTypedArray:()=>fa,getTimestamp:()=>Bi,grapheme_splitter:()=>Cv.default,hasExtension:()=>ir,heightReferenceOnEntityPropertyChanged:()=>gg,isBitSet:()=>Tc,isBlobUri:()=>qC,isCrossOriginUrl:()=>YC,isDataUri:()=>m_,isLeapYear:()=>x_,jsep:()=>ax.default,kdbush:()=>pD.default,knockout:()=>xe,knockout_3_5_1:()=>XE,knockout_es5:()=>mz,ktx_parse:()=>rX.read,lerc:()=>oX.default,loadAndExecuteScript:()=>XC,loadCubeMap:()=>_k,loadImageFromTypedArray:()=>Y_,loadKTX2:()=>Ua,mergeSort:()=>By,mersenne_twister:()=>ah.default,meshoptimizer:()=>rv.MeshoptDecoder,modernizeShader:()=>kR,moveTechniqueRenderStates:()=>zL,moveTechniquesToExtension:()=>GL,nosleep:()=>J1.default,numberOfComponentsForType:()=>ps,objectToQuery:()=>KC,oneTimeWarning:()=>Lt,pako:()=>yX.default,parseBatchTable:()=>bd,parseBoundingVolumeSemantics:()=>av,parseFeatureMetadataLegacy:()=>Iv,parseGlb:()=>xp,parseResponseHeaders:()=>SP,parseStructuralMetadata:()=>Pv,pointInsideTriangle:()=>dte,preprocess3DTileContent:()=>Bx,processModelMaterialsCommon:()=>KT,processPbrMaterials:()=>$T,protobufjs:()=>WA,queryToObject:()=>Mu,rbush:()=>ow.default,readAccessorPacked:()=>qL,removeExtensionsRequired:()=>kL,removeExtensionsUsed:()=>UL,removePipelineExtras:()=>vN,removeUnusedElements:()=>WL,requestAnimationFrame:()=>$te,resizeImageToNextPowerOfTwo:()=>zy,sampleTerrain:()=>WO,sampleTerrainMostDetailed:()=>dT,scaleToGeodeticSurface:()=>UC,subdivideArray:()=>JO,subscribeAndEvaluate:()=>Pa,topojson:()=>mV,updateAccessorComponentTypes:()=>XL,updateVersion:()=>Tg,usesExtension:()=>Ur,viewerCesium3DTilesInspectorMixin:()=>kAe,viewerCesiumInspectorMixin:()=>UAe,viewerDragDropMixin:()=>HAe,viewerPerformanceWatchdogMixin:()=>GAe,webGLConstantToGlslType:()=>ag,wrapFunction:()=>iR,writeTextToCanvas:()=>$A,zip:()=>ec});module.exports=ZAe(uAt);function JAe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var hP=JAe;function QAe(e){return e!=null}var l=QAe;function iy(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(iy.prototype=Object.create(Error.prototype),iy.prototype.constructor=iy);iy.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
- ${this.stack.toString()}`),e};iy.throwInstantiationError=function(){throw new iy("This function defines an interface and should not be called directly.")};var ye=iy;var fs={};fs.typeOf={};function eTe(e){return`${e} is required, actual value was undefined`}function VC(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}fs.defined=function(e,t){if(!l(t))throw new ye(eTe(e))};fs.typeOf.func=function(e,t){if(typeof t!="function")throw new ye(VC(typeof t,"function",e))};fs.typeOf.string=function(e,t){if(typeof t!="string")throw new ye(VC(typeof t,"string",e))};fs.typeOf.number=function(e,t){if(typeof t!="number")throw new ye(VC(typeof t,"number",e))};fs.typeOf.number.lessThan=function(e,t,n){if(fs.typeOf.number(e,t),t>=n)throw new ye(`Expected ${e} to be less than ${n}, actual value was ${t}`)};fs.typeOf.number.lessThanOrEquals=function(e,t,n){if(fs.typeOf.number(e,t),t>n)throw new ye(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};fs.typeOf.number.greaterThan=function(e,t,n){if(fs.typeOf.number(e,t),t<=n)throw new ye(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};fs.typeOf.number.greaterThanOrEquals=function(e,t,n){if(fs.typeOf.number(e,t),t<n)throw new ye(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};fs.typeOf.object=function(e,t){if(typeof t!="object")throw new ye(VC(typeof t,"object",e))};fs.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new ye(VC(typeof t,"boolean",e))};fs.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new ye(VC(typeof t,"bigint",e))};fs.typeOf.number.equals=function(e,t,n,i){if(fs.typeOf.number(e,n),fs.typeOf.number(t,i),n!==i)throw new ye(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var Nl=fs;function LX(e,t){return e??t}LX.EMPTY_OBJECT=Object.freeze({});var y=LX;var ah=Ns(FX(),1);var et={};et.EPSILON1=.1;et.EPSILON2=.01;et.EPSILON3=.001;et.EPSILON4=1e-4;et.EPSILON5=1e-5;et.EPSILON6=1e-6;et.EPSILON7=1e-7;et.EPSILON8=1e-8;et.EPSILON9=1e-9;et.EPSILON10=1e-10;et.EPSILON11=1e-11;et.EPSILON12=1e-12;et.EPSILON13=1e-13;et.EPSILON14=1e-14;et.EPSILON15=1e-15;et.EPSILON16=1e-16;et.EPSILON17=1e-17;et.EPSILON18=1e-18;et.EPSILON19=1e-19;et.EPSILON20=1e-20;et.EPSILON21=1e-21;et.GRAVITATIONALPARAMETER=3986004418e5;et.SOLAR_RADIUS=6955e5;et.LUNAR_RADIUS=1737400;et.SIXTY_FOUR_KILOBYTES=64*1024;et.FOUR_GIGABYTES=4*1024*1024*1024;et.sign=y(Math.sign,function(t){return t=+t,t===0||t!==t?t:t>0?1:-1});et.signNotZero=function(e){return e<0?-1:1};et.toSNorm=function(e,t){return t=y(t,255),Math.round((et.clamp(e,-1,1)*.5+.5)*t)};et.fromSNorm=function(e,t){return t=y(t,255),et.clamp(e,0,t)/t*2-1};et.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:et.clamp((e-t)/n,0,1)};et.sinh=y(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2});et.cosh=y(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2});et.lerp=function(e,t,n){return(1-n)*e+n*t};et.PI=Math.PI;et.ONE_OVER_PI=1/Math.PI;et.PI_OVER_TWO=Math.PI/2;et.PI_OVER_THREE=Math.PI/3;et.PI_OVER_FOUR=Math.PI/4;et.PI_OVER_SIX=Math.PI/6;et.THREE_PI_OVER_TWO=3*Math.PI/2;et.TWO_PI=2*Math.PI;et.ONE_OVER_TWO_PI=1/(2*Math.PI);et.RADIANS_PER_DEGREE=Math.PI/180;et.DEGREES_PER_RADIAN=180/Math.PI;et.RADIANS_PER_ARCSECOND=et.RADIANS_PER_DEGREE/3600;et.toRadians=function(e){return e*et.RADIANS_PER_DEGREE};et.toDegrees=function(e){return e*et.DEGREES_PER_RADIAN};et.convertLongitudeRange=function(e){let t=et.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};et.clampToLatitudeRange=function(e){return et.clamp(e,-1*et.PI_OVER_TWO,et.PI_OVER_TWO)};et.negativePiToPi=function(e){return e>=-et.PI&&e<=et.PI?e:et.zeroToTwoPi(e+et.PI)-et.PI};et.zeroToTwoPi=function(e){if(e>=0&&e<=et.TWO_PI)return e;let t=et.mod(e,et.TWO_PI);return Math.abs(t)<et.EPSILON14&&Math.abs(e)>et.EPSILON14?et.TWO_PI:t};et.mod=function(e,t){return et.sign(e)===et.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};et.equalsEpsilon=function(e,t,n,i){n=y(n,0),i=y(i,n);let r=Math.abs(e-t);return r<=i||r<=n*Math.max(Math.abs(e),Math.abs(t))};et.lessThan=function(e,t,n){return e-t<-n};et.lessThanOrEquals=function(e,t,n){return e-t<n};et.greaterThan=function(e,t,n){return e-t>n};et.greaterThanOrEquals=function(e,t,n){return e-t>-n};var mP=[1];et.factorial=function(e){let t=mP.length;if(e>=t){let n=mP[t-1];for(let i=t;i<=e;i++){let r=n*i;mP.push(r),n=r}}return mP[e]};et.incrementWrap=function(e,t,n){return n=y(n,0),++e,e>t&&(e=n),e};et.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};et.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};et.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};et.clamp=function(e,t,n){return e<t?t:e>n?n:e};var VX=new ah.default;et.setRandomNumberSeed=function(e){VX=new ah.default(e)};et.nextRandomNumber=function(){return VX.random()};et.randomBetween=function(e,t){return et.nextRandomNumber()*(t-e)+e};et.acosClamped=function(e){return Math.acos(et.clamp(e,-1,1))};et.asinClamped=function(e){return Math.asin(et.clamp(e,-1,1))};et.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};et.logBase=function(e,t){return Math.log(e)/Math.log(t)};et.cbrt=y(Math.cbrt,function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n});et.log2=y(Math.log2,function(t){return Math.log(t)*Math.LOG2E});et.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};et.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};et.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let r=Math.max(i,n);n=Math.min(i,n);let o=n/r;return i=et.fastApproximateAtan(o),i=Math.abs(t)>Math.abs(e)?et.PI_OVER_TWO-i:i,i=e<0?et.PI-i:i,i=t<0?-i:i,i};var M=et;function Xe(e,t,n){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0)}Xe.fromSpherical=function(e,t){l(t)||(t=new Xe);let n=e.clock,i=e.cone,r=y(e.magnitude,1),o=r*Math.sin(i);return t.x=o*Math.cos(n),t.y=o*Math.sin(n),t.z=r*Math.cos(i),t};Xe.fromElements=function(e,t,n,i){return l(i)?(i.x=e,i.y=t,i.z=n,i):new Xe(e,t,n)};Xe.clone=function(e,t){if(!!l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new Xe(e.x,e.y,e.z)};Xe.fromCartesian4=Xe.clone;Xe.packedLength=3;Xe.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};Xe.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Xe),n.x=e[t++],n.y=e[t++],n.z=e[t],n};Xe.packArray=function(e,t){let n=e.length,i=n*3;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)Xe.pack(e[r],t,r*3);return t};Xe.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){let r=i/3;t[r]=Xe.unpack(e,i,t[r])}return t};Xe.fromArray=Xe.unpack;Xe.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)};Xe.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)};Xe.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n};Xe.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n};Xe.clamp=function(e,t,n,i){let r=M.clamp(e.x,t.x,n.x),o=M.clamp(e.y,t.y,n.y),s=M.clamp(e.z,t.z,n.z);return i.x=r,i.y=o,i.z=s,i};Xe.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z};Xe.magnitude=function(e){return Math.sqrt(Xe.magnitudeSquared(e))};var _P=new Xe;Xe.distance=function(e,t){return Xe.subtract(e,t,_P),Xe.magnitude(_P)};Xe.distanceSquared=function(e,t){return Xe.subtract(e,t,_P),Xe.magnitudeSquared(_P)};Xe.normalize=function(e,t){let n=Xe.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t};Xe.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z};Xe.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n};Xe.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n};Xe.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n};Xe.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n};Xe.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};Xe.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};Xe.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t};Xe.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var kX=new Xe;Xe.lerp=function(e,t,n,i){return Xe.multiplyByScalar(t,n,kX),i=Xe.multiplyByScalar(e,1-n,i),Xe.add(kX,i,i)};var pP=new Xe,B8=new Xe;Xe.angleBetween=function(e,t){Xe.normalize(e,pP),Xe.normalize(t,B8);let n=Xe.dot(pP,B8),i=Xe.magnitude(Xe.cross(pP,B8,pP));return Math.atan2(i,n)};var tTe=new Xe;Xe.mostOrthogonalAxis=function(e,t){let n=Xe.normalize(e,tTe);return Xe.abs(n,n),n.x<=n.y?n.x<=n.z?t=Xe.clone(Xe.UNIT_X,t):t=Xe.clone(Xe.UNIT_Z,t):n.y<=n.z?t=Xe.clone(Xe.UNIT_Y,t):t=Xe.clone(Xe.UNIT_Z,t),t};Xe.projectVector=function(e,t,n){let i=Xe.dot(e,t)/Xe.dot(t,t);return Xe.multiplyByScalar(t,i,n)};Xe.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};Xe.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};Xe.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&M.equalsEpsilon(e.x,t.x,n,i)&&M.equalsEpsilon(e.y,t.y,n,i)&&M.equalsEpsilon(e.z,t.z,n,i)};Xe.cross=function(e,t,n){let i=e.x,r=e.y,o=e.z,s=t.x,a=t.y,c=t.z,u=r*c-o*a,f=o*s-i*c,d=i*a-r*s;return n.x=u,n.y=f,n.z=d,n};Xe.midpoint=function(e,t,n){return n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n};Xe.fromDegrees=function(e,t,n,i,r){return e=M.toRadians(e),t=M.toRadians(t),Xe.fromRadians(e,t,n,i,r)};var Ru=new Xe,kC=new Xe,nTe=new Xe(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);Xe.fromRadians=function(e,t,n,i,r){n=y(n,0);let o=l(i)?i.radiiSquared:nTe,s=Math.cos(t);Ru.x=s*Math.cos(e),Ru.y=s*Math.sin(e),Ru.z=Math.sin(t),Ru=Xe.normalize(Ru,Ru),Xe.multiplyComponents(o,Ru,kC);let a=Math.sqrt(Xe.dot(Ru,kC));return kC=Xe.divideByScalar(kC,a,kC),Ru=Xe.multiplyByScalar(Ru,n,Ru),l(r)||(r=new Xe),Xe.add(kC,Ru,r)};Xe.fromDegreesArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let r=0;r<i;r+=2){let o=e[r],s=e[r+1],a=r/2;n[a]=Xe.fromDegrees(o,s,0,t,n[a])}return n};Xe.fromRadiansArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let r=0;r<i;r+=2){let o=e[r],s=e[r+1],a=r/2;n[a]=Xe.fromRadians(o,s,0,t,n[a])}return n};Xe.fromDegreesArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let r=0;r<i;r+=3){let o=e[r],s=e[r+1],a=e[r+2],c=r/3;n[c]=Xe.fromDegrees(o,s,a,t,n[c])}return n};Xe.fromRadiansArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let r=0;r<i;r+=3){let o=e[r],s=e[r+1],a=e[r+2],c=r/3;n[c]=Xe.fromRadians(o,s,a,t,n[c])}return n};Xe.ZERO=Object.freeze(new Xe(0,0,0));Xe.ONE=Object.freeze(new Xe(1,1,1));Xe.UNIT_X=Object.freeze(new Xe(1,0,0));Xe.UNIT_Y=Object.freeze(new Xe(0,1,0));Xe.UNIT_Z=Object.freeze(new Xe(0,0,1));Xe.prototype.clone=function(e){return Xe.clone(this,e)};Xe.prototype.equals=function(e){return Xe.equals(this,e)};Xe.prototype.equalsEpsilon=function(e,t,n){return Xe.equalsEpsilon(this,e,t,n)};Xe.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var h=Xe;var iTe=new h,rTe=new h;function oTe(e,t,n,i,r){let o=e.x,s=e.y,a=e.z,c=t.x,u=t.y,f=t.z,d=o*o*c*c,p=s*s*u*u,g=a*a*f*f,m=d+p+g,x=Math.sqrt(1/m),C=h.multiplyByScalar(e,x,iTe);if(m<i)return isFinite(x)?h.clone(C,r):void 0;let A=n.x,b=n.y,T=n.z,S=rTe;S.x=C.x*A*2,S.y=C.y*b*2,S.z=C.z*T*2;let w=(1-x)*h.magnitude(e)/(.5*h.magnitude(S)),D=0,I,O,B,L,_,E,v,P,R,F,U;do{w-=D,B=1/(1+w*A),L=1/(1+w*b),_=1/(1+w*T),E=B*B,v=L*L,P=_*_,R=E*B,F=v*L,U=P*_,I=d*E+p*v+g*P-1,O=d*R*A+p*F*b+g*U*T;let k=-2*O;D=I/k}while(Math.abs(I)>M.EPSILON12);return l(r)?(r.x=o*B,r.y=s*L,r.z=a*_,r):new h(o*B,s*L,a*_)}var UC=oTe;function es(e,t,n){this.longitude=y(e,0),this.latitude=y(t,0),this.height=y(n,0)}es.fromRadians=function(e,t,n,i){return n=y(n,0),l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new es(e,t,n)};es.fromDegrees=function(e,t,n,i){return e=M.toRadians(e),t=M.toRadians(t),es.fromRadians(e,t,n,i)};var sTe=new h,aTe=new h,cTe=new h,lTe=new h(1/6378137,1/6378137,1/6356752314245179e-9),uTe=new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),fTe=M.EPSILON1;es.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:lTe,r=l(t)?t.oneOverRadiiSquared:uTe,o=l(t)?t._centerToleranceSquared:fTe,s=UC(e,i,r,o,aTe);if(!l(s))return;let a=h.multiplyComponents(s,r,sTe);a=h.normalize(a,a);let c=h.subtract(e,s,cTe),u=Math.atan2(a.y,a.x),f=Math.asin(a.z),d=M.sign(h.dot(c,e))*h.magnitude(c);return l(n)?(n.longitude=u,n.latitude=f,n.height=d,n):new es(u,f,d)};es.toCartesian=function(e,t,n){return h.fromRadians(e.longitude,e.latitude,e.height,t,n)};es.clone=function(e,t){if(!!l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new es(e.longitude,e.latitude,e.height)};es.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};es.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};es.ZERO=Object.freeze(new es(0,0,0));es.prototype.clone=function(e){return es.clone(this,e)};es.prototype.equals=function(e){return es.equals(this,e)};es.prototype.equalsEpsilon=function(e,t){return es.equalsEpsilon(this,e,t)};es.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var me=es;function zX(e,t,n,i){t=y(t,0),n=y(n,0),i=y(i,0),e._radii=new h(t,n,i),e._radiiSquared=new h(t*t,n*n,i*i),e._radiiToTheFourth=new h(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new h(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new h(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=M.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function Zi(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,zX(this,e,t,n)}Object.defineProperties(Zi.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});Zi.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(h.clone(n,t._radii),h.clone(e._radiiSquared,t._radiiSquared),h.clone(e._radiiToTheFourth,t._radiiToTheFourth),h.clone(e._oneOverRadii,t._oneOverRadii),h.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new Zi(n.x,n.y,n.z)};Zi.fromCartesian3=function(e,t){return l(t)||(t=new Zi),l(e)&&zX(t,e.x,e.y,e.z),t};Zi.WGS84=Object.freeze(new Zi(6378137,6378137,6356752314245179e-9));Zi.UNIT_SPHERE=Object.freeze(new Zi(1,1,1));Zi.MOON=Object.freeze(new Zi(M.LUNAR_RADIUS,M.LUNAR_RADIUS,M.LUNAR_RADIUS));Zi.prototype.clone=function(e){return Zi.clone(this,e)};Zi.packedLength=h.packedLength;Zi.pack=function(e,t,n){return n=y(n,0),h.pack(e._radii,t,n),t};Zi.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t);return Zi.fromCartesian3(i,n)};Zi.prototype.geocentricSurfaceNormal=h.normalize;Zi.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,r=Math.cos(i),o=r*Math.cos(n),s=r*Math.sin(n),a=Math.sin(i);return l(t)||(t=new h),t.x=o,t.y=s,t.z=a,h.normalize(t,t)};Zi.prototype.geodeticSurfaceNormal=function(e,t){if(!h.equalsEpsilon(e,h.ZERO,M.EPSILON14))return l(t)||(t=new h),t=h.multiplyComponents(e,this._oneOverRadiiSquared,t),h.normalize(t,t)};var dTe=new h,hTe=new h;Zi.prototype.cartographicToCartesian=function(e,t){let n=dTe,i=hTe;this.geodeticSurfaceNormalCartographic(e,n),h.multiplyComponents(this._radiiSquared,n,i);let r=Math.sqrt(h.dot(n,i));return h.divideByScalar(i,r,i),h.multiplyByScalar(n,e.height,n),l(t)||(t=new h),h.add(i,n,t)};Zi.prototype.cartographicArrayToCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var mTe=new h,pTe=new h,_Te=new h;Zi.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,pTe);if(!l(n))return;let i=this.geodeticSurfaceNormal(n,mTe),r=h.subtract(e,n,_Te),o=Math.atan2(i.y,i.x),s=Math.asin(i.z),a=M.sign(h.dot(r,e))*h.magnitude(r);return l(t)?(t.longitude=o,t.latitude=s,t.height=a,t):new me(o,s,a)};Zi.prototype.cartesianArrayToCartographicArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};Zi.prototype.scaleToGeodeticSurface=function(e,t){return UC(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};Zi.prototype.scaleToGeocentricSurface=function(e,t){l(t)||(t=new h);let n=e.x,i=e.y,r=e.z,o=this._oneOverRadiiSquared,s=1/Math.sqrt(n*n*o.x+i*i*o.y+r*r*o.z);return h.multiplyByScalar(e,s,t)};Zi.prototype.transformPositionToScaledSpace=function(e,t){return l(t)||(t=new h),h.multiplyComponents(e,this._oneOverRadii,t)};Zi.prototype.transformPositionFromScaledSpace=function(e,t){return l(t)||(t=new h),h.multiplyComponents(e,this._radii,t)};Zi.prototype.equals=function(e){return this===e||l(e)&&h.equals(this._radii,e._radii)};Zi.prototype.toString=function(){return this._radii.toString()};Zi.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=y(t,0);let i=this._squaredXOverSquaredZ;if(l(n)||(n=new h),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var gTe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],yTe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function UX(e,t,n){let i=.5*(t+e),r=.5*(t-e),o=0;for(let s=0;s<5;s++){let a=r*gTe[s];o+=yTe[s]*(n(i+a)+n(i-a))}return o*=r,o}Zi.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,r=e.north;for(;n<t;)n+=M.TWO_PI;let o=this._radiiSquared,s=o.x,a=o.y,c=o.z,u=s*a;return UX(i,r,function(f){let d=Math.cos(f),p=Math.sin(f);return Math.cos(f)*UX(t,n,function(g){let m=Math.cos(g),x=Math.sin(g);return Math.sqrt(u*p*p+c*(a*m*m+s*x*x)*d*d)})})};var oe=Zi;function gP(e){this._ellipsoid=y(e,oe.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(gP.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});gP.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,r=e.latitude*n,o=e.height;return l(t)?(t.x=i,t.y=r,t.z=o,t):new h(i,r,o)};gP.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,r=e.y*n,o=e.z;return l(t)?(t.longitude=i,t.latitude=r,t.height=o,t):new me(i,r,o)};var Ii=gP;var xTe={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},Jt=Object.freeze(xTe);function CTe(e,t){this.start=y(e,0),this.stop=y(t,0)}var $c=CTe;function Ke(e,t,n,i,r,o,s,a,c){this[0]=y(e,0),this[1]=y(i,0),this[2]=y(s,0),this[3]=y(t,0),this[4]=y(r,0),this[5]=y(a,0),this[6]=y(n,0),this[7]=y(o,0),this[8]=y(c,0)}Ke.packedLength=9;Ke.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t};Ke.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ke),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n};Ke.packArray=function(e,t){let n=e.length,i=n*9;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)Ke.pack(e[r],t,r*9);return t};Ke.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){let r=i/9;t[r]=Ke.unpack(e,i,t[r])}return t};Ke.clone=function(e,t){if(!!l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new Ke(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};Ke.fromArray=Ke.unpack;Ke.fromColumnMajorArray=function(e,t){return Ke.clone(e,t)};Ke.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new Ke(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};Ke.fromQuaternion=function(e,t){let n=e.x*e.x,i=e.x*e.y,r=e.x*e.z,o=e.x*e.w,s=e.y*e.y,a=e.y*e.z,c=e.y*e.w,u=e.z*e.z,f=e.z*e.w,d=e.w*e.w,p=n-s-u+d,g=2*(i-f),m=2*(r+c),x=2*(i+f),C=-n+s-u+d,A=2*(a-o),b=2*(r-c),T=2*(a+o),S=-n-s+u+d;return l(t)?(t[0]=p,t[1]=x,t[2]=b,t[3]=g,t[4]=C,t[5]=T,t[6]=m,t[7]=A,t[8]=S,t):new Ke(p,g,m,x,C,A,b,T,S)};Ke.fromHeadingPitchRoll=function(e,t){let n=Math.cos(-e.pitch),i=Math.cos(-e.heading),r=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),a=Math.sin(e.roll),c=n*i,u=-r*s+a*o*i,f=a*s+r*o*i,d=n*s,p=r*i+a*o*s,g=-a*i+r*o*s,m=-o,x=a*n,C=r*n;return l(t)?(t[0]=c,t[1]=d,t[2]=m,t[3]=u,t[4]=p,t[5]=x,t[6]=f,t[7]=g,t[8]=C,t):new Ke(c,u,f,d,p,g,m,x,C)};Ke.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new Ke(e.x,0,0,0,e.y,0,0,0,e.z)};Ke.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new Ke(e,0,0,0,e,0,0,0,e)};Ke.fromCrossProduct=function(e,t){return l(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new Ke(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};Ke.fromRotationX=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new Ke(1,0,0,0,n,-i,0,i,n)};Ke.fromRotationY=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new Ke(n,0,i,0,1,0,-i,0,n)};Ke.fromRotationZ=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new Ke(n,-i,0,i,n,0,0,0,1)};Ke.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]};Ke.getElementIndex=function(e,t){return e*3+t};Ke.getColumn=function(e,t,n){let i=t*3,r=e[i],o=e[i+1],s=e[i+2];return n.x=r,n.y=o,n.z=s,n};Ke.setColumn=function(e,t,n,i){i=Ke.clone(e,i);let r=t*3;return i[r]=n.x,i[r+1]=n.y,i[r+2]=n.z,i};Ke.getRow=function(e,t,n){let i=e[t],r=e[t+3],o=e[t+6];return n.x=i,n.y=r,n.z=o,n};Ke.setRow=function(e,t,n,i){return i=Ke.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var ATe=new h;Ke.setScale=function(e,t,n){let i=Ke.getScale(e,ATe),r=t.x/i.x,o=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3]*o,n[4]=e[4]*o,n[5]=e[5]*o,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var TTe=new h;Ke.setUniformScale=function(e,t,n){let i=Ke.getScale(e,TTe),r=t/i.x,o=t/i.y,s=t/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3]*o,n[4]=e[4]*o,n[5]=e[5]*o,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var L8=new h;Ke.getScale=function(e,t){return t.x=h.magnitude(h.fromElements(e[0],e[1],e[2],L8)),t.y=h.magnitude(h.fromElements(e[3],e[4],e[5],L8)),t.z=h.magnitude(h.fromElements(e[6],e[7],e[8],L8)),t};var HX=new h;Ke.getMaximumScale=function(e){return Ke.getScale(e,HX),h.maximumComponent(HX)};var bTe=new h;Ke.setRotation=function(e,t,n){let i=Ke.getScale(e,bTe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=t[3]*i.y,n[4]=t[4]*i.y,n[5]=t[5]*i.y,n[6]=t[6]*i.z,n[7]=t[7]*i.z,n[8]=t[8]*i.z,n};var ETe=new h;Ke.getRotation=function(e,t){let n=Ke.getScale(e,ETe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t};Ke.multiply=function(e,t,n){let i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],r=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],o=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],a=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],f=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],d=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n[4]=a,n[5]=c,n[6]=u,n[7]=f,n[8]=d,n};Ke.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n};Ke.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n};Ke.multiplyByVector=function(e,t,n){let i=t.x,r=t.y,o=t.z,s=e[0]*i+e[3]*r+e[6]*o,a=e[1]*i+e[4]*r+e[7]*o,c=e[2]*i+e[5]*r+e[8]*o;return n.x=s,n.y=a,n.z=c,n};Ke.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};Ke.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n};Ke.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};Ke.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t};Ke.transpose=function(e,t){let n=e[0],i=e[3],r=e[6],o=e[1],s=e[4],a=e[7],c=e[2],u=e[5],f=e[8];return t[0]=n,t[1]=i,t[2]=r,t[3]=o,t[4]=s,t[5]=a,t[6]=c,t[7]=u,t[8]=f,t};function STe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var N8=[1,0,0],F8=[2,2,1];function wTe(e){let t=0;for(let n=0;n<3;++n){let i=e[Ke.getElementIndex(F8[n],N8[n])];t+=2*i*i}return Math.sqrt(t)}function vTe(e,t){let n=M.EPSILON15,i=0,r=1;for(let u=0;u<3;++u){let f=Math.abs(e[Ke.getElementIndex(F8[u],N8[u])]);f>i&&(r=u,i=f)}let o=1,s=0,a=N8[r],c=F8[r];if(Math.abs(e[Ke.getElementIndex(c,a)])>n){let u=e[Ke.getElementIndex(c,c)],f=e[Ke.getElementIndex(a,a)],d=e[Ke.getElementIndex(c,a)],p=(u-f)/2/d,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),o=1/Math.sqrt(1+g*g),s=g*o}return t=Ke.clone(Ke.IDENTITY,t),t[Ke.getElementIndex(a,a)]=t[Ke.getElementIndex(c,c)]=o,t[Ke.getElementIndex(c,a)]=s,t[Ke.getElementIndex(a,c)]=-s,t}var yP=new Ke,GX=new Ke;Ke.computeEigenDecomposition=function(e,t){let n=M.EPSILON20,i=10,r=0,o=0;l(t)||(t={});let s=t.unitary=Ke.clone(Ke.IDENTITY,t.unitary),a=t.diagonal=Ke.clone(e,t.diagonal),c=n*STe(a);for(;o<i&&wTe(a)>c;)vTe(a,yP),Ke.transpose(yP,GX),Ke.multiply(a,yP,a),Ke.multiply(GX,a,a),Ke.multiply(s,yP,s),++r>2&&(++o,r=0);return t};Ke.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};Ke.determinant=function(e){let t=e[0],n=e[3],i=e[6],r=e[1],o=e[4],s=e[7],a=e[2],c=e[5],u=e[8];return t*(o*u-c*s)+r*(c*i-n*u)+a*(n*s-o*i)};Ke.inverse=function(e,t){let n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],c=e[6],u=e[7],f=e[8],d=Ke.determinant(e);t[0]=s*f-u*a,t[1]=u*r-i*f,t[2]=i*a-s*r,t[3]=c*a-o*f,t[4]=n*f-c*r,t[5]=o*r-n*a,t[6]=o*u-c*s,t[7]=c*i-n*u,t[8]=n*s-o*i;let p=1/d;return Ke.multiplyByScalar(t,p,t)};var DTe=new Ke;Ke.inverseTranspose=function(e,t){return Ke.inverse(Ke.transpose(e,DTe),t)};Ke.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]};Ke.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};Ke.IDENTITY=Object.freeze(new Ke(1,0,0,0,1,0,0,0,1));Ke.ZERO=Object.freeze(new Ke(0,0,0,0,0,0,0,0,0));Ke.COLUMN0ROW0=0;Ke.COLUMN0ROW1=1;Ke.COLUMN0ROW2=2;Ke.COLUMN1ROW0=3;Ke.COLUMN1ROW1=4;Ke.COLUMN1ROW2=5;Ke.COLUMN2ROW0=6;Ke.COLUMN2ROW1=7;Ke.COLUMN2ROW2=8;Object.defineProperties(Ke.prototype,{length:{get:function(){return Ke.packedLength}}});Ke.prototype.clone=function(e){return Ke.clone(this,e)};Ke.prototype.equals=function(e){return Ke.equals(this,e)};Ke.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};Ke.prototype.equalsEpsilon=function(e,t){return Ke.equalsEpsilon(this,e,t)};Ke.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
- (${this[1]}, ${this[4]}, ${this[7]})
- (${this[2]}, ${this[5]}, ${this[8]})`};var Q=Ke;function dt(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}dt.fromElements=function(e,t,n,i,r){return l(r)?(r.x=e,r.y=t,r.z=n,r.w=i,r):new dt(e,t,n,i)};dt.fromColor=function(e,t){return l(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new dt(e.red,e.green,e.blue,e.alpha)};dt.clone=function(e,t){if(!!l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new dt(e.x,e.y,e.z,e.w)};dt.packedLength=4;dt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};dt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new dt),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};dt.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)dt.pack(e[r],t,r*4);return t};dt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let r=i/4;t[r]=dt.unpack(e,i,t[r])}return t};dt.fromArray=dt.unpack;dt.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)};dt.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)};dt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};dt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};dt.clamp=function(e,t,n,i){let r=M.clamp(e.x,t.x,n.x),o=M.clamp(e.y,t.y,n.y),s=M.clamp(e.z,t.z,n.z),a=M.clamp(e.w,t.w,n.w);return i.x=r,i.y=o,i.z=s,i.w=a,i};dt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};dt.magnitude=function(e){return Math.sqrt(dt.magnitudeSquared(e))};var xP=new dt;dt.distance=function(e,t){return dt.subtract(e,t,xP),dt.magnitude(xP)};dt.distanceSquared=function(e,t){return dt.subtract(e,t,xP),dt.magnitudeSquared(xP)};dt.normalize=function(e,t){let n=dt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};dt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};dt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};dt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};dt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};dt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};dt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};dt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};dt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};dt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var WX=new dt;dt.lerp=function(e,t,n,i){return dt.multiplyByScalar(t,n,WX),i=dt.multiplyByScalar(e,1-n,i),dt.add(WX,i,i)};var PTe=new dt;dt.mostOrthogonalAxis=function(e,t){let n=dt.normalize(e,PTe);return dt.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=dt.clone(dt.UNIT_X,t):t=dt.clone(dt.UNIT_W,t):n.z<=n.w?t=dt.clone(dt.UNIT_Z,t):t=dt.clone(dt.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=dt.clone(dt.UNIT_Y,t):t=dt.clone(dt.UNIT_W,t):n.z<=n.w?t=dt.clone(dt.UNIT_Z,t):t=dt.clone(dt.UNIT_W,t),t};dt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};dt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]};dt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&M.equalsEpsilon(e.x,t.x,n,i)&&M.equalsEpsilon(e.y,t.y,n,i)&&M.equalsEpsilon(e.z,t.z,n,i)&&M.equalsEpsilon(e.w,t.w,n,i)};dt.ZERO=Object.freeze(new dt(0,0,0,0));dt.ONE=Object.freeze(new dt(1,1,1,1));dt.UNIT_X=Object.freeze(new dt(1,0,0,0));dt.UNIT_Y=Object.freeze(new dt(0,1,0,0));dt.UNIT_Z=Object.freeze(new dt(0,0,1,0));dt.UNIT_W=Object.freeze(new dt(0,0,0,1));dt.prototype.clone=function(e){return dt.clone(this,e)};dt.prototype.equals=function(e){return dt.equals(this,e)};dt.prototype.equalsEpsilon=function(e,t,n){return dt.equalsEpsilon(this,e,t,n)};dt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var V8=new Float32Array(1),Oa=new Uint8Array(V8.buffer),ITe=new Uint32Array([287454020]),OTe=new Uint8Array(ITe.buffer),jX=OTe[0]===68;dt.packFloat=function(e,t){return l(t)||(t=new dt),V8[0]=e,jX?(t.x=Oa[0],t.y=Oa[1],t.z=Oa[2],t.w=Oa[3]):(t.x=Oa[3],t.y=Oa[2],t.z=Oa[1],t.w=Oa[0]),t};dt.unpackFloat=function(e){return jX?(Oa[0]=e.x,Oa[1]=e.y,Oa[2]=e.z,Oa[3]=e.w):(Oa[0]=e.w,Oa[1]=e.z,Oa[2]=e.y,Oa[3]=e.x),V8[0]};var se=dt;function iS(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(iS.prototype=Object.create(Error.prototype),iS.prototype.constructor=iS);iS.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
- ${this.stack.toString()}`),e};var fe=iS;function Ye(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m,x){this[0]=y(e,0),this[1]=y(r,0),this[2]=y(c,0),this[3]=y(p,0),this[4]=y(t,0),this[5]=y(o,0),this[6]=y(u,0),this[7]=y(g,0),this[8]=y(n,0),this[9]=y(s,0),this[10]=y(f,0),this[11]=y(m,0),this[12]=y(i,0),this[13]=y(a,0),this[14]=y(d,0),this[15]=y(x,0)}Ye.packedLength=16;Ye.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};Ye.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ye),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n};Ye.packArray=function(e,t){let n=e.length,i=n*16;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)Ye.pack(e[r],t,r*16);return t};Ye.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){let r=i/16;t[r]=Ye.unpack(e,i,t[r])}return t};Ye.clone=function(e,t){if(!!l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new Ye(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])};Ye.fromArray=Ye.unpack;Ye.fromColumnMajorArray=function(e,t){return Ye.clone(e,t)};Ye.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new Ye(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])};Ye.fromRotationTranslation=function(e,t,n){return t=y(t,h.ZERO),l(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new Ye(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)};Ye.fromTranslationQuaternionRotationScale=function(e,t,n,i){l(i)||(i=new Ye);let r=n.x,o=n.y,s=n.z,a=t.x*t.x,c=t.x*t.y,u=t.x*t.z,f=t.x*t.w,d=t.y*t.y,p=t.y*t.z,g=t.y*t.w,m=t.z*t.z,x=t.z*t.w,C=t.w*t.w,A=a-d-m+C,b=2*(c-x),T=2*(u+g),S=2*(c+x),w=-a+d-m+C,D=2*(p-f),I=2*(u-g),O=2*(p+f),B=-a-d+m+C;return i[0]=A*r,i[1]=S*r,i[2]=I*r,i[3]=0,i[4]=b*o,i[5]=w*o,i[6]=O*o,i[7]=0,i[8]=T*s,i[9]=D*s,i[10]=B*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};Ye.fromTranslationRotationScale=function(e,t){return Ye.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};Ye.fromTranslation=function(e,t){return Ye.fromRotationTranslation(Q.IDENTITY,e,t)};Ye.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new Ye(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};Ye.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new Ye(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};Ye.fromRotation=function(e,t){return l(t)||(t=new Ye),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};var zC=new h,HC=new h,rS=new h;Ye.fromCamera=function(e,t){let n=e.position,i=e.direction,r=e.up;h.normalize(i,zC),h.normalize(h.cross(zC,r,HC),HC),h.normalize(h.cross(HC,zC,rS),rS);let o=HC.x,s=HC.y,a=HC.z,c=zC.x,u=zC.y,f=zC.z,d=rS.x,p=rS.y,g=rS.z,m=n.x,x=n.y,C=n.z,A=o*-m+s*-x+a*-C,b=d*-m+p*-x+g*-C,T=c*m+u*x+f*C;return l(t)?(t[0]=o,t[1]=d,t[2]=-c,t[3]=0,t[4]=s,t[5]=p,t[6]=-u,t[7]=0,t[8]=a,t[9]=g,t[10]=-f,t[11]=0,t[12]=A,t[13]=b,t[14]=T,t[15]=1,t):new Ye(o,s,a,A,d,p,g,b,-c,-u,-f,T,0,0,0,1)};Ye.computePerspectiveFieldOfView=function(e,t,n,i,r){let o=Math.tan(e*.5),s=1/o,a=s/t,c=(i+n)/(n-i),u=2*i*n/(n-i);return r[0]=a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=c,r[11]=-1,r[12]=0,r[13]=0,r[14]=u,r[15]=0,r};Ye.computeOrthographicOffCenter=function(e,t,n,i,r,o,s){let a=1/(t-e),c=1/(i-n),u=1/(o-r),f=-(t+e)*a,d=-(i+n)*c,p=-(o+r)*u;return a*=2,c*=2,u*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=u,s[11]=0,s[12]=f,s[13]=d,s[14]=p,s[15]=1,s};Ye.computePerspectiveOffCenter=function(e,t,n,i,r,o,s){let a=2*r/(t-e),c=2*r/(i-n),u=(t+e)/(t-e),f=(i+n)/(i-n),d=-(o+r)/(o-r),p=-1,g=-2*o*r/(o-r);return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=u,s[9]=f,s[10]=d,s[11]=p,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s};Ye.computeInfinitePerspectiveOffCenter=function(e,t,n,i,r,o){let s=2*r/(t-e),a=2*r/(i-n),c=(t+e)/(t-e),u=(i+n)/(i-n),f=-1,d=-1,p=-2*r;return o[0]=s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,o[6]=0,o[7]=0,o[8]=c,o[9]=u,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=p,o[15]=0,o};Ye.computeViewportTransformation=function(e,t,n,i){l(i)||(i=new Ye),e=y(e,y.EMPTY_OBJECT);let r=y(e.x,0),o=y(e.y,0),s=y(e.width,0),a=y(e.height,0);t=y(t,0),n=y(n,1);let c=s*.5,u=a*.5,f=(n-t)*.5,d=c,p=u,g=f,m=r+c,x=o+u,C=t+f,A=1;return i[0]=d,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=g,i[11]=0,i[12]=m,i[13]=x,i[14]=C,i[15]=A,i};Ye.computeView=function(e,t,n,i,r){return r[0]=i.x,r[1]=n.x,r[2]=-t.x,r[3]=0,r[4]=i.y,r[5]=n.y,r[6]=-t.y,r[7]=0,r[8]=i.z,r[9]=n.z,r[10]=-t.z,r[11]=0,r[12]=-h.dot(i,e),r[13]=-h.dot(n,e),r[14]=h.dot(t,e),r[15]=1,r};Ye.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]};Ye.getElementIndex=function(e,t){return e*4+t};Ye.getColumn=function(e,t,n){let i=t*4,r=e[i],o=e[i+1],s=e[i+2],a=e[i+3];return n.x=r,n.y=o,n.z=s,n.w=a,n};Ye.setColumn=function(e,t,n,i){i=Ye.clone(e,i);let r=t*4;return i[r]=n.x,i[r+1]=n.y,i[r+2]=n.z,i[r+3]=n.w,i};Ye.getRow=function(e,t,n){let i=e[t],r=e[t+4],o=e[t+8],s=e[t+12];return n.x=i,n.y=r,n.z=o,n.w=s,n};Ye.setRow=function(e,t,n,i){return i=Ye.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};Ye.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var RTe=new h;Ye.setScale=function(e,t,n){let i=Ye.getScale(e,RTe),r=t.x/i.x,o=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3],n[4]=e[4]*o,n[5]=e[5]*o,n[6]=e[6]*o,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var MTe=new h;Ye.setUniformScale=function(e,t,n){let i=Ye.getScale(e,MTe),r=t/i.x,o=t/i.y,s=t/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3],n[4]=e[4]*o,n[5]=e[5]*o,n[6]=e[6]*o,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var k8=new h;Ye.getScale=function(e,t){return t.x=h.magnitude(h.fromElements(e[0],e[1],e[2],k8)),t.y=h.magnitude(h.fromElements(e[4],e[5],e[6],k8)),t.z=h.magnitude(h.fromElements(e[8],e[9],e[10],k8)),t};var qX=new h;Ye.getMaximumScale=function(e){return Ye.getScale(e,qX),h.maximumComponent(qX)};var BTe=new h;Ye.setRotation=function(e,t,n){let i=Ye.getScale(e,BTe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=e[3],n[4]=t[3]*i.y,n[5]=t[4]*i.y,n[6]=t[5]*i.y,n[7]=e[7],n[8]=t[6]*i.z,n[9]=t[7]*i.z,n[10]=t[8]*i.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var LTe=new h;Ye.getRotation=function(e,t){let n=Ye.getScale(e,LTe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[4]/n.y,t[4]=e[5]/n.y,t[5]=e[6]/n.y,t[6]=e[8]/n.z,t[7]=e[9]/n.z,t[8]=e[10]/n.z,t};Ye.multiply=function(e,t,n){let i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],c=e[5],u=e[6],f=e[7],d=e[8],p=e[9],g=e[10],m=e[11],x=e[12],C=e[13],A=e[14],b=e[15],T=t[0],S=t[1],w=t[2],D=t[3],I=t[4],O=t[5],B=t[6],L=t[7],_=t[8],E=t[9],v=t[10],P=t[11],R=t[12],F=t[13],U=t[14],k=t[15],H=i*T+a*S+d*w+x*D,V=r*T+c*S+p*w+C*D,q=o*T+u*S+g*w+A*D,j=s*T+f*S+m*w+b*D,X=i*I+a*O+d*B+x*L,G=r*I+c*O+p*B+C*L,$=o*I+u*O+g*B+A*L,J=s*I+f*O+m*B+b*L,ce=i*_+a*E+d*v+x*P,de=r*_+c*E+p*v+C*P,ie=o*_+u*E+g*v+A*P,ae=s*_+f*E+m*v+b*P,_e=i*R+a*F+d*U+x*k,be=r*R+c*F+p*U+C*k,Te=o*R+u*F+g*U+A*k,Oe=s*R+f*F+m*U+b*k;return n[0]=H,n[1]=V,n[2]=q,n[3]=j,n[4]=X,n[5]=G,n[6]=$,n[7]=J,n[8]=ce,n[9]=de,n[10]=ie,n[11]=ae,n[12]=_e,n[13]=be,n[14]=Te,n[15]=Oe,n};Ye.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};Ye.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};Ye.multiplyTransformation=function(e,t,n){let i=e[0],r=e[1],o=e[2],s=e[4],a=e[5],c=e[6],u=e[8],f=e[9],d=e[10],p=e[12],g=e[13],m=e[14],x=t[0],C=t[1],A=t[2],b=t[4],T=t[5],S=t[6],w=t[8],D=t[9],I=t[10],O=t[12],B=t[13],L=t[14],_=i*x+s*C+u*A,E=r*x+a*C+f*A,v=o*x+c*C+d*A,P=i*b+s*T+u*S,R=r*b+a*T+f*S,F=o*b+c*T+d*S,U=i*w+s*D+u*I,k=r*w+a*D+f*I,H=o*w+c*D+d*I,V=i*O+s*B+u*L+p,q=r*O+a*B+f*L+g,j=o*O+c*B+d*L+m;return n[0]=_,n[1]=E,n[2]=v,n[3]=0,n[4]=P,n[5]=R,n[6]=F,n[7]=0,n[8]=U,n[9]=k,n[10]=H,n[11]=0,n[12]=V,n[13]=q,n[14]=j,n[15]=1,n};Ye.multiplyByMatrix3=function(e,t,n){let i=e[0],r=e[1],o=e[2],s=e[4],a=e[5],c=e[6],u=e[8],f=e[9],d=e[10],p=t[0],g=t[1],m=t[2],x=t[3],C=t[4],A=t[5],b=t[6],T=t[7],S=t[8],w=i*p+s*g+u*m,D=r*p+a*g+f*m,I=o*p+c*g+d*m,O=i*x+s*C+u*A,B=r*x+a*C+f*A,L=o*x+c*C+d*A,_=i*b+s*T+u*S,E=r*b+a*T+f*S,v=o*b+c*T+d*S;return n[0]=w,n[1]=D,n[2]=I,n[3]=0,n[4]=O,n[5]=B,n[6]=L,n[7]=0,n[8]=_,n[9]=E,n[10]=v,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};Ye.multiplyByTranslation=function(e,t,n){let i=t.x,r=t.y,o=t.z,s=i*e[0]+r*e[4]+o*e[8]+e[12],a=i*e[1]+r*e[5]+o*e[9]+e[13],c=i*e[2]+r*e[6]+o*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=s,n[13]=a,n[14]=c,n[15]=e[15],n};Ye.multiplyByScale=function(e,t,n){let i=t.x,r=t.y,o=t.z;return i===1&&r===1&&o===1?Ye.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=e[3],n[4]=r*e[4],n[5]=r*e[5],n[6]=r*e[6],n[7]=e[7],n[8]=o*e[8],n[9]=o*e[9],n[10]=o*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)};Ye.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};Ye.multiplyByVector=function(e,t,n){let i=t.x,r=t.y,o=t.z,s=t.w,a=e[0]*i+e[4]*r+e[8]*o+e[12]*s,c=e[1]*i+e[5]*r+e[9]*o+e[13]*s,u=e[2]*i+e[6]*r+e[10]*o+e[14]*s,f=e[3]*i+e[7]*r+e[11]*o+e[15]*s;return n.x=a,n.y=c,n.z=u,n.w=f,n};Ye.multiplyByPointAsVector=function(e,t,n){let i=t.x,r=t.y,o=t.z,s=e[0]*i+e[4]*r+e[8]*o,a=e[1]*i+e[5]*r+e[9]*o,c=e[2]*i+e[6]*r+e[10]*o;return n.x=s,n.y=a,n.z=c,n};Ye.multiplyByPoint=function(e,t,n){let i=t.x,r=t.y,o=t.z,s=e[0]*i+e[4]*r+e[8]*o+e[12],a=e[1]*i+e[5]*r+e[9]*o+e[13],c=e[2]*i+e[6]*r+e[10]*o+e[14];return n.x=s,n.y=a,n.z=c,n};Ye.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};Ye.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};Ye.transpose=function(e,t){let n=e[1],i=e[2],r=e[3],o=e[6],s=e[7],a=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=o,t[10]=e[10],t[11]=e[14],t[12]=r,t[13]=s,t[14]=a,t[15]=e[15],t};Ye.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};Ye.equals=function(e,t){return e===t||l(e)&&l(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]};Ye.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n};Ye.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t};Ye.getMatrix3=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var NTe=new Q,FTe=new Q,VTe=new se,kTe=new se(0,0,0,1);Ye.inverse=function(e,t){let n=e[0],i=e[4],r=e[8],o=e[12],s=e[1],a=e[5],c=e[9],u=e[13],f=e[2],d=e[6],p=e[10],g=e[14],m=e[3],x=e[7],C=e[11],A=e[15],b=p*A,T=g*C,S=d*A,w=g*x,D=d*C,I=p*x,O=f*A,B=g*m,L=f*C,_=p*m,E=f*x,v=d*m,P=b*a+w*c+D*u-(T*a+S*c+I*u),R=T*s+O*c+_*u-(b*s+B*c+L*u),F=S*s+B*a+E*u-(w*s+O*a+v*u),U=I*s+L*a+v*c-(D*s+_*a+E*c),k=T*i+S*r+I*o-(b*i+w*r+D*o),H=b*n+B*r+L*o-(T*n+O*r+_*o),V=w*n+O*i+v*o-(S*n+B*i+E*o),q=D*n+_*i+E*r-(I*n+L*i+v*r);b=r*u,T=o*c,S=i*u,w=o*a,D=i*c,I=r*a,O=n*u,B=o*s,L=n*c,_=r*s,E=n*a,v=i*s;let j=b*x+w*C+D*A-(T*x+S*C+I*A),X=T*m+O*C+_*A-(b*m+B*C+L*A),G=S*m+B*x+E*A-(w*m+O*x+v*A),$=I*m+L*x+v*C-(D*m+_*x+E*C),J=S*p+I*g+T*d-(D*g+b*d+w*p),ce=L*g+b*f+B*p-(O*p+_*g+T*f),de=O*d+v*g+w*f-(E*g+S*f+B*d),ie=E*p+D*f+_*d-(L*d+v*p+I*f),ae=n*P+i*R+r*F+o*U;if(Math.abs(ae)<M.EPSILON21){if(Q.equalsEpsilon(Ye.getMatrix3(e,NTe),FTe,M.EPSILON7)&&se.equals(Ye.getRow(e,3,VTe),kTe))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new fe("matrix is not invertible because its determinate is zero.")}return ae=1/ae,t[0]=P*ae,t[1]=R*ae,t[2]=F*ae,t[3]=U*ae,t[4]=k*ae,t[5]=H*ae,t[6]=V*ae,t[7]=q*ae,t[8]=j*ae,t[9]=X*ae,t[10]=G*ae,t[11]=$*ae,t[12]=J*ae,t[13]=ce*ae,t[14]=de*ae,t[15]=ie*ae,t};Ye.inverseTransformation=function(e,t){let n=e[0],i=e[1],r=e[2],o=e[4],s=e[5],a=e[6],c=e[8],u=e[9],f=e[10],d=e[12],p=e[13],g=e[14],m=-n*d-i*p-r*g,x=-o*d-s*p-a*g,C=-c*d-u*p-f*g;return t[0]=n,t[1]=o,t[2]=c,t[3]=0,t[4]=i,t[5]=s,t[6]=u,t[7]=0,t[8]=r,t[9]=a,t[10]=f,t[11]=0,t[12]=m,t[13]=x,t[14]=C,t[15]=1,t};var UTe=new Ye;Ye.inverseTranspose=function(e,t){return Ye.inverse(Ye.transpose(e,UTe),t)};Ye.IDENTITY=Object.freeze(new Ye(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));Ye.ZERO=Object.freeze(new Ye(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));Ye.COLUMN0ROW0=0;Ye.COLUMN0ROW1=1;Ye.COLUMN0ROW2=2;Ye.COLUMN0ROW3=3;Ye.COLUMN1ROW0=4;Ye.COLUMN1ROW1=5;Ye.COLUMN1ROW2=6;Ye.COLUMN1ROW3=7;Ye.COLUMN2ROW0=8;Ye.COLUMN2ROW1=9;Ye.COLUMN2ROW2=10;Ye.COLUMN2ROW3=11;Ye.COLUMN3ROW0=12;Ye.COLUMN3ROW1=13;Ye.COLUMN3ROW2=14;Ye.COLUMN3ROW3=15;Object.defineProperties(Ye.prototype,{length:{get:function(){return Ye.packedLength}}});Ye.prototype.clone=function(e){return Ye.clone(this,e)};Ye.prototype.equals=function(e){return Ye.equals(this,e)};Ye.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]};Ye.prototype.equalsEpsilon=function(e,t){return Ye.equalsEpsilon(this,e,t)};Ye.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})
- (${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})
- (${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})
- (${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var N=Ye;function Mn(e,t,n,i){this.west=y(e,0),this.south=y(t,0),this.east=y(n,0),this.north=y(i,0)}Object.defineProperties(Mn.prototype,{width:{get:function(){return Mn.computeWidth(this)}},height:{get:function(){return Mn.computeHeight(this)}}});Mn.packedLength=4;Mn.pack=function(e,t,n){return n=y(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};Mn.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Mn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};Mn.computeWidth=function(e){let t=e.east,n=e.west;return t<n&&(t+=M.TWO_PI),t-n};Mn.computeHeight=function(e){return e.north-e.south};Mn.fromDegrees=function(e,t,n,i,r){return e=M.toRadians(y(e,0)),t=M.toRadians(y(t,0)),n=M.toRadians(y(n,0)),i=M.toRadians(y(i,0)),l(r)?(r.west=e,r.south=t,r.east=n,r.north=i,r):new Mn(e,t,n,i)};Mn.fromRadians=function(e,t,n,i,r){return l(r)?(r.west=y(e,0),r.south=y(t,0),r.east=y(n,0),r.north=y(i,0),r):new Mn(e,t,n,i)};Mn.fromCartographicArray=function(e,t){let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE;for(let c=0,u=e.length;c<u;c++){let f=e[c];n=Math.min(n,f.longitude),i=Math.max(i,f.longitude),s=Math.min(s,f.latitude),a=Math.max(a,f.latitude);let d=f.longitude>=0?f.longitude:f.longitude+M.TWO_PI;r=Math.min(r,d),o=Math.max(o,d)}return i-n>o-r&&(n=r,i=o,i>M.PI&&(i=i-M.TWO_PI),n>M.PI&&(n=n-M.TWO_PI)),l(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new Mn(n,s,i,a)};Mn.fromCartesianArray=function(e,t,n){t=y(t,oe.WGS84);let i=Number.MAX_VALUE,r=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=e.length;u<f;u++){let d=t.cartesianToCartographic(e[u]);i=Math.min(i,d.longitude),r=Math.max(r,d.longitude),a=Math.min(a,d.latitude),c=Math.max(c,d.latitude);let p=d.longitude>=0?d.longitude:d.longitude+M.TWO_PI;o=Math.min(o,p),s=Math.max(s,p)}return r-i>s-o&&(i=o,r=s,r>M.PI&&(r=r-M.TWO_PI),i>M.PI&&(i=i-M.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=r,n.north=c,n):new Mn(i,a,r,c)};Mn.clone=function(e,t){if(!!l(e))return l(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new Mn(e.west,e.south,e.east,e.north)};Mn.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n};Mn.prototype.clone=function(e){return Mn.clone(this,e)};Mn.prototype.equals=function(e){return Mn.equals(this,e)};Mn.equals=function(e,t){return e===t||l(e)&&l(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};Mn.prototype.equalsEpsilon=function(e,t){return Mn.equalsEpsilon(this,e,t)};Mn.validate=function(e){};Mn.southwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new me(e.west,e.south)};Mn.northwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new me(e.west,e.north)};Mn.northeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new me(e.east,e.north)};Mn.southeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new me(e.east,e.south)};Mn.center=function(e,t){let n=e.east,i=e.west;n<i&&(n+=M.TWO_PI);let r=M.negativePiToPi((i+n)*.5),o=(e.south+e.north)*.5;return l(t)?(t.longitude=r,t.latitude=o,t.height=0,t):new me(r,o)};Mn.intersection=function(e,t,n){let i=e.east,r=e.west,o=t.east,s=t.west;i<r&&o>0?i+=M.TWO_PI:o<s&&i>0&&(o+=M.TWO_PI),i<r&&s<0?s+=M.TWO_PI:o<s&&r<0&&(r+=M.TWO_PI);let a=M.negativePiToPi(Math.max(r,s)),c=M.negativePiToPi(Math.min(i,o));if((e.west<e.east||t.west<t.east)&&c<=a)return;let u=Math.max(e.south,t.south),f=Math.min(e.north,t.north);if(!(u>=f))return l(n)?(n.west=a,n.south=u,n.east=c,n.north=f,n):new Mn(a,u,c,f)};Mn.simpleIntersection=function(e,t,n){let i=Math.max(e.west,t.west),r=Math.max(e.south,t.south),o=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(r>=s||i>=o))return l(n)?(n.west=i,n.south=r,n.east=o,n.north=s,n):new Mn(i,r,o,s)};Mn.union=function(e,t,n){l(n)||(n=new Mn);let i=e.east,r=e.west,o=t.east,s=t.west;i<r&&o>0?i+=M.TWO_PI:o<s&&i>0&&(o+=M.TWO_PI),i<r&&s<0?s+=M.TWO_PI:o<s&&r<0&&(r+=M.TWO_PI);let a=M.negativePiToPi(Math.min(r,s)),c=M.negativePiToPi(Math.max(i,o));return n.west=a,n.south=Math.min(e.south,t.south),n.east=c,n.north=Math.max(e.north,t.north),n};Mn.expand=function(e,t,n){return l(n)||(n=new Mn),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n};Mn.contains=function(e,t){let n=t.longitude,i=t.latitude,r=e.west,o=e.east;return o<r&&(o+=M.TWO_PI,n<0&&(n+=M.TWO_PI)),(n>r||M.equalsEpsilon(n,r,M.EPSILON14))&&(n<o||M.equalsEpsilon(n,o,M.EPSILON14))&&i>=e.south&&i<=e.north};var zTe=new me;Mn.subsample=function(e,t,n,i){t=y(t,oe.WGS84),n=y(n,0),l(i)||(i=[]);let r=0,o=e.north,s=e.south,a=e.east,c=e.west,u=zTe;u.height=n,u.longitude=c,u.latitude=o,i[r]=t.cartographicToCartesian(u,i[r]),r++,u.longitude=a,i[r]=t.cartographicToCartesian(u,i[r]),r++,u.latitude=s,i[r]=t.cartographicToCartesian(u,i[r]),r++,u.longitude=c,i[r]=t.cartographicToCartesian(u,i[r]),r++,o<0?u.latitude=o:s>0?u.latitude=s:u.latitude=0;for(let f=1;f<8;++f)u.longitude=-Math.PI+f*M.PI_OVER_TWO,Mn.contains(e,u)&&(i[r]=t.cartographicToCartesian(u,i[r]),r++);return u.latitude===0&&(u.longitude=c,i[r]=t.cartographicToCartesian(u,i[r]),r++,u.longitude=a,i[r]=t.cartographicToCartesian(u,i[r]),r++),i.length=r,i};Mn.subsection=function(e,t,n,i,r,o){if(l(o)||(o=new Mn),e.west<=e.east){let a=e.east-e.west;o.west=e.west+t*a,o.east=e.west+i*a}else{let a=M.TWO_PI+e.east-e.west;o.west=M.negativePiToPi(e.west+t*a),o.east=M.negativePiToPi(e.west+i*a)}let s=e.north-e.south;return o.south=e.south+n*s,o.north=e.south+r*s,t===1&&(o.west=e.east),i===1&&(o.east=e.east),n===1&&(o.south=e.north),r===1&&(o.north=e.north),o};Mn.MAX_VALUE=Object.freeze(new Mn(-Math.PI,-M.PI_OVER_TWO,Math.PI,M.PI_OVER_TWO));var he=Mn;function fn(e,t){this.center=h.clone(y(e,h.ZERO)),this.radius=y(t,0)}var H8=new h,G8=new h,W8=new h,j8=new h,q8=new h,Y8=new h,X8=new h,Fs=new h,K8=new h,$8=new h,Z8=new h,J8=new h,HTe=4/3*M.PI;fn.fromPoints=function(e,t){if(l(t)||(t=new fn),!l(e)||e.length===0)return t.center=h.clone(h.ZERO,t.center),t.radius=0,t;let n=h.clone(e[0],X8),i=h.clone(n,H8),r=h.clone(n,G8),o=h.clone(n,W8),s=h.clone(n,j8),a=h.clone(n,q8),c=h.clone(n,Y8),u=e.length,f;for(f=1;f<u;f++){h.clone(e[f],n);let O=n.x,B=n.y,L=n.z;O<i.x&&h.clone(n,i),O>s.x&&h.clone(n,s),B<r.y&&h.clone(n,r),B>a.y&&h.clone(n,a),L<o.z&&h.clone(n,o),L>c.z&&h.clone(n,c)}let d=h.magnitudeSquared(h.subtract(s,i,Fs)),p=h.magnitudeSquared(h.subtract(a,r,Fs)),g=h.magnitudeSquared(h.subtract(c,o,Fs)),m=i,x=s,C=d;p>C&&(C=p,m=r,x=a),g>C&&(C=g,m=o,x=c);let A=K8;A.x=(m.x+x.x)*.5,A.y=(m.y+x.y)*.5,A.z=(m.z+x.z)*.5;let b=h.magnitudeSquared(h.subtract(x,A,Fs)),T=Math.sqrt(b),S=$8;S.x=i.x,S.y=r.y,S.z=o.z;let w=Z8;w.x=s.x,w.y=a.y,w.z=c.z;let D=h.midpoint(S,w,J8),I=0;for(f=0;f<u;f++){h.clone(e[f],n);let O=h.magnitude(h.subtract(n,D,Fs));O>I&&(I=O);let B=h.magnitudeSquared(h.subtract(n,A,Fs));if(B>b){let L=Math.sqrt(B);T=(T+L)*.5,b=T*T;let _=L-T;A.x=(T*A.x+_*n.x)/L,A.y=(T*A.y+_*n.y)/L,A.z=(T*A.z+_*n.z)/L}}return T<I?(h.clone(A,t.center),t.radius=T):(h.clone(D,t.center),t.radius=I),t};var GTe=new Ii,WTe=new h,jTe=new h,U8=new me,z8=new me;fn.fromRectangle2D=function(e,t,n){return fn.fromRectangleWithHeights2D(e,t,0,0,n)};fn.fromRectangleWithHeights2D=function(e,t,n,i,r){if(l(r)||(r=new fn),!l(e))return r.center=h.clone(h.ZERO,r.center),r.radius=0,r;t=y(t,GTe),he.southwest(e,U8),U8.height=n,he.northeast(e,z8),z8.height=i;let o=t.project(U8,WTe),s=t.project(z8,jTe),a=s.x-o.x,c=s.y-o.y,u=s.z-o.z;r.radius=Math.sqrt(a*a+c*c+u*u)*.5;let f=r.center;return f.x=o.x+a*.5,f.y=o.y+c*.5,f.z=o.z+u*.5,r};var qTe=[];fn.fromRectangle3D=function(e,t,n,i){if(t=y(t,oe.WGS84),n=y(n,0),l(i)||(i=new fn),!l(e))return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;let r=he.subsample(e,t,n,qTe);return fn.fromPoints(r,i)};fn.fromVertices=function(e,t,n,i){if(l(i)||(i=new fn),!l(e)||e.length===0)return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;t=y(t,h.ZERO),n=y(n,3);let r=X8;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;let o=h.clone(r,H8),s=h.clone(r,G8),a=h.clone(r,W8),c=h.clone(r,j8),u=h.clone(r,q8),f=h.clone(r,Y8),d=e.length,p;for(p=0;p<d;p+=n){let L=e[p]+t.x,_=e[p+1]+t.y,E=e[p+2]+t.z;r.x=L,r.y=_,r.z=E,L<o.x&&h.clone(r,o),L>c.x&&h.clone(r,c),_<s.y&&h.clone(r,s),_>u.y&&h.clone(r,u),E<a.z&&h.clone(r,a),E>f.z&&h.clone(r,f)}let g=h.magnitudeSquared(h.subtract(c,o,Fs)),m=h.magnitudeSquared(h.subtract(u,s,Fs)),x=h.magnitudeSquared(h.subtract(f,a,Fs)),C=o,A=c,b=g;m>b&&(b=m,C=s,A=u),x>b&&(b=x,C=a,A=f);let T=K8;T.x=(C.x+A.x)*.5,T.y=(C.y+A.y)*.5,T.z=(C.z+A.z)*.5;let S=h.magnitudeSquared(h.subtract(A,T,Fs)),w=Math.sqrt(S),D=$8;D.x=o.x,D.y=s.y,D.z=a.z;let I=Z8;I.x=c.x,I.y=u.y,I.z=f.z;let O=h.midpoint(D,I,J8),B=0;for(p=0;p<d;p+=n){r.x=e[p]+t.x,r.y=e[p+1]+t.y,r.z=e[p+2]+t.z;let L=h.magnitude(h.subtract(r,O,Fs));L>B&&(B=L);let _=h.magnitudeSquared(h.subtract(r,T,Fs));if(_>S){let E=Math.sqrt(_);w=(w+E)*.5,S=w*w;let v=E-w;T.x=(w*T.x+v*r.x)/E,T.y=(w*T.y+v*r.y)/E,T.z=(w*T.z+v*r.z)/E}}return w<B?(h.clone(T,i.center),i.radius=w):(h.clone(O,i.center),i.radius=B),i};fn.fromEncodedCartesianVertices=function(e,t,n){if(l(n)||(n=new fn),!l(e)||!l(t)||e.length!==t.length||e.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=X8;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let r=h.clone(i,H8),o=h.clone(i,G8),s=h.clone(i,W8),a=h.clone(i,j8),c=h.clone(i,q8),u=h.clone(i,Y8),f=e.length,d;for(d=0;d<f;d+=3){let B=e[d]+t[d],L=e[d+1]+t[d+1],_=e[d+2]+t[d+2];i.x=B,i.y=L,i.z=_,B<r.x&&h.clone(i,r),B>a.x&&h.clone(i,a),L<o.y&&h.clone(i,o),L>c.y&&h.clone(i,c),_<s.z&&h.clone(i,s),_>u.z&&h.clone(i,u)}let p=h.magnitudeSquared(h.subtract(a,r,Fs)),g=h.magnitudeSquared(h.subtract(c,o,Fs)),m=h.magnitudeSquared(h.subtract(u,s,Fs)),x=r,C=a,A=p;g>A&&(A=g,x=o,C=c),m>A&&(A=m,x=s,C=u);let b=K8;b.x=(x.x+C.x)*.5,b.y=(x.y+C.y)*.5,b.z=(x.z+C.z)*.5;let T=h.magnitudeSquared(h.subtract(C,b,Fs)),S=Math.sqrt(T),w=$8;w.x=r.x,w.y=o.y,w.z=s.z;let D=Z8;D.x=a.x,D.y=c.y,D.z=u.z;let I=h.midpoint(w,D,J8),O=0;for(d=0;d<f;d+=3){i.x=e[d]+t[d],i.y=e[d+1]+t[d+1],i.z=e[d+2]+t[d+2];let B=h.magnitude(h.subtract(i,I,Fs));B>O&&(O=B);let L=h.magnitudeSquared(h.subtract(i,b,Fs));if(L>T){let _=Math.sqrt(L);S=(S+_)*.5,T=S*S;let E=_-S;b.x=(S*b.x+E*i.x)/_,b.y=(S*b.y+E*i.y)/_,b.z=(S*b.z+E*i.z)/_}}return S<O?(h.clone(b,n.center),n.radius=S):(h.clone(I,n.center),n.radius=O),n};fn.fromCornerPoints=function(e,t,n){l(n)||(n=new fn);let i=h.midpoint(e,t,n.center);return n.radius=h.distance(i,t),n};fn.fromEllipsoid=function(e,t){return l(t)||(t=new fn),h.clone(h.ZERO,t.center),t.radius=e.maximumRadius,t};var YTe=new h;fn.fromBoundingSpheres=function(e,t){if(l(t)||(t=new fn),!l(e)||e.length===0)return t.center=h.clone(h.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return fn.clone(e[0],t);if(n===2)return fn.union(e[0],e[1],t);let i=[],r;for(r=0;r<n;r++)i.push(e[r].center);t=fn.fromPoints(i,t);let o=t.center,s=t.radius;for(r=0;r<n;r++){let a=e[r];s=Math.max(s,h.distance(o,a.center,YTe)+a.radius)}return t.radius=s,t};var XTe=new h,KTe=new h,$Te=new h;fn.fromOrientedBoundingBox=function(e,t){l(t)||(t=new fn);let n=e.halfAxes,i=Q.getColumn(n,0,XTe),r=Q.getColumn(n,1,KTe),o=Q.getColumn(n,2,$Te);return h.add(i,r,i),h.add(i,o,i),t.center=h.clone(e.center,t.center),t.radius=h.magnitude(i),t};var ZTe=new h,JTe=new h;fn.fromTransformation=function(e,t){l(t)||(t=new fn);let n=N.getTranslation(e,ZTe),i=N.getScale(e,JTe),r=.5*h.magnitude(i);return t.center=h.clone(n,t.center),t.radius=r,t};fn.clone=function(e,t){if(!!l(e))return l(t)?(t.center=h.clone(e.center,t.center),t.radius=e.radius,t):new fn(e.center,e.radius)};fn.packedLength=4;fn.pack=function(e,t,n){n=y(n,0);let i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t};fn.unpack=function(e,t,n){t=y(t,0),l(n)||(n=new fn);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var QTe=new h,ebe=new h;fn.union=function(e,t,n){l(n)||(n=new fn);let i=e.center,r=e.radius,o=t.center,s=t.radius,a=h.subtract(o,i,QTe),c=h.magnitude(a);if(r>=c+s)return e.clone(n),n;if(s>=c+r)return t.clone(n),n;let u=(r+c+s)*.5,f=h.multiplyByScalar(a,(-r+u)/c,ebe);return h.add(f,i,f),h.clone(f,n.center),n.radius=u,n};var tbe=new h;fn.expand=function(e,t,n){n=fn.clone(e,n);let i=h.magnitude(h.subtract(t,n.center,tbe));return i>n.radius&&(n.radius=i),n};fn.intersectPlane=function(e,t){let n=e.center,i=e.radius,r=t.normal,o=h.dot(r,n)+t.distance;return o<-i?Jt.OUTSIDE:o<i?Jt.INTERSECTING:Jt.INSIDE};fn.transform=function(e,t,n){return l(n)||(n=new fn),n.center=N.multiplyByPoint(t,e.center,n.center),n.radius=N.getMaximumScale(t)*e.radius,n};var nbe=new h;fn.distanceSquaredTo=function(e,t){let n=h.subtract(e.center,t,nbe),i=h.magnitude(n)-e.radius;return i<=0?0:i*i};fn.transformWithoutScale=function(e,t,n){return l(n)||(n=new fn),n.center=N.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var ibe=new h;fn.computePlaneDistances=function(e,t,n,i){l(i)||(i=new $c);let r=h.subtract(e.center,t,ibe),o=h.dot(n,r);return i.start=o-e.radius,i.stop=o+e.radius,i};var YX=new h,rbe=new h,obe=new h,sbe=new h,abe=new h,cbe=new me,XX=new Array(8);for(let e=0;e<8;++e)XX[e]=new h;var lbe=new Ii;fn.projectTo2D=function(e,t,n){t=y(t,lbe);let i=t.ellipsoid,r=e.center,o=e.radius,s;h.equals(r,h.ZERO)?s=h.clone(h.UNIT_X,YX):s=i.geodeticSurfaceNormal(r,YX);let a=h.cross(h.UNIT_Z,s,rbe);h.normalize(a,a);let c=h.cross(s,a,obe);h.normalize(c,c),h.multiplyByScalar(s,o,s),h.multiplyByScalar(c,o,c),h.multiplyByScalar(a,o,a);let u=h.negate(c,abe),f=h.negate(a,sbe),d=XX,p=d[0];h.add(s,c,p),h.add(p,a,p),p=d[1],h.add(s,c,p),h.add(p,f,p),p=d[2],h.add(s,u,p),h.add(p,f,p),p=d[3],h.add(s,u,p),h.add(p,a,p),h.negate(s,s),p=d[4],h.add(s,c,p),h.add(p,a,p),p=d[5],h.add(s,c,p),h.add(p,f,p),p=d[6],h.add(s,u,p),h.add(p,f,p),p=d[7],h.add(s,u,p),h.add(p,a,p);let g=d.length;for(let A=0;A<g;++A){let b=d[A];h.add(r,b,b);let T=i.cartesianToCartographic(b,cbe);t.project(T,b)}n=fn.fromPoints(d,n),r=n.center;let m=r.x,x=r.y,C=r.z;return r.x=C,r.y=m,r.z=x,n};fn.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)};fn.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&e.radius===t.radius};fn.prototype.intersectPlane=function(e){return fn.intersectPlane(this,e)};fn.prototype.distanceSquaredTo=function(e){return fn.distanceSquaredTo(this,e)};fn.prototype.computePlaneDistances=function(e,t,n){return fn.computePlaneDistances(this,e,t,n)};fn.prototype.isOccluded=function(e){return fn.isOccluded(this,e)};fn.prototype.equals=function(e){return fn.equals(this,e)};fn.prototype.clone=function(e){return fn.clone(this,e)};fn.prototype.volume=function(){let e=this.radius;return HTe*e*e*e};var re=fn;var oi=Ns(tK(),1);function Q8(e,t){let n;return typeof document<"u"&&(n=document),Q8._implementation(e,t,n)}Q8._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=y(n.baseURI,n.location.href)}let i=new oi.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Wf=Q8;function nK(e,t){if(e===null||typeof e!="object")return e;t=y(t,!1);let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let r=e[i];t&&(r=nK(r,t)),n[i]=r}return n}var $e=nK;function iK(e,t,n){n=y(n,!1);let i={},r=l(e),o=l(t),s,a,c;if(r)for(s in e)e.hasOwnProperty(s)&&(a=e[s],o&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=iK(a,c,n):i[s]=a):i[s]=a);if(o)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var rt=iK;function ube(){let e,t,n=new Promise(function(i,r){e=i,t=r});return{resolve:e,reject:t,promise:n}}var ts=ube;function fbe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new oi.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var bP=fbe;function dbe(e){let t=new oi.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var jC=dbe;var rK={};function hbe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=rK[t];l(i)||(i={},rK[t]=i);let r=i[n];if(!l(r)){let o=document.createElement("canvas");o.width=t,o.height=n,r=o.getContext("2d"),r.globalCompositeOperation="copy",i[n]=r}return r.drawImage(e,0,0,t,n),r.getImageData(0,0,t,n).data}var ch=hbe;var mbe=/^blob:/i;function pbe(e){return mbe.test(e)}var qC=pbe;var lh;function _be(e){l(lh)||(lh=document.createElement("a")),lh.href=window.location.href;let t=lh.host,n=lh.protocol;return lh.href=e,lh.href=lh.href,n!==lh.protocol||t!==lh.host}var YC=_be;var gbe=/^data:/i;function ybe(e){return gbe.test(e)}var m_=ybe;function xbe(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let r=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,r.removeChild(t),n()},t.onerror=function(o){i(o)},r.appendChild(t)})}var XC=xbe;function Cbe(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let o=0,s=i.length;o<s;++o)t+=`${r+encodeURIComponent(i[o])}&`;else t+=`${r+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var KC=Cbe;function Abe(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,r=n.length;i<r;++i){let o=n[i].split("="),s=decodeURIComponent(o[0]),a=o[1];l(a)?a=decodeURIComponent(a):a="";let c=t[s];typeof c=="string"?t[s]=[c,a]:Array.isArray(c)?c.push(a):t[s]=a}return t}var Mu=Abe;var Tbe={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},mi=Object.freeze(Tbe);var bbe={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},ro=Object.freeze(bbe);function EP(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.throttleByServer,!1),n=y(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=y(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=y(e.type,ro.OTHER),this.serverKey=void 0,this.state=mi.UNISSUED,this.deferred=void 0,this.cancelled=!1}EP.prototype.cancel=function(){this.cancelled=!0};EP.prototype.clone=function(e){return l(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=this.RequestState.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new EP(this)};var oo=EP;function Ebe(e){let t={};if(!e)return t;let n=e.split(`\r
- `);for(let i=0;i<n.length;++i){let r=n[i],o=r.indexOf(": ");if(o>0){let s=r.substring(0,o),a=r.substring(o+2);t[s]=a}}return t}var SP=Ebe;function oK(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=SP(this.responseHeaders))}oK.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var Bm=oK;function oS(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(oS.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});oS.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};oS.prototype.removeEventListener=function(e,t){let n=this._listeners,i=this._scopes,r=-1;for(let o=0;o<n.length;o++)if(n[o]===e&&i[o]===t){r=o;break}return r!==-1?(this._insideRaiseEvent?(this._toRemove.push(r),n[r]=void 0,i[r]=void 0):(n.splice(r,1),i.splice(r,1)),!0):!1};function Sbe(e,t){return t-e}oS.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,i=t.length;for(e=0;e<i;e++){let o=t[e];l(o)&&t[e].apply(n[e],arguments)}let r=this._toRemove;if(i=r.length,i>0){for(r.sort(Sbe),e=0;e<i;e++){let o=r[e];t.splice(o,1),n.splice(o,1)}r.length=0}this._insideRaiseEvent=!1};var ge=oS;function ry(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(ry.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e<t){let n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function eH(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}ry.prototype.reserve=function(e){e=y(e,this._length),this._array.length=e};ry.prototype.heapify=function(e){e=y(e,0);let t=this._length,n=this._comparator,i=this._array,r=-1,o=!0;for(;o;){let s=2*(e+1),a=s-1;a<t&&n(i[a],i[e])<0?r=a:r=e,s<t&&n(i[s],i[r])<0&&(r=s),r!==e?(eH(i,r,e),e=r):o=!1}};ry.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};ry.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,r=this._length++;for(r<t.length?t[r]=e:t.push(e);r!==0;){let s=Math.floor((r-1)/2);if(n(t[r],t[s])<0)eH(t,r,s),r=s;else break}let o;return l(i)&&this._length>i&&(o=t[i],this._length=i),o};ry.prototype.pop=function(e){if(e=y(e,0),this._length===0)return;let t=this._array,n=t[e];return eH(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var wP=ry;function wbe(e,t){return e.priority-t.priority}var Ji={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},$C=20,Ra=new wP({comparator:wbe});Ra.maximumLength=$C;Ra.reserve($C);var uh=[],Lm={},vbe=typeof document<"u"?new oi.default(document.location.href):new oi.default,vP=new ge;function qr(){}qr.maximumRequests=50;qr.maximumRequestsPerServer=6;qr.requestsByServer={"api.cesium.com:443":18,"assets.cesium.com:443":18};qr.throttleRequests=!0;qr.debugShowStatistics=!1;qr.requestCompletedEvent=vP;Object.defineProperties(qr,{statistics:{get:function(){return Ji}},priorityHeapLength:{get:function(){return $C},set:function(e){if(e<$C)for(;Ra.length>e;){let t=Ra.pop();oy(t)}$C=e,Ra.maximumLength=e,Ra.reserve(e)}}});function sK(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}qr.serverHasOpenSlots=function(e,t){t=y(t,1);let n=y(qr.requestsByServer[e],qr.maximumRequestsPerServer);return Lm[e]+t<=n};qr.heapHasOpenSlots=function(e){return Ra.length+e<=$C};function aK(e){return e.state===mi.UNISSUED&&(e.state=mi.ISSUED,e.deferred=ts()),e.deferred.promise}function Dbe(e){return function(t){if(e.state===mi.CANCELLED)return;let n=e.deferred;--Ji.numberOfActiveRequests,--Lm[e.serverKey],vP.raiseEvent(),e.state=mi.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Pbe(e){return function(t){e.state!==mi.CANCELLED&&(++Ji.numberOfFailedRequests,--Ji.numberOfActiveRequests,--Lm[e.serverKey],vP.raiseEvent(t),e.state=mi.FAILED,e.deferred.reject(t))}}function cK(e){let t=aK(e);return e.state=mi.ACTIVE,uh.push(e),++Ji.numberOfActiveRequests,++Ji.numberOfActiveRequestsEver,++Lm[e.serverKey],e.requestFunction().then(Dbe(e)).catch(Pbe(e)),t}function oy(e){let t=e.state===mi.ACTIVE;if(e.state=mi.CANCELLED,++Ji.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--Ji.numberOfActiveRequests,--Lm[e.serverKey],++Ji.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}qr.update=function(){let e,t,n=0,i=uh.length;for(e=0;e<i;++e){if(t=uh[e],t.cancelled&&oy(t),t.state!==mi.ACTIVE){++n;continue}n>0&&(uh[e-n]=t)}uh.length-=n;let r=Ra.internalArray,o=Ra.length;for(e=0;e<o;++e)sK(r[e]);Ra.resort();let s=Math.max(qr.maximumRequests-uh.length,0),a=0;for(;a<s&&Ra.length>0;){if(t=Ra.pop(),t.cancelled){oy(t);continue}if(t.throttleByServer&&!qr.serverHasOpenSlots(t.serverKey)){oy(t);continue}cK(t),++a}Ibe()};qr.getServerKey=function(e){let t=new oi.default(e);t.scheme()===""&&(t=new oi.default(e).absoluteTo(vbe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=Lm[n];return l(i)||(Lm[n]=0),n};qr.request=function(e){if(m_(e.url)||qC(e.url))return vP.raiseEvent(),e.state=mi.RECEIVED,e.requestFunction();if(++Ji.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=qr.getServerKey(e.url)),qr.throttleRequests&&e.throttleByServer&&!qr.serverHasOpenSlots(e.serverKey))return;if(!qr.throttleRequests||!e.throttle)return cK(e);if(uh.length>=qr.maximumRequests)return;sK(e);let t=Ra.insert(e);if(l(t)){if(t===e)return;oy(t)}return aK(e)};function Ibe(){!qr.debugShowStatistics||(Ji.numberOfActiveRequests===0&&Ji.lastNumberOfActiveRequests>0&&(Ji.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Ji.numberOfAttemptedRequests}`),Ji.numberOfAttemptedRequests=0),Ji.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Ji.numberOfCancelledRequests}`),Ji.numberOfCancelledRequests=0),Ji.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Ji.numberOfCancelledActiveRequests}`),Ji.numberOfCancelledActiveRequests=0),Ji.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Ji.numberOfFailedRequests}`),Ji.numberOfFailedRequests=0)),Ji.lastNumberOfActiveRequests=Ji.numberOfActiveRequests)}qr.clearForSpecs=function(){for(;Ra.length>0;){let t=Ra.pop();oy(t)}let e=uh.length;for(let t=0;t<e;++t)oy(uh[t]);uh.length=0,Lm={},Ji.numberOfAttemptedRequests=0,Ji.numberOfActiveRequests=0,Ji.numberOfCancelledRequests=0,Ji.numberOfCancelledActiveRequests=0,Ji.numberOfFailedRequests=0,Ji.numberOfActiveRequestsEver=0,Ji.lastNumberOfActiveRequests=0};qr.numberOfActiveRequestsByServer=function(e){return Lm[e]};qr.requestHeap=Ra;var uc=qr;var sS={},ZC={};sS.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(ZC[n])||(ZC[n]=!0)};sS.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(ZC[n])&&delete ZC[n]};function Obe(e){let t=new oi.default(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}sS.contains=function(e){let t=Obe(e);return!!(l(t)&&l(ZC[t]))};sS.clear=function(){ZC={}};var aS=sS;var fK=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function nH(e,t,n,i){let r=e.query();if(r.length===0)return{};let o;if(r.indexOf("=")===-1){let s={};s[r]=void 0,o=s}else o=Mu(r);n?t._queryParameters=PP(o,t._queryParameters,i):t._queryParameters=o,e.search("")}function Rbe(e,t){let n=t._queryParameters,i=Object.keys(n);i.length===1&&!l(n[i[0]])?e.search(i[0]):e.search(KC(n))}function fh(e,t){return l(e)?l(e.clone)?e.clone():$e(e):t}function iH(e){if(e.state===mi.ISSUED||e.state===mi.ACTIVE)throw new fe("The Resource is already being fetched.");e.state=mi.UNISSUED,e.deferred=void 0}function PP(e,t,n){if(!n)return rt(e,t);let i=$e(e,!0);for(let r in t)if(t.hasOwnProperty(r)){let o=i[r],s=t[r];l(o)?(Array.isArray(o)||(o=i[r]=[o]),i[r]=o.concat(s)):i[r]=Array.isArray(s)?s.slice():s}return i}function Ct(e){e=y(e,y.EMPTY_OBJECT),typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=fh(e.templateValues,{}),this._queryParameters=fh(e.queryParameters,{}),this.headers=fh(e.headers,{}),this.request=y(e.request,new oo),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=y(e.retryAttempts,0),this._retryCount=0;let t=new oi.default(e.url);nH(t,this,!0,!0),t.fragment(""),this._url=t.toString()}Ct.createIfNeeded=function(e){return e instanceof Ct?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new Ct({url:e})};var JC;Ct.supportsImageBitmapOptions=function(){if(l(JC))return JC;if(typeof createImageBitmap!="function")return JC=Promise.resolve(!1),JC;let e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC";return JC=Ct.fetchBlob({url:e}).then(function(t){let n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){let n=ch(t[0]),i=ch(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),JC};Object.defineProperties(Ct,{isBlobSupported:{get:function(){return fK}}});Object.defineProperties(Ct.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){let t=new oi.default(e);nH(t,this,!1),t.fragment(""),this._url=t.toString()}},extension:{get:function(){return jC(this._url)}},isDataUri:{get:function(){return m_(this._url)}},isBlobUri:{get:function(){return qC(this._url)}},isCrossOriginUrl:{get:function(){return YC(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}}});Ct.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Ct.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=new oi.default(this._url);e&&Rbe(n,this);let i=n.toString().replace(/%7B/g,"{").replace(/%7D/g,"}"),r=this._templateValues;return i=i.replace(/{(.*?)}/g,function(o,s){let a=r[s];return l(a)?encodeURIComponent(a):o}),t&&l(this.proxy)&&(i=this.proxy.getURL(i)),i};Ct.prototype.setQueryParameters=function(e,t){t?this._queryParameters=PP(this._queryParameters,e,!1):this._queryParameters=PP(e,this._queryParameters,!1)};Ct.prototype.appendQueryParameters=function(e){this._queryParameters=PP(e,this._queryParameters,!0)};Ct.prototype.setTemplateValues=function(e,t){t?this._templateValues=rt(this._templateValues,e):this._templateValues=rt(e,this._templateValues)};Ct.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=new oi.default(e.url),i=y(e.preserveQueryParameters,!1);nH(n,t,!0,i),n.fragment(""),n.scheme()!==""?t._url=n.toString():t._url=n.absoluteTo(new oi.default(Wf(this._url))).toString()}return l(e.queryParameters)&&(t._queryParameters=rt(e.queryParameters,t._queryParameters)),l(e.templateValues)&&(t._templateValues=rt(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=rt(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};Ct.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};Ct.prototype.clone=function(e){return l(e)||(e=new Ct({url:this._url})),e._url=this._url,e._queryParameters=$e(this._queryParameters),e._templateValues=$e(this._templateValues),e.headers=$e(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e};Ct.prototype.getBaseUri=function(e){return bP(this.getUrlComponent(e),e)};Ct.prototype.appendForwardSlash=function(){this._url=hP(this._url)};Ct.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Ct.fetchArrayBuffer=function(e){return new Ct(e).fetchArrayBuffer()};Ct.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Ct.fetchBlob=function(e){return new Ct(e).fetchBlob()};Ct.prototype.fetchImage=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.preferImageBitmap,!1),n=y(e.preferBlob,!1),i=y(e.flipY,!1),r=y(e.skipColorSpaceConversion,!1);if(iH(this.request),!fK||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return tH({resource:this,flipY:i,skipColorSpaceConversion:r,preferImageBitmap:t});let o=this.fetchBlob();if(!l(o))return;let s,a,c,u;return Ct.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,o}).then(function(f){if(!l(f))return;if(u=f,a)return Ct.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r});let d=window.URL.createObjectURL(f);return c=new Ct({url:d}),tH({resource:c,flipY:i,skipColorSpaceConversion:r,preferImageBitmap:!1})}).then(function(f){if(!!l(f))return f.blob=u,a||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};function tH(e){let t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,r=e.preferImageBitmap,o=t.request;o.url=t.url,o.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=ts();return Ct._Implementations.createImage(o,a,c,n,i,r),c.promise};let s=uc.request(o);if(!!l(s))return s.catch(function(a){return o.state!==mi.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(o.state=mi.UNISSUED,o.deferred=void 0,tH({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:r})):Promise.reject(a)})})}Ct.fetchImage=function(e){return new Ct(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};Ct.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Ct.fetchText=function(e){return new Ct(e).fetchText()};Ct.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(!!l(e))return e.then(function(t){if(!!l(t))return JSON.parse(t)})};Ct.fetchJson=function(e){return new Ct(e).fetchJson()};Ct.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Ct.fetchXML=function(e){return new Ct(e).fetchXML()};Ct.prototype.fetchJsonp=function(e){e=y(e,"callback"),iH(this.request);let t;do t=`loadJsonp${M.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return dK(this,e,t)};function dK(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let r=e.request;r.url=e.url,r.requestFunction=function(){let s=ts();return window[n]=function(a){s.resolve(a);try{delete window[n]}catch{window[n]=void 0}},Ct._Implementations.loadAndExecuteScript(e.url,n,s),s.promise};let o=uc.request(r);if(!!l(o))return o.catch(function(s){return r.state!==mi.FAILED?Promise.reject(s):e.retryOnError(s).then(function(a){return a?(r.state=mi.UNISSUED,r.deferred=void 0,dK(e,t,n)):Promise.reject(s)})})}Ct.fetchJsonp=function(e){return new Ct(e).fetchJsonp(e.callbackParameterName)};Ct.prototype._makeRequest=function(e){let t=this;iH(t.request);let n=t.request;n.url=t.url,n.requestFunction=function(){let r=e.responseType,o=rt(e.headers,t.headers),s=e.overrideMimeType,a=e.method,c=e.data,u=ts(),f=Ct._Implementations.loadWithXhr(t.url,r,a,c,o,u,s);return l(f)&&l(f.abort)&&(n.cancelFunction=function(){f.abort()}),u.promise};let i=uc.request(n);if(!!l(i))return i.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==mi.FAILED?Promise.reject(r):t.retryOnError(r).then(function(o){return o?(n.state=mi.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};var Mbe=/^data:(.*?)(;base64)?,(.*)$/;function DP(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function lK(e,t){let n=DP(e,t),i=new ArrayBuffer(n.length),r=new Uint8Array(i);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return i}function Bbe(e,t){t=y(t,"");let n=e[1],i=!!e[2],r=e[3],o,s;switch(t){case"":case"text":return DP(i,r);case"arraybuffer":return lK(i,r);case"blob":return o=lK(i,r),new Blob([o],{type:n});case"document":return s=new DOMParser,s.parseFromString(DP(i,r),n);case"json":return JSON.parse(DP(i,r));default:}}Ct.prototype.fetch=function(e){return e=fh(e,{}),e.method="GET",this._makeRequest(e)};Ct.fetch=function(e){return new Ct(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ct.prototype.delete=function(e){return e=fh(e,{}),e.method="DELETE",this._makeRequest(e)};Ct.delete=function(e){return new Ct(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};Ct.prototype.head=function(e){return e=fh(e,{}),e.method="HEAD",this._makeRequest(e)};Ct.head=function(e){return new Ct(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ct.prototype.options=function(e){return e=fh(e,{}),e.method="OPTIONS",this._makeRequest(e)};Ct.options=function(e){return new Ct(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ct.prototype.post=function(e,t){return Nl.defined("data",e),t=fh(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};Ct.post=function(e){return new Ct(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ct.prototype.put=function(e,t){return Nl.defined("data",e),t=fh(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};Ct.put=function(e){return new Ct(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ct.prototype.patch=function(e,t){return Nl.defined("data",e),t=fh(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};Ct.patch=function(e){return new Ct(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ct._Implementations={};Ct._Implementations.loadImageElement=function(e,t,n){let i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(r){n.reject(r)},t&&(aS.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};Ct._Implementations.createImage=function(e,t,n,i,r,o){let s=e.url;Ct.supportsImageBitmapOptions().then(function(a){if(!(a&&o)){Ct._Implementations.loadImageElement(s,t,n);return}let c="blob",u="GET",f=ts(),d=Ct._Implementations.loadWithXhr(s,c,u,void 0,void 0,f,void 0,void 0,void 0);return l(d)&&l(d.abort)&&(e.cancelFunction=function(){d.abort()}),f.promise.then(function(p){if(!l(p)){n.reject(new fe(`Successfully retrieved ${s} but it contained no content.`));return}return Ct.createImageBitmapFromBlob(p,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r})}).then(function(p){n.resolve(p)})}).catch(function(a){n.reject(a)})};Ct.createImageBitmapFromBlob=function(e,t){return Nl.defined("options",t),Nl.typeOf.bool("options.flipY",t.flipY),Nl.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),Nl.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function uK(e,t){switch(t){case"text":return e.toString("utf8");case"json":return JSON.parse(e.toString("utf8"));default:return new Uint8Array(e).buffer}}function Lbe(e,t,n,i,r,o,s){let a=require("url").parse(e),c=a.protocol==="https:"?require("https"):require("http"),u=require("zlib"),f={protocol:a.protocol,hostname:a.hostname,port:a.port,path:a.path,query:a.query,method:n,headers:r};c.request(f).on("response",function(d){if(d.statusCode<200||d.statusCode>=300){o.reject(new Bm(d.statusCode,d,d.headers));return}let p=[];d.on("data",function(g){p.push(g)}),d.on("end",function(){let g=Buffer.concat(p);d.headers["content-encoding"]==="gzip"?u.gunzip(g,function(m,x){m?o.reject(new fe("Error decompressing response.")):o.resolve(uK(x,t))}):o.resolve(uK(g,t))})}).on("error",function(d){o.reject(new Bm)}).end()}var Nbe=typeof XMLHttpRequest>"u";Ct._Implementations.loadWithXhr=function(e,t,n,i,r,o,s){let a=Mbe.exec(e);if(a!==null){o.resolve(Bbe(a,t));return}if(Nbe){Lbe(e,t,n,i,r,o,s);return}let c=new XMLHttpRequest;if(aS.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(r))for(let f in r)r.hasOwnProperty(f)&&c.setRequestHeader(f,r[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){o.reject(new Bm(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,d=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};g.forEach(function(x){let C=x.split(": "),A=C.shift();m[A]=C.join(": ")}),o.resolve(m);return}if(c.status===204)o.resolve();else if(l(f)&&(!l(t)||d===t))o.resolve(f);else if(t==="json"&&typeof f=="string")try{o.resolve(JSON.parse(f))}catch(p){o.reject(p)}else(d===""||d==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?o.resolve(c.responseXML):(d===""||d==="text")&&l(c.responseText)?o.resolve(c.responseText):o.reject(new fe("Invalid XMLHttpRequest response type."))},c.onerror=function(f){o.reject(new Bm)},c.send(i),c};Ct._Implementations.loadAndExecuteScript=function(e,t,n){return XC(e,t).catch(function(i){n.reject(i)})};Ct._DefaultImplementations={};Ct._DefaultImplementations.createImage=Ct._Implementations.createImage;Ct._DefaultImplementations.loadWithXhr=Ct._Implementations.loadWithXhr;Ct._DefaultImplementations.loadAndExecuteScript=Ct._Implementations.loadAndExecuteScript;Ct.DEFAULT=Object.freeze(new Ct({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var De=Ct;var hK=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Fbe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),r=hK.exec(i);if(r!==null)return r[1]}}var QC;function mK(e){return typeof document>"u"?e:(l(QC)||(QC=document.createElement("a")),QC.href=e,QC.href=QC.href,QC.href)}var sy;function pK(){if(l(sy))return sy;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?e=Wf("..",ay("Core/buildModuleUrl.js")):e=Fbe(),sy=new De({url:mK(e)}),sy.appendForwardSlash(),sy}function Vbe(e){return mK(require.toUrl(`../${e}`))}function _K(e){return pK().getDerivedResource({url:e}).url}var IP;function ay(e){return l(IP)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?IP=Vbe:IP=_K),IP(e)}ay._cesiumScriptRegex=hK;ay._buildModuleUrlFromBaseUrl=_K;ay._clearBaseResource=function(){sy=void 0};ay.setBaseUrl=function(e){sy=De.DEFAULT.getDerivedResource({url:e})};ay.getCesiumBaseUrl=pK;var Qt=ay;function bt(e,t){this.x=y(e,0),this.y=y(t,0)}bt.fromElements=function(e,t,n){return l(n)?(n.x=e,n.y=t,n):new bt(e,t)};bt.clone=function(e,t){if(!!l(e))return l(t)?(t.x=e.x,t.y=e.y,t):new bt(e.x,e.y)};bt.fromCartesian3=bt.clone;bt.fromCartesian4=bt.clone;bt.packedLength=2;bt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n]=e.y,t};bt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new bt),n.x=e[t++],n.y=e[t],n};bt.packArray=function(e,t){let n=e.length,i=n*2;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)bt.pack(e[r],t,r*2);return t};bt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){let r=i/2;t[r]=bt.unpack(e,i,t[r])}return t};bt.fromArray=bt.unpack;bt.maximumComponent=function(e){return Math.max(e.x,e.y)};bt.minimumComponent=function(e){return Math.min(e.x,e.y)};bt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n};bt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n};bt.clamp=function(e,t,n,i){let r=M.clamp(e.x,t.x,n.x),o=M.clamp(e.y,t.y,n.y);return i.x=r,i.y=o,i};bt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y};bt.magnitude=function(e){return Math.sqrt(bt.magnitudeSquared(e))};var OP=new bt;bt.distance=function(e,t){return bt.subtract(e,t,OP),bt.magnitude(OP)};bt.distanceSquared=function(e,t){return bt.subtract(e,t,OP),bt.magnitudeSquared(OP)};bt.normalize=function(e,t){let n=bt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t};bt.dot=function(e,t){return e.x*t.x+e.y*t.y};bt.cross=function(e,t){return e.x*t.y-e.y*t.x};bt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n};bt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n};bt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n};bt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n};bt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n};bt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n};bt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t};bt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var gK=new bt;bt.lerp=function(e,t,n,i){return bt.multiplyByScalar(t,n,gK),i=bt.multiplyByScalar(e,1-n,i),bt.add(gK,i,i)};var yK=new bt,xK=new bt;bt.angleBetween=function(e,t){return bt.normalize(e,yK),bt.normalize(t,xK),M.acosClamped(bt.dot(yK,xK))};var kbe=new bt;bt.mostOrthogonalAxis=function(e,t){let n=bt.normalize(e,kbe);return bt.abs(n,n),n.x<=n.y?t=bt.clone(bt.UNIT_X,t):t=bt.clone(bt.UNIT_Y,t),t};bt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y};bt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]};bt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&M.equalsEpsilon(e.x,t.x,n,i)&&M.equalsEpsilon(e.y,t.y,n,i)};bt.ZERO=Object.freeze(new bt(0,0));bt.ONE=Object.freeze(new bt(1,1));bt.UNIT_X=Object.freeze(new bt(1,0));bt.UNIT_Y=Object.freeze(new bt(0,1));bt.prototype.clone=function(e){return bt.clone(this,e)};bt.prototype.equals=function(e){return bt.equals(this,e)};bt.prototype.equalsEpsilon=function(e,t,n){return bt.equalsEpsilon(this,e,t,n)};bt.prototype.toString=function(){return`(${this.x}, ${this.y})`};var W=bt;function p_(e){e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,oe.WGS84),this._rectangle=y(e.rectangle,he.MAX_VALUE),this._projection=new Ii(this._ellipsoid),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(p_.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});p_.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};p_.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};p_.prototype.rectangleToNativeRectangle=function(e,t){let n=M.toDegrees(e.west),i=M.toDegrees(e.south),r=M.toDegrees(e.east),o=M.toDegrees(e.north);return l(t)?(t.west=n,t.south=i,t.east=r,t.north=o,t):new he(n,i,r,o)};p_.prototype.tileXYToNativeRectangle=function(e,t,n,i){let r=this.tileXYToRectangle(e,t,n,i);return r.west=M.toDegrees(r.west),r.south=M.toDegrees(r.south),r.east=M.toDegrees(r.east),r.north=M.toDegrees(r.north),r};p_.prototype.tileXYToRectangle=function(e,t,n,i){let r=this._rectangle,o=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=r.width/o,c=e*a+r.west,u=(e+1)*a+r.west,f=r.height/s,d=r.north-t*f,p=r.north-(t+1)*f;return l(i)||(i=new he(c,p,u,d)),i.west=c,i.south=p,i.east=u,i.north=d,i};p_.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!he.contains(i,e))return;let r=this.getNumberOfXTilesAtLevel(t),o=this.getNumberOfYTilesAtLevel(t),s=i.width/r,a=i.height/o,c=e.longitude;i.east<i.west&&(c+=M.TWO_PI);let u=(c-i.west)/s|0;u>=r&&(u=r-1);let f=(i.north-e.latitude)/a|0;return f>=o&&(f=o-1),l(n)?(n.x=u,n.y=f,n):new W(u,f)};var Qi=p_;var CK=new h,AK=new h,TK=new me,rH=new h,Ube=new h,bK=new re,zbe=new Qi,cS=[new me,new me,new me,new me],lS=new W,Wo={};Wo.initialize=function(){let e=Wo._initPromise;return l(e)||(e=De.fetchJson(Qt("Assets/approximateTerrainHeights.json")).then(function(t){Wo._terrainHeights=t}),Wo._initPromise=e),e};Wo.getMinimumMaximumHeights=function(e,t){t=y(t,oe.WGS84);let n=EK(e),i=Wo._defaultMinTerrainHeight,r=Wo._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=Wo._terrainHeights[o];l(s)&&(i=s[0],r=s[1]),t.cartographicToCartesian(he.northeast(e,TK),CK),t.cartographicToCartesian(he.southwest(e,TK),AK),h.midpoint(AK,CK,rH);let a=t.scaleToGeodeticSurface(rH,Ube);if(l(a)){let c=h.distance(rH,a);i=Math.min(i,-c)}else i=Wo._defaultMinTerrainHeight}return i=Math.max(Wo._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:r}};Wo.getBoundingSphere=function(e,t){t=y(t,oe.WGS84);let n=EK(e),i=Wo._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=Wo._terrainHeights[o];l(s)&&(i=s[1])}let r=re.fromRectangle3D(e,t,0);return re.fromRectangle3D(e,t,i,bK),re.union(r,bK,r)};function EK(e){me.fromRadians(e.east,e.north,0,cS[0]),me.fromRadians(e.west,e.north,0,cS[1]),me.fromRadians(e.east,e.south,0,cS[2]),me.fromRadians(e.west,e.south,0,cS[3]);let t=0,n=0,i=0,r=0,o=Wo._terrainHeightsMaxLevel,s;for(s=0;s<=o;++s){let a=!1;for(let c=0;c<4;++c){let u=cS[c];if(zbe.positionToTileXY(u,s,lS),c===0)i=lS.x,r=lS.y;else if(i!==lS.x||r!==lS.y){a=!0;break}}if(a)break;t=i,n=r}if(s!==0)return{x:t,y:n,level:s>o?o:s-1}}Wo._terrainHeightsMaxLevel=6;Wo._defaultMaxTerrainHeight=9e3;Wo._defaultMinTerrainHeight=-1e5;Wo._terrainHeights=void 0;Wo._initPromise=void 0;Object.defineProperties(Wo,{initialized:{get:function(){return l(Wo._terrainHeights)}}});var fi=Wo;var dS=Ns(NK(),1);var uEe=0,uH={};function Vm(e,t){let n,i=e;l(uH[i])?n=uH[i]:(n=uEe++,uH[i]=n),t=y(t,!1),this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(Vm.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen},set:function(e){this._showOnScreen=e}},element:{get:function(){if(!l(this._element)){let e=dS.default.sanitize(this._html),t=document.createElement("div");t._creditId=this._id,t.style.display="inline",t.innerHTML=e;let n=t.querySelectorAll("a");for(let i=0;i<n.length;i++)n[i].setAttribute("target","_blank");this._element=t}return this._element}}});Vm.equals=function(e,t){return e===t||l(e)&&l(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};Vm.prototype.equals=function(e){return Vm.equals(this,e)};Vm.getIonCredit=function(e){let t=l(e.collapsible)&&!e.collapsible,n=new Vm(e.html,t);return n._isIon=n.html.indexOf("ion-credit.png")!==-1,n};Vm.clone=function(e){if(l(e))return new Vm(e.html,e.showOnScreen)};var Gt=Vm;var fEe={NONE:0,LERC:1},km=Object.freeze(fEe);function dc(e,t,n){this.minimum=h.clone(y(e,h.ZERO)),this.maximum=h.clone(y(t,h.ZERO)),l(n)?n=h.clone(n):n=h.midpoint(this.minimum,this.maximum,new h),this.center=n}dc.fromCorners=function(e,t,n){return l(n)||(n=new dc),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};dc.fromPoints=function(e,t){if(l(t)||(t=new dc),!l(e)||e.length===0)return t.minimum=h.clone(h.ZERO,t.minimum),t.maximum=h.clone(h.ZERO,t.maximum),t.center=h.clone(h.ZERO,t.center),t;let n=e[0].x,i=e[0].y,r=e[0].z,o=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let d=1;d<c;d++){let p=e[d],g=p.x,m=p.y,x=p.z;n=Math.min(g,n),o=Math.max(g,o),i=Math.min(m,i),s=Math.max(m,s),r=Math.min(x,r),a=Math.max(x,a)}let u=t.minimum;u.x=n,u.y=i,u.z=r;let f=t.maximum;return f.x=o,f.y=s,f.z=a,t.center=h.midpoint(u,f,t.center),t};dc.clone=function(e,t){if(!!l(e))return l(t)?(t.minimum=h.clone(e.minimum,t.minimum),t.maximum=h.clone(e.maximum,t.maximum),t.center=h.clone(e.center,t.center),t):new dc(e.minimum,e.maximum,e.center)};dc.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&h.equals(e.minimum,t.minimum)&&h.equals(e.maximum,t.maximum)};var NP=new h;dc.intersectPlane=function(e,t){NP=h.subtract(e.maximum,e.minimum,NP);let n=h.multiplyByScalar(NP,.5,NP),i=t.normal,r=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),o=h.dot(e.center,i)+t.distance;return o-r>0?Jt.INSIDE:o+r<0?Jt.OUTSIDE:Jt.INTERSECTING};dc.prototype.clone=function(e){return dc.clone(this,e)};dc.prototype.intersectPlane=function(e){return dc.intersectPlane(this,e)};dc.prototype.equals=function(e){return dc.equals(this,e)};var ly=dc;function hh(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(hh.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=h.magnitudeSquared(n)-1;h.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var FK=new h;hh.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,FK);return dH(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};hh.prototype.isScaledSpacePointVisible=function(e){return dH(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var dEe=new h;hh.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,r;return l(t)&&t<0&&n.minimumRadius>-t?(r=dEe,r.x=this._cameraPosition.x/(n.radii.x+t),r.y=this._cameraPosition.y/(n.radii.y+t),r.z=this._cameraPosition.z/(n.radii.z+t),i=r.x*r.x+r.y*r.y+r.z*r.z-1):(r=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),dH(e,r,i)};hh.prototype.computeHorizonCullingPoint=function(e,t,n){return UK(this._ellipsoid,e,t,n)};var VK=oe.clone(oe.UNIT_SPHERE);hh.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let r=kK(this._ellipsoid,n,VK);return UK(r,e,t,i)};hh.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,r){return zK(this._ellipsoid,e,t,n,i,r)};hh.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,r,o){let s=kK(this._ellipsoid,r,VK);return zK(s,e,t,n,i,o)};var hEe=[];hh.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=he.subsample(e,t,0,hEe),r=re.fromPoints(i);if(!(h.magnitude(r.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(r.center,i,n)};var mEe=new h;function kK(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=h.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,mEe);e=oe.fromCartesian3(i,n)}return e}function UK(e,t,n,i){l(i)||(i=new h);let r=WK(e,t),o=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],u=HK(e,c,r);if(u<0)return;o=Math.max(o,u)}return GK(r,o,i)}var FP=new h;function zK(e,t,n,i,r,o){l(o)||(o=new h),i=y(i,3),r=y(r,h.ZERO);let s=WK(e,t),a=0;for(let c=0,u=n.length;c<u;c+=i){FP.x=n[c]+r.x,FP.y=n[c+1]+r.y,FP.z=n[c+2]+r.z;let f=HK(e,FP,s);if(f<0)return;a=Math.max(a,f)}return GK(s,a,o)}function dH(e,t,n){let i=t,r=n,o=h.subtract(e,i,FK),s=-h.dot(o,i);return!(r<0?s>0:s>r&&s*s/h.magnitudeSquared(o)>r)}var pEe=new h,_Ee=new h;function HK(e,t,n){let i=e.transformPositionToScaledSpace(t,pEe),r=h.magnitudeSquared(i),o=Math.sqrt(r),s=h.divideByScalar(i,o,_Ee);r=Math.max(1,r),o=Math.max(1,o);let a=h.dot(s,n),c=h.magnitude(h.cross(s,n,s)),u=1/o,f=Math.sqrt(r-1)*u;return 1/(a*u-c*f)}function GK(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var fH=new h;function WK(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,fH),h.normalize(fH,fH))}var g_=hh;var hH={};hH.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function jK(e,t,n){let i=e+t;return M.sign(e)!==M.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}hH.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),u=Math.abs(e);if(c<u&&c/u<M.EPSILON14)return[0,0];if(c>u&&u/c<M.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let r=t*t,o=4*e*n,s=jK(r,-o,M.EPSILON14);if(s<0)return[];let a=-.5*jK(t,M.sign(t)*Math.sqrt(s),M.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var Zc=hH;var pH={};pH.computeDiscriminant=function(e,t,n,i){let r=e*e,o=t*t,s=n*n,a=i*i;return 18*e*t*n*i+o*s-27*r*a-4*(e*s*n+o*t*i)};function mH(e,t,n,i){let r=e,o=t/3,s=n/3,a=i,c=r*s,u=o*a,f=o*o,d=s*s,p=r*s-f,g=r*a-o*s,m=o*a-d,x=4*p*m-g*g,C,A;if(x<0){let q,j,X;f*u>=c*d?(q=r,j=p,X=-2*o*p+r*g):(q=a,j=m,X=-a*g+2*s*m);let $=-(X<0?-1:1)*Math.abs(q)*Math.sqrt(-x);A=-X+$;let J=A/2,ce=J<0?-Math.pow(-J,1/3):Math.pow(J,1/3),de=A===$?-ce:-j/ce;return C=j<=0?ce+de:-X/(ce*ce+de*de+j),f*u>=c*d?[(C-o)/r]:[-a/(C+s)]}let b=p,T=-2*o*p+r*g,S=m,w=-a*g+2*s*m,D=Math.sqrt(x),I=Math.sqrt(3)/2,O=Math.abs(Math.atan2(r*D,-T)/3);C=2*Math.sqrt(-b);let B=Math.cos(O);A=C*B;let L=C*(-B/2-I*Math.sin(O)),_=A+L>2*o?A-o:L-o,E=r,v=_/E;O=Math.abs(Math.atan2(a*D,-w)/3),C=2*Math.sqrt(-S),B=Math.cos(O),A=C*B,L=C*(-B/2-I*Math.sin(O));let P=-a,R=A+L<2*s?A+s:L+s,F=P/R,U=E*R,k=-_*R-E*P,H=_*P,V=(s*k-o*H)/(-o*k+s*U);return v<=V?v<=F?V<=F?[v,V,F]:[v,F,V]:[F,v,V]:v<=F?[V,v,F]:V<=F?[V,F,v]:[F,V,v]}pH.computeRealRoots=function(e,t,n,i){let r,o;if(e===0)return Zc.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];o=-i/e;let s=o<0?-Math.pow(-o,1/3):Math.pow(o,1/3);return[s,s,s]}else if(i===0)return r=Zc.computeRealRoots(e,0,n),r.Length===0?[0]:[r[0],0,r[1]];return mH(e,0,n,i)}else{if(n===0)return i===0?(o=-t/e,o<0?[o,0,0]:[0,0,o]):mH(e,t,0,i);if(i===0)return r=Zc.computeRealRoots(e,t,n),r.length===0?[0]:r[1]<=0?[r[0],r[1],0]:r[0]>=0?[0,r[0],r[1]]:[r[0],0,r[1]]}return mH(e,t,n,i)};var eA=pH;var _H={};_H.computeDiscriminant=function(e,t,n,i,r){let o=e*e,s=o*e,a=t*t,c=a*t,u=n*n,f=u*n,d=i*i,p=d*i,g=r*r,m=g*r;return a*u*d-4*c*p-4*e*f*d+18*e*t*n*p-27*o*d*d+256*s*m+r*(18*c*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*d+144*o*n*d)+g*(144*e*a*n-27*a*a-128*o*u-192*o*t*i)};function qf(e,t,n,i){let r=e*e,o=t-3*r/8,s=n-t*e/2+r*e/8,a=i-n*e/4+t*r/16-3*r*r/256,c=eA.computeRealRoots(1,2*o,o*o-4*a,-s*s);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)<M.EPSILON14){let d=Zc.computeRealRoots(1,o,a);if(d.length===2){let p=d[0],g=d[1],m;if(p>=0&&g>=0){let x=Math.sqrt(p),C=Math.sqrt(g);return[u-C,u-x,u+x,u+C]}else{if(p>=0&&g<0)return m=Math.sqrt(p),[u-m,u+m];if(p<0&&g>=0)return m=Math.sqrt(g),[u-m,u+m]}}return[]}else if(f>0){let d=Math.sqrt(f),p=(o+f-s/d)/2,g=(o+f+s/d)/2,m=Zc.computeRealRoots(1,d,p),x=Zc.computeRealRoots(1,-d,g);return m.length!==0?(m[0]+=u,m[1]+=u,x.length!==0?(x[0]+=u,x[1]+=u,m[1]<=x[0]?[m[0],m[1],x[0],x[1]]:x[1]<=m[0]?[x[0],x[1],m[0],m[1]]:m[0]>=x[0]&&m[1]<=x[1]?[x[0],m[0],m[1],x[1]]:x[0]>=m[0]&&x[1]<=m[1]?[m[0],x[0],x[1],m[1]]:m[0]>x[0]&&m[0]<x[1]?[x[0],m[0],x[1],m[1]]:[m[0],x[0],m[1],x[1]]):m):x.length!==0?(x[0]+=u,x[1]+=u,x):[]}}return[]}function hS(e,t,n,i){let r=n*n,o=t*t,s=e*e,a=-2*t,c=n*e+o-4*i,u=s*i-n*t*e+r,f=eA.computeRealRoots(1,a,c,u);if(f.length>0){let d=f[0],p=t-d,g=p*p,m=e/2,x=p/2,C=g-4*i,A=g+4*Math.abs(i),b=s-4*d,T=s+4*Math.abs(d),S,w;if(d<0||C*T<b*A){let E=Math.sqrt(b);S=E/2,w=E===0?0:(e*x-n)/E}else{let E=Math.sqrt(C);S=E===0?0:(e*x-n)/E,w=E/2}let D,I;m===0&&S===0?(D=0,I=0):M.sign(m)===M.sign(S)?(D=m+S,I=d/D):(I=m-S,D=d/I);let O,B;x===0&&w===0?(O=0,B=0):M.sign(x)===M.sign(w)?(O=x+w,B=i/O):(B=x-w,O=i/B);let L=Zc.computeRealRoots(1,D,O),_=Zc.computeRealRoots(1,I,B);if(L.length!==0)return _.length!==0?L[1]<=_[0]?[L[0],L[1],_[0],_[1]]:_[1]<=L[0]?[_[0],_[1],L[0],L[1]]:L[0]>=_[0]&&L[1]<=_[1]?[_[0],L[0],L[1],_[1]]:_[0]>=L[0]&&_[1]<=L[1]?[L[0],_[0],_[1],L[1]]:L[0]>_[0]&&L[0]<_[1]?[_[0],L[0],_[1],L[1]]:[L[0],_[0],L[1],_[1]]:L;if(_.length!==0)return _}return[]}_H.computeRealRoots=function(e,t,n,i,r){if(Math.abs(e)<M.EPSILON15)return eA.computeRealRoots(t,n,i,r);let o=t/e,s=n/e,a=i/e,c=r/e,u=o<0?1:0;switch(u+=s<0?u+1:u,u+=a<0?u+1:u,u+=c<0?u+1:u,u){case 0:return qf(o,s,a,c);case 1:return hS(o,s,a,c);case 2:return hS(o,s,a,c);case 3:return qf(o,s,a,c);case 4:return qf(o,s,a,c);case 5:return hS(o,s,a,c);case 6:return qf(o,s,a,c);case 7:return qf(o,s,a,c);case 8:return hS(o,s,a,c);case 9:return qf(o,s,a,c);case 10:return qf(o,s,a,c);case 11:return hS(o,s,a,c);case 12:return qf(o,s,a,c);case 13:return qf(o,s,a,c);case 14:return qf(o,s,a,c);case 15:return qf(o,s,a,c);default:return}};var VP=_H;function kP(e,t){t=h.clone(y(t,h.ZERO)),h.equals(t,h.ZERO)||h.normalize(t,t),this.origin=h.clone(y(e,h.ZERO)),this.direction=t}kP.clone=function(e,t){if(!!l(e))return l(t)?(t.origin=h.clone(e.origin),t.direction=h.clone(e.direction),t):new kP(e.origin,e.direction)};kP.getPoint=function(e,t,n){return l(n)||(n=new h),n=h.multiplyByScalar(e.direction,t,n),h.add(e.origin,n,n)};var En=kP;var so={};so.rayPlane=function(e,t,n){l(n)||(n=new h);let i=e.origin,r=e.direction,o=t.normal,s=h.dot(o,r);if(Math.abs(s)<M.EPSILON15)return;let a=(-t.distance-h.dot(o,i))/s;if(!(a<0))return n=h.multiplyByScalar(r,a,n),h.add(i,n,n)};var gEe=new h,yEe=new h,QK=new h,qK=new h,YK=new h;so.rayTriangleParametric=function(e,t,n,i,r){r=y(r,!1);let o=e.origin,s=e.direction,a=h.subtract(n,t,gEe),c=h.subtract(i,t,yEe),u=h.cross(s,c,QK),f=h.dot(a,u),d,p,g,m,x;if(r){if(f<M.EPSILON6||(d=h.subtract(o,t,qK),g=h.dot(d,u),g<0||g>f)||(p=h.cross(d,a,YK),m=h.dot(s,p),m<0||g+m>f))return;x=h.dot(c,p)/f}else{if(Math.abs(f)<M.EPSILON6)return;let C=1/f;if(d=h.subtract(o,t,qK),g=h.dot(d,u)*C,g<0||g>1||(p=h.cross(d,a,YK),m=h.dot(s,p)*C,m<0||g+m>1))return;x=h.dot(c,p)*C}return x};so.rayTriangle=function(e,t,n,i,r,o){let s=so.rayTriangleParametric(e,t,n,i,r);if(!(!l(s)||s<0))return l(o)||(o=new h),h.multiplyByScalar(e.direction,s,o),h.add(e.origin,o,o)};var xEe=new En;so.lineSegmentTriangle=function(e,t,n,i,r,o,s){let a=xEe;h.clone(e,a.origin),h.subtract(t,e,a.direction),h.normalize(a.direction,a.direction);let c=so.rayTriangleParametric(a,n,i,r,o);if(!(!l(c)||c<0||c>h.distance(e,t)))return l(s)||(s=new h),h.multiplyByScalar(a.direction,c,s),h.add(a.origin,s,s)};function CEe(e,t,n,i){let r=t*t-4*e*n;if(r<0)return;if(r>0){let s=1/(2*e),a=Math.sqrt(r),c=(-t+a)*s,u=(-t-a)*s;return c<u?(i.root0=c,i.root1=u):(i.root0=u,i.root1=c),i}let o=-t/(2*e);if(o!==0)return i.root0=i.root1=o,i}var AEe={root0:0,root1:0};function e$(e,t,n){l(n)||(n=new $c);let i=e.origin,r=e.direction,o=t.center,s=t.radius*t.radius,a=h.subtract(i,o,QK),c=h.dot(r,r),u=2*h.dot(r,a),f=h.magnitudeSquared(a)-s,d=CEe(c,u,f,AEe);if(!!l(d))return n.start=d.root0,n.stop=d.root1,n}so.raySphere=function(e,t,n){if(n=e$(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var TEe=new En;so.lineSegmentSphere=function(e,t,n,i){let r=TEe;h.clone(e,r.origin);let o=h.subtract(t,e,r.direction),s=h.magnitude(o);if(h.normalize(o,o),i=e$(r,n,i),!(!l(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var bEe=new h,EEe=new h;so.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,bEe),r=h.multiplyComponents(n,e.direction,EEe),o=h.magnitudeSquared(i),s=h.dot(i,r),a,c,u,f,d;if(o>1){if(s>=0)return;let p=s*s;if(a=o-1,c=h.magnitudeSquared(r),u=c*a,p<u)return;if(p>u){f=s*s-u,d=-s+Math.sqrt(f);let m=d/c,x=a/d;return m<x?new $c(m,x):{start:x,stop:m}}let g=Math.sqrt(a/c);return new $c(g,g)}else if(o<1)return a=o-1,c=h.magnitudeSquared(r),u=c*a,f=s*s-u,d=-s+Math.sqrt(f),new $c(0,d/c);if(s<0)return c=h.magnitudeSquared(r),new $c(0,-s/c)};function uy(e,t,n){let i=e+t;return M.sign(e)!==M.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}function SEe(e,t,n,i,r){let o=i*i,s=r*r,a=(e[Q.COLUMN1ROW1]-e[Q.COLUMN2ROW2])*s,c=r*(i*uy(e[Q.COLUMN1ROW0],e[Q.COLUMN0ROW1],M.EPSILON15)+t.y),u=e[Q.COLUMN0ROW0]*o+e[Q.COLUMN2ROW2]*s+i*t.x+n,f=s*uy(e[Q.COLUMN2ROW1],e[Q.COLUMN1ROW2],M.EPSILON15),d=r*(i*uy(e[Q.COLUMN2ROW0],e[Q.COLUMN0ROW2])+t.z),p,g=[];if(d===0&&f===0){if(p=Zc.computeRealRoots(a,c,u),p.length===0)return g;let O=p[0],B=Math.sqrt(Math.max(1-O*O,0));if(g.push(new h(i,r*O,r*-B)),g.push(new h(i,r*O,r*B)),p.length===2){let L=p[1],_=Math.sqrt(Math.max(1-L*L,0));g.push(new h(i,r*L,r*-_)),g.push(new h(i,r*L,r*_))}return g}let m=d*d,x=f*f,C=a*a,A=d*f,b=C+x,T=2*(c*a+A),S=2*u*a+c*c-x+m,w=2*(u*c-A),D=u*u-m;if(b===0&&T===0&&S===0&&w===0)return g;p=VP.computeRealRoots(b,T,S,w,D);let I=p.length;if(I===0)return g;for(let O=0;O<I;++O){let B=p[O],L=B*B,_=Math.max(1-L,0),E=Math.sqrt(_),v;M.sign(a)===M.sign(u)?v=uy(a*L+u,c*B,M.EPSILON12):M.sign(u)===M.sign(c*B)?v=uy(a*L,c*B+u,M.EPSILON12):v=uy(a*L+c*B,u,M.EPSILON12);let P=uy(f*B,d,M.EPSILON15),R=v*P;R<0?g.push(new h(i,r*B,r*E)):R>0?g.push(new h(i,r*B,r*-E)):E!==0?(g.push(new h(i,r*B,r*-E)),g.push(new h(i,r*B,r*E)),++O):g.push(new h(i,r*B,r*E))}return g}var gH=new h,XK=new h,KK=new h,UP=new h,wEe=new h,vEe=new Q,DEe=new Q,PEe=new Q,IEe=new Q,OEe=new Q,$K=new Q,ZK=new Q,JK=new h,REe=new h,MEe=new me;so.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let D=t.geodeticSurfaceNormal(n,gH);if(h.dot(i,D)>=0)return n}let r=l(this.rayEllipsoid(e,t)),o=t.transformPositionToScaledSpace(i,gH),s=h.normalize(o,o),a=h.mostOrthogonalAxis(o,UP),c=h.normalize(h.cross(a,s,XK),XK),u=h.normalize(h.cross(s,c,KK),KK),f=vEe;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let d=Q.transpose(f,DEe),p=Q.fromScale(t.radii,PEe),g=Q.fromScale(t.oneOverRadii,IEe),m=OEe;m[0]=0,m[1]=-i.z,m[2]=i.y,m[3]=i.z,m[4]=0,m[5]=-i.x,m[6]=-i.y,m[7]=i.x,m[8]=0;let x=Q.multiply(Q.multiply(d,g,$K),m,$K),C=Q.multiply(Q.multiply(x,p,ZK),f,ZK),A=Q.multiplyByVector(x,n,wEe),b=SEe(C,h.negate(A,gH),0,0,1),T,S,w=b.length;if(w>0){let D=h.clone(h.ZERO,REe),I=Number.NEGATIVE_INFINITY;for(let B=0;B<w;++B){T=Q.multiplyByVector(p,Q.multiplyByVector(f,b[B],JK),JK);let L=h.normalize(h.subtract(T,n,UP),UP),_=h.dot(L,i);_>I&&(I=_,D=h.clone(T,D))}let O=t.cartesianToCartographic(D,MEe);return I=M.clamp(I,0,1),S=h.magnitude(h.subtract(D,n,UP))*Math.sqrt(1-I*I),S=r?-S:S,O.height=S,t.cartographicToCartesian(O,new h)}};var BEe=new h;so.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let r=h.subtract(t,e,BEe),o=n.normal,s=h.dot(o,r);if(Math.abs(s)<M.EPSILON6)return;let a=h.dot(o,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return h.multiplyByScalar(r,c,i),h.add(e,i,i),i};so.trianglePlaneIntersection=function(e,t,n,i){let r=i.normal,o=i.distance,s=h.dot(r,e)+o<0,a=h.dot(r,t)+o<0,c=h.dot(r,n)+o<0,u=0;u+=s?1:0,u+=a?1:0,u+=c?1:0;let f,d;if((u===1||u===2)&&(f=new h,d=new h),u===1){if(s)return so.lineSegmentPlane(e,t,i,f),so.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(a)return so.lineSegmentPlane(t,n,i,f),so.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return so.lineSegmentPlane(n,e,i,f),so.lineSegmentPlane(n,t,i,d),{positions:[e,t,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!c)return so.lineSegmentPlane(e,n,i,f),so.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return so.lineSegmentPlane(n,t,i,f),so.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return so.lineSegmentPlane(t,e,i,f),so.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var er=so;function bs(e,t){this.normal=h.clone(e),this.distance=t}bs.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return l(n)?(h.clone(t,n.normal),n.distance=i,n):new bs(t,i)};var LEe=new h;bs.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,LEe),i=e.w;return l(t)?(h.clone(n,t.normal),t.distance=i,t):new bs(n,i)};bs.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var NEe=new h;bs.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=bs.getPointDistance(e,t),r=h.multiplyByScalar(e.normal,i,NEe);return h.subtract(t,r,n)};var FEe=new N,VEe=new se,kEe=new h;bs.transform=function(e,t,n){let i=e.normal,r=e.distance,o=N.inverseTranspose(t,FEe),s=se.fromElements(i.x,i.y,i.z,r,VEe);s=N.multiplyByVector(o,s,s);let a=h.fromCartesian4(s,kEe);return s=se.divideByScalar(s,h.magnitude(a),s),bs.fromCartesian4(s,n)};bs.clone=function(e,t){return l(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new bs(e.normal,e.distance)};bs.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};bs.ORIGIN_XY_PLANE=Object.freeze(new bs(h.UNIT_Z,0));bs.ORIGIN_YZ_PLANE=Object.freeze(new bs(h.UNIT_X,0));bs.ORIGIN_ZX_PLANE=Object.freeze(new bs(h.UNIT_Y,0));var an=bs;function UEe(e,t,n){let i=0,r=e.length-1,o,s;for(;i<=r;){if(o=~~((i+r)/2),s=n(e[o],t),s<0){i=o+1;continue}if(s>0){r=o-1;continue}return o}return~(r+1)}var ao=UEe;function zEe(e,t,n,i,r){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=r}var fy=zEe;function HEe(e,t,n,i,r,o,s,a){this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=r,this.second=o,this.millisecond=s,this.isLeapSecond=a}var y_=HEe;function GEe(e){return e%4===0&&e%100!==0||e%400===0}var x_=GEe;function WEe(e,t){this.julianDate=e,this.offset=t}var Wi=WEe;var jEe={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},Yn=Object.freeze(jEe);var qEe={UTC:0,TAI:1},Wn=Object.freeze(qEe);var n$=new y_,yH=[31,28,31,30,31,30,31,31,30,31,30,31],xH=29;function CH(e,t){return At.compare(e.julianDate,t.julianDate)}var tA=new Wi;function HP(e){tA.julianDate=e;let t=At.leapSeconds,n=ao(t,tA,CH);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&At.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),At.addSeconds(e,i,e)}function t$(e,t){tA.julianDate=e;let n=At.leapSeconds,i=ao(n,tA,CH);if(i<0&&(i=~i),i===0)return At.addSeconds(e,-n[0].offset,t);if(i>=n.length)return At.addSeconds(e,-n[i-1].offset,t);let r=At.secondsDifference(n[i].julianDate,e);if(r===0)return At.addSeconds(e,-n[i].offset,t);if(!(r<=1))return At.addSeconds(e,-n[--i].offset,t)}function C_(e,t,n){let i=t/Yn.SECONDS_PER_DAY|0;return e+=i,t-=Yn.SECONDS_PER_DAY*i,t<0&&(e--,t+=Yn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function AH(e,t,n,i,r,o,s){let a=(t-14)/12|0,c=e+4800+a,u=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=o+(i*Yn.SECONDS_PER_HOUR+r*Yn.SECONDS_PER_MINUTE+s*Yn.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var YEe=/^(\d{4})$/,XEe=/^(\d{4})-(\d{2})$/,KEe=/^(\d{4})-?(\d{3})$/,$Ee=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,ZEe=/^(\d{4})-?(\d{2})-?(\d{2})$/,TH=/([Z+\-])?(\d{2})?:?(\d{2})?$/,JEe=/^(\d{2})(\.\d+)?/.source+TH.source,QEe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+TH.source,eSe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+TH.source;function At(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=y(e,0),t=y(t,0),n=y(n,Wn.UTC);let i=e|0;t=t+(e-i)*Yn.SECONDS_PER_DAY,C_(i,t,this),n===Wn.UTC&&HP(this)}At.fromGregorianDate=function(e,t){let n=AH(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(C_(n[0],n[1],t),HP(t),t):new At(n[0],n[1],Wn.UTC)};At.fromDate=function(e,t){let n=AH(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(C_(n[0],n[1],t),HP(t),t):new At(n[0],n[1],Wn.UTC)};At.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,r=1,o=1,s=0,a=0,c=0,u=0,f=n[0],d=n[1],p,g;if(n=f.match(ZEe),n!==null)i=+n[1],r=+n[2],o=+n[3];else if(n=f.match(XEe),n!==null)i=+n[1],r=+n[2];else if(n=f.match(YEe),n!==null)i=+n[1];else{let A;if(n=f.match(KEe),n!==null)i=+n[1],A=+n[2],g=x_(i);else if(n=f.match($Ee),n!==null){i=+n[1];let b=+n[2],T=+n[3]||0,S=new Date(Date.UTC(i,0,4));A=b*7+T-S.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(A),r=p.getUTCMonth()+1,o=p.getUTCDate()}g=x_(i);let m;if(l(d)){n=d.match(eSe),n!==null?(s=+n[1],a=+n[2],c=+n[3],u=+(n[4]||0)*1e3,m=5):(n=d.match(QEe),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,m=4):(n=d.match(JEe),n!==null&&(s=+n[1],a=+(n[2]||0)*60,m=3)));let A=n[m],b=+n[m+1],T=+(n[m+2]||0);switch(A){case"+":s=s-b,a=a-T;break;case"-":s=s+b,a=a+T;break;case"Z":break;default:a=a+new Date(Date.UTC(i,r-1,o,s,a)).getTimezoneOffset();break}}let x=c===60;for(x&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,o++;for(p=g&&r===2?xH:yH[r-1];o>p;)o-=p,r++,r>12&&(r-=12,i++),p=g&&r===2?xH:yH[r-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,o--;for(;o<1;)r--,r<1&&(r+=12,i--),p=g&&r===2?xH:yH[r-1],o+=p;let C=AH(i,r,o,s,a,c,u);return l(t)?(C_(C[0],C[1],t),HP(t)):t=new At(C[0],C[1],Wn.UTC),x&&At.addSeconds(t,1,t),t};At.now=function(e){return At.fromDate(new Date,e)};var zP=new At(0,0,Wn.TAI);At.toGregorianDate=function(e,t){let n=!1,i=t$(e,zP);l(i)||(At.addSeconds(e,-1,zP),i=t$(zP,zP),n=!0);let r=i.dayNumber,o=i.secondsOfDay;o>=43200&&(r+=1);let s=r+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let u=80*s/2447|0,f=s-(2447*u/80|0)|0;s=u/11|0;let d=u+2-12*s|0,p=100*(a-49)+c+s|0,g=o/Yn.SECONDS_PER_HOUR|0,m=o-g*Yn.SECONDS_PER_HOUR,x=m/Yn.SECONDS_PER_MINUTE|0;m=m-x*Yn.SECONDS_PER_MINUTE;let C=m|0,A=(m-C)/Yn.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),n&&(C+=1),l(t)?(t.year=p,t.month=d,t.day=f,t.hour=g,t.minute=x,t.second=C,t.millisecond=A,t.isLeapSecond=n,t):new y_(p,d,f,g,x,C,A,n)};At.toDate=function(e){let t=At.toGregorianDate(e,n$),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};At.toIso8601=function(e,t){let n=At.toGregorianDate(e,n$),i=n.year,r=n.month,o=n.day,s=n.hour,a=n.minute,c=n.second,u=n.millisecond;i===1e4&&r===1&&o===1&&s===0&&a===0&&c===0&&u===0&&(i=9999,r=12,o=31,s=24);let f;return!l(t)&&u!==0?(f=(u*.01).toString().replace(".",""),`${i.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${o.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`):!l(t)||t===0?`${i.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${o.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(f=(u*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${o.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`)};At.clone=function(e,t){if(!!l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new At(e.dayNumber,e.secondsOfDay,Wn.TAI)};At.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};At.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};At.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(At.secondsDifference(e,t))<=n};At.totalDays=function(e){return e.dayNumber+e.secondsOfDay/Yn.SECONDS_PER_DAY};At.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*Yn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};At.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/Yn.SECONDS_PER_DAY;return n+i};At.computeTaiMinusUtc=function(e){tA.julianDate=e;let t=At.leapSeconds,n=ao(t,tA,CH);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};At.addSeconds=function(e,t,n){return C_(e.dayNumber,e.secondsOfDay+t,n)};At.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*Yn.SECONDS_PER_MINUTE;return C_(e.dayNumber,i,n)};At.addHours=function(e,t,n){let i=e.secondsOfDay+t*Yn.SECONDS_PER_HOUR;return C_(e.dayNumber,i,n)};At.addDays=function(e,t,n){let i=e.dayNumber+t;return C_(i,e.secondsOfDay,n)};At.lessThan=function(e,t){return At.compare(e,t)<0};At.lessThanOrEquals=function(e,t){return At.compare(e,t)<=0};At.greaterThan=function(e,t){return At.compare(e,t)>0};At.greaterThanOrEquals=function(e,t){return At.compare(e,t)>=0};At.prototype.clone=function(e){return At.clone(this,e)};At.prototype.equals=function(e){return At.equals(this,e)};At.prototype.equalsEpsilon=function(e,t){return At.equalsEpsilon(this,e,t)};At.prototype.toString=function(){return At.toIso8601(this)};At.leapSeconds=[new Wi(new At(2441317,43210,Wn.TAI),10),new Wi(new At(2441499,43211,Wn.TAI),11),new Wi(new At(2441683,43212,Wn.TAI),12),new Wi(new At(2442048,43213,Wn.TAI),13),new Wi(new At(2442413,43214,Wn.TAI),14),new Wi(new At(2442778,43215,Wn.TAI),15),new Wi(new At(2443144,43216,Wn.TAI),16),new Wi(new At(2443509,43217,Wn.TAI),17),new Wi(new At(2443874,43218,Wn.TAI),18),new Wi(new At(2444239,43219,Wn.TAI),19),new Wi(new At(2444786,43220,Wn.TAI),20),new Wi(new At(2445151,43221,Wn.TAI),21),new Wi(new At(2445516,43222,Wn.TAI),22),new Wi(new At(2446247,43223,Wn.TAI),23),new Wi(new At(2447161,43224,Wn.TAI),24),new Wi(new At(2447892,43225,Wn.TAI),25),new Wi(new At(2448257,43226,Wn.TAI),26),new Wi(new At(2448804,43227,Wn.TAI),27),new Wi(new At(2449169,43228,Wn.TAI),28),new Wi(new At(2449534,43229,Wn.TAI),29),new Wi(new At(2450083,43230,Wn.TAI),30),new Wi(new At(2450630,43231,Wn.TAI),31),new Wi(new At(2451179,43232,Wn.TAI),32),new Wi(new At(2453736,43233,Wn.TAI),33),new Wi(new At(2454832,43234,Wn.TAI),34),new Wi(new At(2456109,43235,Wn.TAI),35),new Wi(new At(2457204,43236,Wn.TAI),36),new Wi(new At(2457754,43237,Wn.TAI),37)];var ee=At;function GP(e){if(e=y(e,y.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=y(e.addNewLeapSeconds,!0),l(e.data))bH(this,e.data);else if(l(e.url)){let t=De.createIfNeeded(e.url),n=this;this._downloadPromise=t.fetchJson().then(function(i){bH(n,i)}).catch(function(){n._dataError=`An error occurred while retrieving the EOP data from the URL ${t.url}.`})}else bH(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}GP.NONE=Object.freeze({getPromiseToLoad:function(){return Promise.resolve()},compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new fy(0,0,0,0,0),t}});GP.prototype.getPromiseToLoad=function(){return Promise.resolve(this._downloadPromise)};GP.prototype.compute=function(e,t){if(!l(this._samples)){if(l(this._dataError))throw new fe(this._dataError);return}if(l(t)||(t=new fy(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,r=0,o=0;if(l(i)){let a=n[i],c=n[i+1],u=ee.lessThanOrEquals(a,e),f=!l(c),d=f||ee.greaterThanOrEquals(c,e);if(u&&d)return r=i,!f&&c.equals(e)&&++r,o=r+1,r$(this,n,this._samples,e,r,o,t),t}let s=ao(n,e,ee.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,r=s,o=s):(o=~s,r=o-1,r<0&&(r=0)),this._lastIndex=r,r$(this,n,this._samples,e,r,o,t),t};function tSe(e,t){return ee.compare(e.julianDate,t)}function bH(e,t){if(!l(t.columnNames)){e._dataError="Error in loaded EOP data: The columnNames property is required.";return}if(!l(t.samples)){e._dataError="Error in loaded EOP data: The samples property is required.";return}let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),r=t.columnNames.indexOf("yPoleWanderRadians"),o=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||r<0||o<0||s<0||a<0||c<0){e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns";return}let u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=r,e._ut1MinusUtcSecondsColumn=o,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let d,p=e._addNewLeapSeconds;for(let g=0,m=u.length;g<m;g+=e._columnCount){let x=u[g+n],C=u[g+c],A=x+Yn.MODIFIED_JULIAN_DATE_DIFFERENCE,b=new ee(A,C,Wn.TAI);if(f.push(b),p){if(C!==d&&l(d)){let T=ee.leapSeconds,S=ao(T,b,tSe);if(S<0){let w=new Wi(b,C);T.splice(~S,0,w)}}d=C}}}function i$(e,t,n,i,r){let o=n*i;r.xPoleWander=t[o+e._xPoleWanderRadiansColumn],r.yPoleWander=t[o+e._yPoleWanderRadiansColumn],r.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],r.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],r.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function mS(e,t,n){return t+e*(n-t)}function r$(e,t,n,i,r,o,s){let a=e._columnCount;if(o>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[r],u=t[o];if(c.equals(u)||i.equals(c))return i$(e,n,r,a,s),s;if(i.equals(u))return i$(e,n,o,a,s),s;let f=ee.secondsDifference(i,c)/ee.secondsDifference(u,c),d=r*a,p=o*a,g=n[d+e._ut1MinusUtcSecondsColumn],m=n[p+e._ut1MinusUtcSecondsColumn],x=m-g;if(x>.5||x<-.5){let C=n[d+e._taiMinusUtcSecondsColumn],A=n[p+e._taiMinusUtcSecondsColumn];C!==A&&(u.equals(i)?g=m:m-=A-C)}return s.xPoleWander=mS(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=mS(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=mS(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=mS(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=mS(f,g,m),s}var WP=GP;function Ma(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.roll=y(n,0)}Ma.fromQuaternion=function(e,t){l(t)||(t=new Ma);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),r=2*(e.w*e.x+e.y*e.z),o=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,o),t.roll=Math.atan2(r,i),t.pitch=-M.asinClamped(n),t};Ma.fromDegrees=function(e,t,n,i){return l(i)||(i=new Ma),i.heading=e*M.RADIANS_PER_DEGREE,i.pitch=t*M.RADIANS_PER_DEGREE,i.roll=n*M.RADIANS_PER_DEGREE,i};Ma.clone=function(e,t){if(!!l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Ma(e.heading,e.pitch,e.roll)};Ma.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Ma.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&M.equalsEpsilon(e.heading,t.heading,n,i)&&M.equalsEpsilon(e.pitch,t.pitch,n,i)&&M.equalsEpsilon(e.roll,t.roll,n,i)};Ma.prototype.clone=function(e){return Ma.clone(this,e)};Ma.prototype.equals=function(e){return Ma.equals(this,e)};Ma.prototype.equalsEpsilon=function(e,t,n){return Ma.equalsEpsilon(this,e,t,n)};Ma.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Yf=Ma;function nSe(e,t,n){this.x=e,this.y=t,this.s=n}var nA=nSe;function wH(e){e=y(e,y.EMPTY_OBJECT),this._xysFileUrlTemplate=De.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=y(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=y(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new ee(this._sampleZeroJulianEphemerisDate,0,Wn.TAI),this._stepSizeDays=y(e.stepSizeDays,1),this._samplesPerXysFile=y(e.samplesPerXysFile,1e3),this._totalSamples=y(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),r=Math.pow(this._stepSizeDays,t);for(let o=0;o<=t;++o){n[o]=r,i[o]=o*this._stepSizeDays;for(let s=0;s<=t;++s)s!==o&&(n[o]*=o-s);n[o]=1/n[o]}this._work=new Array(t+1),this._coef=new Array(t+1)}var iSe=new ee(0,0,Wn.TAI);function EH(e,t,n){let i=iSe;return i.dayNumber=t,i.secondsOfDay=n,ee.daysDifference(i,e._sampleZeroDateTT)}wH.prototype.preload=function(e,t,n,i){let r=EH(this,e,t),o=EH(this,n,i),s=r/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let d=c;d<=u;++d)f.push(SH(this,d));return Promise.all(f)};wH.prototype.computeXysRadians=function(e,t,n){let i=EH(this,e,t);if(i<0)return;let r=i/this._stepSizeDays|0;if(r>=this._totalSamples)return;let o=this._interpolationOrder,s=r-(o/2|0);s<0&&(s=0);let a=s+o;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-o,s<0&&(s=0));let c=!1,u=this._samples;if(l(u[s*3])||(SH(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(SH(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new nA(0,0,0);let f=i-s*this._stepSizeDays,d=this._work,p=this._denominators,g=this._coef,m=this._xTable,x,C;for(x=0;x<=o;++x)d[x]=f-m[x];for(x=0;x<=o;++x){for(g[x]=1,C=0;C<=o;++C)C!==x&&(g[x]*=d[C]);g[x]*=p[x];let A=(s+x)*3;n.x+=g[x]*u[A++],n.y+=g[x]*u[A++],n.s+=g[x]*u[A]}return n};function SH(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new De({url:Qt(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let r=n.fetchJson().then(function(o){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=o.samples,c=t*e._samplesPerXysFile*3;for(let u=0,f=a.length;u<f;++u)s[c+u]=a[u]});return e._chunkDownloadsInProgress[t]=r,r}var jP=wH;var A_,Io={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Jc={};Object.defineProperties(Jc,{element:{get:function(){if(!!Jc.supportsFullscreen())return document[Io.fullscreenElement]}},changeEventName:{get:function(){if(!!Jc.supportsFullscreen())return Io.fullscreenchange}},errorEventName:{get:function(){if(!!Jc.supportsFullscreen())return Io.fullscreenerror}},enabled:{get:function(){if(!!Jc.supportsFullscreen())return document[Io.fullscreenEnabled]}},fullscreen:{get:function(){if(!!Jc.supportsFullscreen())return Jc.element!==null}}});Jc.supportsFullscreen=function(){if(l(A_))return A_;A_=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return Io.requestFullscreen="requestFullscreen",Io.exitFullscreen="exitFullscreen",Io.fullscreenEnabled="fullscreenEnabled",Io.fullscreenElement="fullscreenElement",Io.fullscreenchange="fullscreenchange",Io.fullscreenerror="fullscreenerror",A_=!0,A_;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,r=t.length;i<r;++i){let o=t[i];n=`${o}RequestFullscreen`,typeof e[n]=="function"?(Io.requestFullscreen=n,A_=!0):(n=`${o}RequestFullScreen`,typeof e[n]=="function"&&(Io.requestFullscreen=n,A_=!0)),n=`${o}ExitFullscreen`,typeof document[n]=="function"?Io.exitFullscreen=n:(n=`${o}CancelFullScreen`,typeof document[n]=="function"&&(Io.exitFullscreen=n)),n=`${o}FullscreenEnabled`,document[n]!==void 0?Io.fullscreenEnabled=n:(n=`${o}FullScreenEnabled`,document[n]!==void 0&&(Io.fullscreenEnabled=n)),n=`${o}FullscreenElement`,document[n]!==void 0?Io.fullscreenElement=n:(n=`${o}FullScreenElement`,document[n]!==void 0&&(Io.fullscreenElement=n)),n=`${o}fullscreenchange`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenChange"),Io.fullscreenchange=n),n=`${o}fullscreenerror`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenError"),Io.fullscreenerror=n)}return A_};Jc.requestFullscreen=function(e,t){!Jc.supportsFullscreen()||e[Io.requestFullscreen]({vrDisplay:t})};Jc.exitFullscreen=function(){!Jc.supportsFullscreen()||document[Io.exitFullscreen]()};Jc._names=Io;var Oo=Jc;var Ba;typeof navigator<"u"?Ba=navigator:Ba={};function dy(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var qP,o$;function RH(){if(!l(qP)&&(qP=!1,!JP())){let e=/ Chrome\/([\.0-9]+)/.exec(Ba.userAgent);e!==null&&(qP=!0,o$=dy(e[1]))}return qP}function rSe(){return RH()&&o$}var YP,s$;function a$(){if(!l(YP)&&(YP=!1,!RH()&&!JP()&&/ Safari\/[\.0-9]+/.test(Ba.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Ba.userAgent);e!==null&&(YP=!0,s$=dy(e[1]))}return YP}function oSe(){return a$()&&s$}var XP,IH;function c$(){if(!l(XP)){XP=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Ba.userAgent);e!==null&&(XP=!0,IH=dy(e[1]),IH.isNightly=!!e[2])}return XP}function sSe(){return c$()&&IH}var pS,OH;function l$(){if(!l(pS)){pS=!1;let e;Ba.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Ba.userAgent),e!==null&&(pS=!0,OH=dy(e[1]))):Ba.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Ba.userAgent),e!==null&&(pS=!0,OH=dy(e[1])))}return pS}function aSe(){return l$()&&OH}var KP,u$;function JP(){if(!l(KP)){KP=!1;let e=/ Edg\/([\.0-9]+)/.exec(Ba.userAgent);e!==null&&(KP=!0,u$=dy(e[1]))}return KP}function cSe(){return JP()&&u$}var $P,f$;function MH(){if(!l($P)){$P=!1;let e=/Firefox\/([\.0-9]+)/.exec(Ba.userAgent);e!==null&&($P=!0,f$=dy(e[1]))}return $P}var vH;function lSe(){return l(vH)||(vH=/Windows/i.test(Ba.appVersion)),vH}var DH;function uSe(){return l(DH)||(DH=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),DH}function fSe(){return MH()&&f$}var PH;function dSe(){return l(PH)||(PH=!MH()&&typeof PointerEvent<"u"&&(!l(Ba.pointerEnabled)||Ba.pointerEnabled)),PH}var d$,ZP;function h$(){if(!l(ZP)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;ZP=l(t)&&t!=="",ZP&&(d$=t)}return ZP}function hSe(){return h$()?d$:void 0}function hc(){return hc._result}hc._promise=void 0;hc._result=void 0;hc.initialize=function(){return l(hc._promise)||(hc._promise=new Promise(e=>{let t=new Image;t.onload=function(){hc._result=t.width>0&&t.height>0,e(hc._result)},t.onerror=function(){hc._result=!1,e(hc._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),hc._promise};Object.defineProperties(hc,{initialized:{get:function(){return l(hc._result)}}});var iA=[];typeof ArrayBuffer<"u"&&(iA.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&iA.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&iA.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&iA.push(BigInt64Array),typeof BigUint64Array<"u"&&iA.push(BigUint64Array));var mh={isChrome:RH,chromeVersion:rSe,isSafari:a$,safariVersion:oSe,isWebkit:c$,webkitVersion:sSe,isInternetExplorer:l$,internetExplorerVersion:aSe,isEdge:JP,edgeVersion:cSe,isFirefox:MH,firefoxVersion:fSe,isWindows:lSe,isIPadOrIOS:uSe,hardwareConcurrency:y(Ba.hardwareConcurrency,3),supportsPointerEvents:dSe,supportsImageRenderingPixelated:h$,supportsWebP:hc,imageRenderingValue:hSe,typedArrayTypes:iA};mh.supportsBasis=function(e){return mh.supportsWebAssembly()&&e.context.supportsBasis};mh.supportsFullscreen=function(){return Oo.supportsFullscreen()};mh.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};mh.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};mh.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};mh.supportsBigInt=function(){return typeof BigInt<"u"};mh.supportsWebWorkers=function(){return typeof Worker<"u"};mh.supportsWebAssembly=function(){return typeof WebAssembly<"u"};var Et=mh;function Qe(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}var _S=new h;Qe.fromAxisAngle=function(e,t,n){let i=t/2,r=Math.sin(i);_S=h.normalize(e,_S);let o=_S.x*r,s=_S.y*r,a=_S.z*r,c=Math.cos(i);return l(n)?(n.x=o,n.y=s,n.z=a,n.w=c,n):new Qe(o,s,a,c)};var mSe=[1,2,0],pSe=new Array(3);Qe.fromRotationMatrix=function(e,t){let n,i,r,o,s,a=e[Q.COLUMN0ROW0],c=e[Q.COLUMN1ROW1],u=e[Q.COLUMN2ROW2],f=a+c+u;if(f>0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[Q.COLUMN1ROW2]-e[Q.COLUMN2ROW1])*n,r=(e[Q.COLUMN2ROW0]-e[Q.COLUMN0ROW2])*n,o=(e[Q.COLUMN0ROW1]-e[Q.COLUMN1ROW0])*n;else{let d=mSe,p=0;c>a&&(p=1),u>a&&u>c&&(p=2);let g=d[p],m=d[g];n=Math.sqrt(e[Q.getElementIndex(p,p)]-e[Q.getElementIndex(g,g)]-e[Q.getElementIndex(m,m)]+1);let x=pSe;x[p]=.5*n,n=.5/n,s=(e[Q.getElementIndex(m,g)]-e[Q.getElementIndex(g,m)])*n,x[g]=(e[Q.getElementIndex(g,p)]+e[Q.getElementIndex(p,g)])*n,x[m]=(e[Q.getElementIndex(m,p)]+e[Q.getElementIndex(p,m)])*n,i=-x[0],r=-x[1],o=-x[2]}return l(t)?(t.x=i,t.y=r,t.z=o,t.w=s,t):new Qe(i,r,o,s)};var m$=new Qe,p$=new Qe,BH=new Qe,_$=new Qe;Qe.fromHeadingPitchRoll=function(e,t){return _$=Qe.fromAxisAngle(h.UNIT_X,e.roll,m$),BH=Qe.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=Qe.multiply(BH,_$,BH),p$=Qe.fromAxisAngle(h.UNIT_Z,-e.heading,m$),Qe.multiply(p$,t,t)};var QP=new h,LH=new h,Xf=new Qe,g$=new Qe,eI=new Qe;Qe.packedLength=4;Qe.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};Qe.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Qe),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};Qe.packedInterpolationLength=3;Qe.convertPackedArrayForInterpolation=function(e,t,n,i){Qe.unpack(e,n*4,eI),Qe.conjugate(eI,eI);for(let r=0,o=n-t+1;r<o;r++){let s=r*3;Qe.unpack(e,(t+r)*4,Xf),Qe.multiply(Xf,eI,Xf),Xf.w<0&&Qe.negate(Xf,Xf),Qe.computeAxis(Xf,QP);let a=Qe.computeAngle(Xf);l(i)||(i=[]),i[s]=QP.x*a,i[s+1]=QP.y*a,i[s+2]=QP.z*a}};Qe.unpackInterpolationResult=function(e,t,n,i,r){l(r)||(r=new Qe),h.fromArray(e,0,LH);let o=h.magnitude(LH);return Qe.unpack(t,i*4,g$),o===0?Qe.clone(Qe.IDENTITY,Xf):Qe.fromAxisAngle(LH,o,Xf),Qe.multiply(Xf,g$,r)};Qe.clone=function(e,t){if(!!l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new Qe(e.x,e.y,e.z,e.w)};Qe.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};Qe.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};Qe.magnitude=function(e){return Math.sqrt(Qe.magnitudeSquared(e))};Qe.normalize=function(e,t){let n=1/Qe.magnitude(e),i=e.x*n,r=e.y*n,o=e.z*n,s=e.w*n;return t.x=i,t.y=r,t.z=o,t.w=s,t};Qe.inverse=function(e,t){let n=Qe.magnitudeSquared(e);return t=Qe.conjugate(e,t),Qe.multiplyByScalar(t,1/n,t)};Qe.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};Qe.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};Qe.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};Qe.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};Qe.multiply=function(e,t,n){let i=e.x,r=e.y,o=e.z,s=e.w,a=t.x,c=t.y,u=t.z,f=t.w,d=s*a+i*f+r*u-o*c,p=s*c-i*u+r*f+o*a,g=s*u+i*c-r*a+o*f,m=s*f-i*a-r*c-o*u;return n.x=d,n.y=p,n.z=g,n.w=m,n};Qe.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};Qe.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};Qe.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<M.EPSILON6)return t.x=t.y=t.z=0,t;let i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t};Qe.computeAngle=function(e){return Math.abs(e.w-1)<M.EPSILON6?0:2*Math.acos(e.w)};var NH=new Qe;Qe.lerp=function(e,t,n,i){return NH=Qe.multiplyByScalar(t,n,NH),i=Qe.multiplyByScalar(e,1-n,i),Qe.add(NH,i,i)};var y$=new Qe,FH=new Qe,VH=new Qe;Qe.slerp=function(e,t,n,i){let r=Qe.dot(e,t),o=t;if(r<0&&(r=-r,o=y$=Qe.negate(t,y$)),1-r<M.EPSILON6)return Qe.lerp(e,o,n,i);let s=Math.acos(r);return FH=Qe.multiplyByScalar(e,Math.sin((1-n)*s),FH),VH=Qe.multiplyByScalar(o,Math.sin(n*s),VH),i=Qe.add(FH,VH,i),Qe.multiplyByScalar(i,1/Math.sin(s),i)};Qe.log=function(e,t){let n=M.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),h.multiplyByScalar(e,i,t)};Qe.exp=function(e,t){let n=h.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var _Se=new h,gSe=new h,gS=new Qe,rA=new Qe;Qe.computeInnerQuadrangle=function(e,t,n,i){let r=Qe.conjugate(t,gS);Qe.multiply(r,n,rA);let o=Qe.log(rA,_Se);Qe.multiply(r,e,rA);let s=Qe.log(rA,gSe);return h.add(o,s,o),h.multiplyByScalar(o,.25,o),h.negate(o,o),Qe.exp(o,gS),Qe.multiply(t,gS,i)};Qe.squad=function(e,t,n,i,r,o){let s=Qe.slerp(e,t,r,gS),a=Qe.slerp(n,i,r,rA);return Qe.slerp(s,a,2*r*(1-r),o)};var ySe=new Qe,x$=1.9011074535173003,tI=Et.supportsTypedArrays()?new Float32Array(8):[],nI=Et.supportsTypedArrays()?new Float32Array(8):[],Um=Et.supportsTypedArrays()?new Float32Array(8):[],zm=Et.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;tI[e]=1/(t*n),nI[e]=t/n}tI[7]=x$/(8*17);nI[7]=x$*8/17;Qe.fastSlerp=function(e,t,n,i){let r=Qe.dot(e,t),o;r>=0?o=1:(o=-1,r=-r);let s=r-1,a=1-n,c=n*n,u=a*a;for(let g=7;g>=0;--g)Um[g]=(tI[g]*c-nI[g])*s,zm[g]=(tI[g]*u-nI[g])*s;let f=o*n*(1+Um[0]*(1+Um[1]*(1+Um[2]*(1+Um[3]*(1+Um[4]*(1+Um[5]*(1+Um[6]*(1+Um[7])))))))),d=a*(1+zm[0]*(1+zm[1]*(1+zm[2]*(1+zm[3]*(1+zm[4]*(1+zm[5]*(1+zm[6]*(1+zm[7])))))))),p=Qe.multiplyByScalar(e,d,ySe);return Qe.multiplyByScalar(t,f,i),Qe.add(p,i,i)};Qe.fastSquad=function(e,t,n,i,r,o){let s=Qe.fastSlerp(e,t,r,gS),a=Qe.fastSlerp(n,i,r,rA);return Qe.fastSlerp(s,a,2*r*(1-r),o)};Qe.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};Qe.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};Qe.ZERO=Object.freeze(new Qe(0,0,0,0));Qe.IDENTITY=Object.freeze(new Qe(0,0,0,1));Qe.prototype.clone=function(e){return Qe.clone(this,e)};Qe.prototype.equals=function(e){return Qe.equals(this,e)};Qe.prototype.equalsEpsilon=function(e,t){return Qe.equalsEpsilon(this,e,t)};Qe.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Re=Qe;var Ui={},kH={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},oA={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},UH={},Qc={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},T_=new h,b_=new h,E_=new h;Ui.localFrameToFixedFrameGenerator=function(e,t){if(!kH.hasOwnProperty(e)||!kH[e].hasOwnProperty(t))throw new ye("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=kH[e][t],i,r=e+t;return l(UH[r])?i=UH[r]:(i=function(o,s,a){if(l(a)||(a=new N),h.equalsEpsilon(o,h.ZERO,M.EPSILON14))h.unpack(oA[e],0,T_),h.unpack(oA[t],0,b_),h.unpack(oA[n],0,E_);else if(M.equalsEpsilon(o.x,0,M.EPSILON14)&&M.equalsEpsilon(o.y,0,M.EPSILON14)){let c=M.sign(o.z);h.unpack(oA[e],0,T_),e!=="east"&&e!=="west"&&h.multiplyByScalar(T_,c,T_),h.unpack(oA[t],0,b_),t!=="east"&&t!=="west"&&h.multiplyByScalar(b_,c,b_),h.unpack(oA[n],0,E_),n!=="east"&&n!=="west"&&h.multiplyByScalar(E_,c,E_)}else{s=y(s,oe.WGS84),s.geodeticSurfaceNormal(o,Qc.up);let c=Qc.up,u=Qc.east;u.x=-o.y,u.y=o.x,u.z=0,h.normalize(u,Qc.east),h.cross(c,u,Qc.north),h.multiplyByScalar(Qc.up,-1,Qc.down),h.multiplyByScalar(Qc.east,-1,Qc.west),h.multiplyByScalar(Qc.north,-1,Qc.south),T_=Qc[e],b_=Qc[t],E_=Qc[n]}return a[0]=T_.x,a[1]=T_.y,a[2]=T_.z,a[3]=0,a[4]=b_.x,a[5]=b_.y,a[6]=b_.z,a[7]=0,a[8]=E_.x,a[9]=E_.y,a[10]=E_.z,a[11]=0,a[12]=o.x,a[13]=o.y,a[14]=o.z,a[15]=1,a},UH[r]=i),i};Ui.eastNorthUpToFixedFrame=Ui.localFrameToFixedFrameGenerator("east","north");Ui.northEastDownToFixedFrame=Ui.localFrameToFixedFrameGenerator("north","east");Ui.northUpEastToFixedFrame=Ui.localFrameToFixedFrameGenerator("north","up");Ui.northWestUpToFixedFrame=Ui.localFrameToFixedFrameGenerator("north","west");var xSe=new Re,CSe=new h(1,1,1),ASe=new N;Ui.headingPitchRollToFixedFrame=function(e,t,n,i,r){i=y(i,Ui.eastNorthUpToFixedFrame);let o=Re.fromHeadingPitchRoll(t,xSe),s=N.fromTranslationQuaternionRotationScale(h.ZERO,o,CSe,ASe);return r=i(e,n,r),N.multiply(r,s,r)};var TSe=new N,bSe=new Q;Ui.headingPitchRollQuaternion=function(e,t,n,i,r){let o=Ui.headingPitchRollToFixedFrame(e,t,n,i,TSe),s=N.getMatrix3(o,bSe);return Re.fromRotationMatrix(s,r)};var ESe=new h(1,1,1),SSe=new h,C$=new N,wSe=new N,vSe=new Q,DSe=new Re;Ui.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=y(t,oe.WGS84),n=y(n,Ui.eastNorthUpToFixedFrame),l(i)||(i=new Yf);let r=N.getTranslation(e,SSe);if(h.equals(r,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let o=N.inverseTransformation(n(r,t,C$),C$),s=N.setScale(e,ESe,wSe);s=N.setTranslation(s,h.ZERO,s),o=N.multiply(o,s,o);let a=Re.fromRotationMatrix(N.getMatrix3(o,vSe),DSe);return a=Re.normalize(a,a),Yf.fromQuaternion(a,i)};var PSe=6*3600+41*60+50.54841,ISe=8640184812866e-6,OSe=.093104,RSe=-62e-7,MSe=11772758384668e-32,BSe=72921158553e-15,LSe=M.TWO_PI/86400,iI=new ee;Ui.computeTemeToPseudoFixedMatrix=function(e,t){iI=ee.addSeconds(e,-ee.computeTaiMinusUtc(e),iI);let n=iI.dayNumber,i=iI.secondsOfDay,r,o=n-2451545;i>=43200?r=(o+.5)/Yn.DAYS_PER_JULIAN_CENTURY:r=(o-.5)/Yn.DAYS_PER_JULIAN_CENTURY;let a=(PSe+r*(ISe+r*(OSe+r*RSe)))*LSe%M.TWO_PI,c=BSe+MSe*(n-24515455e-1),u=(i+Yn.SECONDS_PER_DAY*.5)%Yn.SECONDS_PER_DAY,f=a+c*u,d=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new Q(d,p,0,-p,d,0,0,0,1)};Ui.iau2006XysData=new jP;Ui.earthOrientationParameters=WP.NONE;var GH=32.184,NSe=2451545;Ui.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+GH,i=e.stop.dayNumber,r=e.stop.secondsOfDay+GH,o=Ui.iau2006XysData.preload(t,n,i,r),s=Ui.earthOrientationParameters.getPromiseToLoad();return Promise.all([o,s])};Ui.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new Q);let n=Ui.computeFixedToIcrfMatrix(e,t);if(!!l(n))return Q.transpose(n,t)};var FSe=new nA(0,0,0),VSe=new fy(0,0,0,0,0,0),zH=new Q,HH=new Q;Ui.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new Q);let n=Ui.earthOrientationParameters.compute(e,VSe);if(!l(n))return;let i=e.dayNumber,r=e.secondsOfDay+GH,o=Ui.iau2006XysData.computeXysRadians(i,r,FSe);if(!l(o))return;let s=o.x+n.xPoleOffset,a=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),u=zH;u[0]=1-c*s*s,u[3]=-c*s*a,u[6]=s,u[1]=-c*s*a,u[4]=1-c*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-c*(s*s+a*a);let f=Q.fromRotationZ(-o.s,HH),d=Q.multiply(u,f,zH),p=e.dayNumber,g=e.secondsOfDay-ee.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=p-2451545,x=g/Yn.SECONDS_PER_DAY,C=.779057273264+x+.00273781191135448*(m+x);C=C%1*M.TWO_PI;let A=Q.fromRotationZ(C,HH),b=Q.multiply(d,A,zH),T=Math.cos(n.xPoleWander),S=Math.cos(n.yPoleWander),w=Math.sin(n.xPoleWander),D=Math.sin(n.yPoleWander),I=i-NSe+r/Yn.SECONDS_PER_DAY;I/=36525;let O=-47e-6*I*M.RADIANS_PER_DEGREE/3600,B=Math.cos(O),L=Math.sin(O),_=HH;return _[0]=T*B,_[1]=T*L,_[2]=w,_[3]=-S*L+D*w*B,_[4]=S*B+D*w*L,_[5]=-D*T,_[6]=-D*L-S*w*B,_[7]=D*B-S*w*L,_[8]=S*T,Q.multiply(b,_,t)};var kSe=new se;Ui.pointToWindowCoordinates=function(e,t,n,i){return i=Ui.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};Ui.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new W);let r=kSe;return N.multiplyByVector(e,se.fromElements(n.x,n.y,n.z,1,r),r),se.multiplyByScalar(r,1/r.w,r),N.multiplyByVector(t,r,r),W.fromCartesian4(r,i)};var USe=new h,zSe=new h,HSe=new h;Ui.rotationMatrixFromPositionVelocity=function(e,t,n,i){let r=y(n,oe.WGS84).geodeticSurfaceNormal(e,USe),o=h.cross(t,r,zSe);h.equalsEpsilon(o,h.ZERO,M.EPSILON6)&&(o=h.clone(h.UNIT_X,o));let s=h.cross(o,t,HSe);return h.normalize(s,s),h.cross(t,s,o),h.negate(o,o),h.normalize(o,o),l(i)||(i=new Q),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=o.x,i[4]=o.y,i[5]=o.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};var A$=new N(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),T$=new me,b$=new h,GSe=new h,WSe=new Q,WH=new N,E$=new N;Ui.basisTo2D=function(e,t,n){let i=N.getTranslation(t,GSe),r=e.ellipsoid,o=r.cartesianToCartographic(i,T$),s=e.project(o,b$);h.fromElements(s.z,s.x,s.y,s);let a=Ui.eastNorthUpToFixedFrame(i,r,WH),c=N.inverseTransformation(a,E$),u=N.getMatrix3(t,WSe),f=N.multiplyByMatrix3(c,u,n);return N.multiply(A$,f,n),N.setTranslation(n,s,n),n};Ui.wgs84To2DModelMatrix=function(e,t,n){let i=e.ellipsoid,r=Ui.eastNorthUpToFixedFrame(t,i,WH),o=N.inverseTransformation(r,E$),s=i.cartesianToCartographic(t,T$),a=e.project(s,b$);h.fromElements(a.z,a.x,a.y,a);let c=N.fromTranslation(a,WH);return N.multiply(A$,o,n),N.multiply(c,n,n),n};var yt=Ui;var jH=new se;function ph(e,t){t=y(t,oe.WGS84),e=t.scaleToGeodeticSurface(e);let n=yt.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=h.fromCartesian4(N.getColumn(n,0,jH)),this._yAxis=h.fromCartesian4(N.getColumn(n,1,jH));let i=h.fromCartesian4(N.getColumn(n,2,jH));this._plane=an.fromPointNormal(e,i)}Object.defineProperties(ph.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var jSe=new ly;ph.fromPoints=function(e,t){let n=ly.fromPoints(e,jSe);return new ph(n.center,t)};var S$=new En,rI=new h;ph.prototype.projectPointOntoPlane=function(e,t){let n=S$;n.origin=e,h.normalize(e,n.direction);let i=er.rayPlane(n,this._plane,rI);if(l(i)||(h.negate(n.direction,n.direction),i=er.rayPlane(n,this._plane,rI)),l(i)){let r=h.subtract(i,this._origin,i),o=h.dot(this._xAxis,r),s=h.dot(this._yAxis,r);return l(t)?(t.x=o,t.y=s,t):new W(o,s)}};ph.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let r=0;r<i;r++){let o=this.projectPointOntoPlane(e[r],t[n]);l(o)&&(t[n]=o,n++)}return t.length=n,t};ph.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new W);let n=S$;n.origin=e,h.clone(this._plane.normal,n.direction);let i=er.rayPlane(n,this._plane,rI);l(i)||(h.negate(n.direction,n.direction),i=er.rayPlane(n,this._plane,rI));let r=h.subtract(i,this._origin,i),o=h.dot(this._xAxis,r),s=h.dot(this._yAxis,r);return t.x=o,t.y=s,t};ph.prototype.projectPointsToNearestOnPlane=function(e,t){l(t)||(t=[]);let n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var qSe=new h;ph.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new h);let n=this._ellipsoid,i=this._origin,r=this._xAxis,o=this._yAxis,s=qSe;return h.multiplyByScalar(r,e.x,s),t=h.add(i,s,t),h.multiplyByScalar(o,e.y,s),h.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};ph.prototype.projectPointsOntoEllipsoid=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};var La=ph;function Oi(e,t){this.center=h.clone(y(e,h.ZERO)),this.halfAxes=Q.clone(y(t,Q.ZERO))}Oi.packedLength=h.packedLength+Q.packedLength;Oi.pack=function(e,t,n){return n=y(n,0),h.pack(e.center,t,n),Q.pack(e.halfAxes,t,n+h.packedLength),t};Oi.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Oi),h.unpack(e,t,n.center),Q.unpack(e,t+h.packedLength,n.halfAxes),n};var YSe=new h,XSe=new h,KSe=new h,$Se=new h,ZSe=new h,JSe=new h,QSe=new Q,ewe={unitary:new Q,diagonal:new Q};Oi.fromPoints=function(e,t){if(l(t)||(t=new Oi),!l(e)||e.length===0)return t.halfAxes=Q.ZERO,t.center=h.ZERO,t;let n,i=e.length,r=h.clone(e[0],YSe);for(n=1;n<i;n++)h.add(r,e[n],r);let o=1/i;h.multiplyByScalar(r,o,r);let s=0,a=0,c=0,u=0,f=0,d=0,p;for(n=0;n<i;n++)p=h.subtract(e[n],r,XSe),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,d+=p.z*p.z;s*=o,a*=o,c*=o,u*=o,f*=o,d*=o;let g=QSe;g[0]=s,g[1]=a,g[2]=c,g[3]=a,g[4]=u,g[5]=f,g[6]=c,g[7]=f,g[8]=d;let m=Q.computeEigenDecomposition(g,ewe),x=Q.clone(m.unitary,t.halfAxes),C=Q.getColumn(x,0,$Se),A=Q.getColumn(x,1,ZSe),b=Q.getColumn(x,2,JSe),T=-Number.MAX_VALUE,S=-Number.MAX_VALUE,w=-Number.MAX_VALUE,D=Number.MAX_VALUE,I=Number.MAX_VALUE,O=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],T=Math.max(h.dot(C,p),T),S=Math.max(h.dot(A,p),S),w=Math.max(h.dot(b,p),w),D=Math.min(h.dot(C,p),D),I=Math.min(h.dot(A,p),I),O=Math.min(h.dot(b,p),O);C=h.multiplyByScalar(C,.5*(D+T),C),A=h.multiplyByScalar(A,.5*(I+S),A),b=h.multiplyByScalar(b,.5*(O+w),b);let B=h.add(C,A,t.center);h.add(B,b,B);let L=KSe;return L.x=T-D,L.y=S-I,L.z=w-O,h.multiplyByScalar(L,.5,L),Q.multiplyByScale(t.halfAxes,L,t.halfAxes),t};var O$=new h,twe=new h;function w$(e,t,n,i,r,o,s,a,c,u,f){l(f)||(f=new Oi);let d=f.halfAxes;Q.setColumn(d,0,t,d),Q.setColumn(d,1,n,d),Q.setColumn(d,2,i,d);let p=O$;p.x=(r+o)/2,p.y=(s+a)/2,p.z=(c+u)/2;let g=twe;g.x=(o-r)/2,g.y=(a-s)/2,g.z=(u-c)/2;let m=f.center;return p=Q.multiplyByVector(d,p,p),h.add(e,p,m),Q.multiplyByScale(d,g,d),f}var v$=new me,nwe=new h,iwe=new me,rwe=new me,owe=new me,swe=new me,awe=new me,cwe=new h,D$=new h,lwe=new h,P$=new h,uwe=new h,fwe=new W,dwe=new W,hwe=new W,mwe=new W,pwe=new W,_we=new h,gwe=new h,ywe=new h,xwe=new h,Cwe=new W,Awe=new h,Twe=new h,bwe=new h,Ewe=new an(h.UNIT_X,0);Oi.fromRectangle=function(e,t,n,i,r){t=y(t,0),n=y(n,0),i=y(i,oe.WGS84);let o,s,a,c,u,f,d;if(e.width<=M.PI){let I=he.center(e,v$),O=i.cartographicToCartesian(I,nwe),B=new La(O,i);d=B.plane;let L=I.longitude,_=e.south<0&&e.north>0?0:I.latitude,E=me.fromRadians(L,e.north,n,iwe),v=me.fromRadians(e.west,e.north,n,rwe),P=me.fromRadians(e.west,_,n,owe),R=me.fromRadians(e.west,e.south,n,swe),F=me.fromRadians(L,e.south,n,awe),U=i.cartographicToCartesian(E,cwe),k=i.cartographicToCartesian(v,D$),H=i.cartographicToCartesian(P,lwe),V=i.cartographicToCartesian(R,P$),q=i.cartographicToCartesian(F,uwe),j=B.projectPointToNearestOnPlane(U,fwe),X=B.projectPointToNearestOnPlane(k,dwe),G=B.projectPointToNearestOnPlane(H,hwe),$=B.projectPointToNearestOnPlane(V,mwe),J=B.projectPointToNearestOnPlane(q,pwe);return o=Math.min(X.x,G.x,$.x),s=-o,c=Math.max(X.y,j.y),a=Math.min($.y,J.y),v.height=R.height=t,k=i.cartographicToCartesian(v,D$),V=i.cartographicToCartesian(R,P$),u=Math.min(an.getPointDistance(d,k),an.getPointDistance(d,V)),f=n,w$(B.origin,B.xAxis,B.yAxis,B.zAxis,o,s,a,c,u,f,r)}let p=e.south>0,g=e.north<0,m=p?e.south:g?e.north:0,x=he.center(e,v$).longitude,C=h.fromRadians(x,m,n,i,_we);C.z=0;let b=Math.abs(C.x)<M.EPSILON10&&Math.abs(C.y)<M.EPSILON10?h.UNIT_X:h.normalize(C,gwe),T=h.UNIT_Z,S=h.cross(b,T,ywe);d=an.fromPointNormal(C,b,Ewe);let w=h.fromRadians(x+M.PI_OVER_TWO,m,n,i,xwe);s=h.dot(an.projectPointOntoPlane(d,w,Cwe),S),o=-s,c=h.fromRadians(0,e.north,g?t:n,i,Awe).z,a=h.fromRadians(0,e.south,p?t:n,i,Twe).z;let D=h.fromRadians(e.east,m,n,i,bwe);return u=an.getPointDistance(d,D),f=0,w$(C,S,T,b,o,s,a,c,u,f,r)};Oi.fromTransformation=function(e,t){return l(t)||(t=new Oi),t.center=N.getTranslation(e,t.center),t.halfAxes=N.getMatrix3(e,t.halfAxes),t.halfAxes=Q.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};Oi.clone=function(e,t){if(!!l(e))return l(t)?(h.clone(e.center,t.center),Q.clone(e.halfAxes,t.halfAxes),t):new Oi(e.center,e.halfAxes)};Oi.intersectPlane=function(e,t){let n=e.center,i=t.normal,r=e.halfAxes,o=i.x,s=i.y,a=i.z,c=Math.abs(o*r[Q.COLUMN0ROW0]+s*r[Q.COLUMN0ROW1]+a*r[Q.COLUMN0ROW2])+Math.abs(o*r[Q.COLUMN1ROW0]+s*r[Q.COLUMN1ROW1]+a*r[Q.COLUMN1ROW2])+Math.abs(o*r[Q.COLUMN2ROW0]+s*r[Q.COLUMN2ROW1]+a*r[Q.COLUMN2ROW2]),u=h.dot(i,n)+t.distance;return u<=-c?Jt.OUTSIDE:u>=c?Jt.INSIDE:Jt.INTERSECTING};var R$=new h,M$=new h,B$=new h,Swe=new h,I$=new h,wwe=new h;Oi.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,O$),i=e.halfAxes,r=Q.getColumn(i,0,R$),o=Q.getColumn(i,1,M$),s=Q.getColumn(i,2,B$),a=h.magnitude(r),c=h.magnitude(o),u=h.magnitude(s),f=!0,d=!0,p=!0;a>0?h.divideByScalar(r,a,r):f=!1,c>0?h.divideByScalar(o,c,o):d=!1,u>0?h.divideByScalar(s,u,s):p=!1;let g=!f+!d+!p,m,x,C;if(g===1){let S=r;m=o,x=s,d?p||(S=s,x=r):(S=o,m=r),C=h.cross(m,x,I$),S===r?r=C:S===o?o=C:S===s&&(s=C)}else if(g===2){m=r,d?m=o:p&&(m=s);let S=h.UNIT_Y;S.equalsEpsilon(m,M.EPSILON3)&&(S=h.UNIT_X),x=h.cross(m,S,Swe),h.normalize(x,x),C=h.cross(m,x,I$),h.normalize(C,C),m===r?(o=x,s=C):m===o?(s=x,r=C):m===s&&(r=x,o=C)}else g===3&&(r=h.UNIT_X,o=h.UNIT_Y,s=h.UNIT_Z);let A=wwe;A.x=h.dot(n,r),A.y=h.dot(n,o),A.z=h.dot(n,s);let b=0,T;return A.x<-a?(T=A.x+a,b+=T*T):A.x>a&&(T=A.x-a,b+=T*T),A.y<-c?(T=A.y+c,b+=T*T):A.y>c&&(T=A.y-c,b+=T*T),A.z<-u?(T=A.z+u,b+=T*T):A.z>u&&(T=A.z-u,b+=T*T),b};var vwe=new h,Dwe=new h;Oi.computePlaneDistances=function(e,t,n,i){l(i)||(i=new $c);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=Q.getColumn(a,0,R$),u=Q.getColumn(a,1,M$),f=Q.getColumn(a,2,B$),d=h.add(c,u,vwe);h.add(d,f,d),h.add(d,s,d);let p=h.subtract(d,t,Dwe),g=h.dot(n,p);return r=Math.min(g,r),o=Math.max(g,o),h.add(s,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.add(s,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.add(s,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.add(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),i.start=r,i.stop=o,i};var Pwe=new h,Iwe=new h,Owe=new h;Oi.computeCorners=function(e,t){l(t)||(t=[new h,new h,new h,new h,new h,new h,new h,new h]);let n=e.center,i=e.halfAxes,r=Q.getColumn(i,0,Pwe),o=Q.getColumn(i,1,Iwe),s=Q.getColumn(i,2,Owe);return h.clone(n,t[0]),h.subtract(t[0],r,t[0]),h.subtract(t[0],o,t[0]),h.subtract(t[0],s,t[0]),h.clone(n,t[1]),h.subtract(t[1],r,t[1]),h.subtract(t[1],o,t[1]),h.add(t[1],s,t[1]),h.clone(n,t[2]),h.subtract(t[2],r,t[2]),h.add(t[2],o,t[2]),h.subtract(t[2],s,t[2]),h.clone(n,t[3]),h.subtract(t[3],r,t[3]),h.add(t[3],o,t[3]),h.add(t[3],s,t[3]),h.clone(n,t[4]),h.add(t[4],r,t[4]),h.subtract(t[4],o,t[4]),h.subtract(t[4],s,t[4]),h.clone(n,t[5]),h.add(t[5],r,t[5]),h.subtract(t[5],o,t[5]),h.add(t[5],s,t[5]),h.clone(n,t[6]),h.add(t[6],r,t[6]),h.add(t[6],o,t[6]),h.subtract(t[6],s,t[6]),h.clone(n,t[7]),h.add(t[7],r,t[7]),h.add(t[7],o,t[7]),h.add(t[7],s,t[7]),t};var Rwe=new Q;Oi.computeTransformation=function(e,t){l(t)||(t=new N);let n=e.center,i=Q.multiplyByUniformScale(e.halfAxes,2,Rwe);return N.fromRotationTranslation(i,n,t)};var Mwe=new re;Oi.isOccluded=function(e,t){let n=re.fromOrientedBoundingBox(e,Mwe);return!t.isBoundingSphereVisible(n)};Oi.prototype.intersectPlane=function(e){return Oi.intersectPlane(this,e)};Oi.prototype.distanceSquaredTo=function(e){return Oi.distanceSquaredTo(this,e)};Oi.prototype.computePlaneDistances=function(e,t,n){return Oi.computePlaneDistances(this,e,t,n)};Oi.prototype.computeCorners=function(e){return Oi.computeCorners(this,e)};Oi.prototype.computeTransformation=function(e){return Oi.computeTransformation(this,e)};Oi.prototype.isOccluded=function(e){return Oi.isOccluded(this,e)};Oi.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&Q.equals(e.halfAxes,t.halfAxes)};Oi.prototype.clone=function(e){return Oi.clone(this,e)};Oi.prototype.equals=function(e){return Oi.equals(this,e)};var Ai=Oi;var Bwe={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047},Z=Object.freeze(Bwe);var xn={BYTE:Z.BYTE,UNSIGNED_BYTE:Z.UNSIGNED_BYTE,SHORT:Z.SHORT,UNSIGNED_SHORT:Z.UNSIGNED_SHORT,INT:Z.INT,UNSIGNED_INT:Z.UNSIGNED_INT,FLOAT:Z.FLOAT,DOUBLE:Z.DOUBLE};xn.getSizeInBytes=function(e){switch(e){case xn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case xn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case xn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case xn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case xn.INT:return Int32Array.BYTES_PER_ELEMENT;case xn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case xn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case xn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};xn.fromTypedArray=function(e){if(e instanceof Int8Array)return xn.BYTE;if(e instanceof Uint8Array)return xn.UNSIGNED_BYTE;if(e instanceof Int16Array)return xn.SHORT;if(e instanceof Uint16Array)return xn.UNSIGNED_SHORT;if(e instanceof Int32Array)return xn.INT;if(e instanceof Uint32Array)return xn.UNSIGNED_INT;if(e instanceof Float32Array)return xn.FLOAT;if(e instanceof Float64Array)return xn.DOUBLE};xn.validate=function(e){return l(e)&&(e===xn.BYTE||e===xn.UNSIGNED_BYTE||e===xn.SHORT||e===xn.UNSIGNED_SHORT||e===xn.INT||e===xn.UNSIGNED_INT||e===xn.FLOAT||e===xn.DOUBLE)};xn.createTypedArray=function(e,t){switch(e){case xn.BYTE:return new Int8Array(t);case xn.UNSIGNED_BYTE:return new Uint8Array(t);case xn.SHORT:return new Int16Array(t);case xn.UNSIGNED_SHORT:return new Uint16Array(t);case xn.INT:return new Int32Array(t);case xn.UNSIGNED_INT:return new Uint32Array(t);case xn.FLOAT:return new Float32Array(t);case xn.DOUBLE:return new Float64Array(t)}};xn.createArrayBufferView=function(e,t,n,i){switch(n=y(n,0),i=y(i,(t.byteLength-n)/xn.getSizeInBytes(e)),e){case xn.BYTE:return new Int8Array(t,n,i);case xn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case xn.SHORT:return new Int16Array(t,n,i);case xn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case xn.INT:return new Int32Array(t,n,i);case xn.UNSIGNED_INT:return new Uint32Array(t,n,i);case xn.FLOAT:return new Float32Array(t,n,i);case xn.DOUBLE:return new Float64Array(t,n,i)}};xn.fromName=function(e){switch(e){case"BYTE":return xn.BYTE;case"UNSIGNED_BYTE":return xn.UNSIGNED_BYTE;case"SHORT":return xn.SHORT;case"UNSIGNED_SHORT":return xn.UNSIGNED_SHORT;case"INT":return xn.INT;case"UNSIGNED_INT":return xn.UNSIGNED_INT;case"FLOAT":return xn.FLOAT;case"DOUBLE":return xn.DOUBLE}};var K=Object.freeze(xn);function Ht(e,t,n,i){this[0]=y(e,0),this[1]=y(n,0),this[2]=y(t,0),this[3]=y(i,0)}Ht.packedLength=4;Ht.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};Ht.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ht),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};Ht.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let r=0;r<n;++r)Ht.pack(e[r],t,r*4);return t};Ht.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let r=i/4;t[r]=Ht.unpack(e,i,t[r])}return t};Ht.clone=function(e,t){if(!!l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new Ht(e[0],e[2],e[1],e[3])};Ht.fromArray=Ht.unpack;Ht.fromColumnMajorArray=function(e,t){return Ht.clone(e,t)};Ht.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new Ht(e[0],e[1],e[2],e[3])};Ht.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new Ht(e.x,0,0,e.y)};Ht.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new Ht(e,0,0,e)};Ht.fromRotation=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new Ht(n,-i,i,n)};Ht.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]};Ht.getElementIndex=function(e,t){return e*2+t};Ht.getColumn=function(e,t,n){let i=t*2,r=e[i],o=e[i+1];return n.x=r,n.y=o,n};Ht.setColumn=function(e,t,n,i){i=Ht.clone(e,i);let r=t*2;return i[r]=n.x,i[r+1]=n.y,i};Ht.getRow=function(e,t,n){let i=e[t],r=e[t+2];return n.x=i,n.y=r,n};Ht.setRow=function(e,t,n,i){return i=Ht.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var Lwe=new W;Ht.setScale=function(e,t,n){let i=Ht.getScale(e,Lwe),r=t.x/i.x,o=t.y/i.y;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*o,n[3]=e[3]*o,n};var Nwe=new W;Ht.setUniformScale=function(e,t,n){let i=Ht.getScale(e,Nwe),r=t/i.x,o=t/i.y;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*o,n[3]=e[3]*o,n};var L$=new W;Ht.getScale=function(e,t){return t.x=W.magnitude(W.fromElements(e[0],e[1],L$)),t.y=W.magnitude(W.fromElements(e[2],e[3],L$)),t};var N$=new W;Ht.getMaximumScale=function(e){return Ht.getScale(e,N$),W.maximumComponent(N$)};var Fwe=new W;Ht.setRotation=function(e,t,n){let i=Ht.getScale(e,Fwe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.y,n[3]=t[3]*i.y,n};var Vwe=new W;Ht.getRotation=function(e,t){let n=Ht.getScale(e,Vwe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.y,t[3]=e[3]/n.y,t};Ht.multiply=function(e,t,n){let i=e[0]*t[0]+e[2]*t[1],r=e[0]*t[2]+e[2]*t[3],o=e[1]*t[0]+e[3]*t[1],s=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=o,n[2]=r,n[3]=s,n};Ht.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};Ht.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};Ht.multiplyByVector=function(e,t,n){let i=e[0]*t.x+e[2]*t.y,r=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=r,n};Ht.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Ht.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};Ht.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Ht.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};Ht.transpose=function(e,t){let n=e[0],i=e[2],r=e[1],o=e[3];return t[0]=n,t[1]=i,t[2]=r,t[3]=o,t};Ht.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};Ht.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};Ht.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]};Ht.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n};Ht.IDENTITY=Object.freeze(new Ht(1,0,0,1));Ht.ZERO=Object.freeze(new Ht(0,0,0,0));Ht.COLUMN0ROW0=0;Ht.COLUMN0ROW1=1;Ht.COLUMN1ROW0=2;Ht.COLUMN1ROW1=3;Object.defineProperties(Ht.prototype,{length:{get:function(){return Ht.packedLength}}});Ht.prototype.clone=function(e){return Ht.clone(this,e)};Ht.prototype.equals=function(e){return Ht.equals(this,e)};Ht.prototype.equalsEpsilon=function(e,t){return Ht.equalsEpsilon(this,e,t)};Ht.prototype.toString=function(){return`(${this[0]}, ${this[2]})
- (${this[1]}, ${this[3]})`};var Ri=Ht;var tr={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};tr.getMathType=function(e){switch(e){case tr.SCALAR:return Number;case tr.VEC2:return W;case tr.VEC3:return h;case tr.VEC4:return se;case tr.MAT2:return Ri;case tr.MAT3:return Q;case tr.MAT4:return N}};tr.getNumberOfComponents=function(e){switch(e){case tr.SCALAR:return 1;case tr.VEC2:return 2;case tr.VEC3:return 3;case tr.VEC4:case tr.MAT2:return 4;case tr.MAT3:return 9;case tr.MAT4:return 16}};tr.getAttributeLocationCount=function(e){switch(e){case tr.SCALAR:case tr.VEC2:case tr.VEC3:case tr.VEC4:return 1;case tr.MAT2:return 2;case tr.MAT3:return 3;case tr.MAT4:return 4}};tr.getGlslType=function(e){switch(e){case tr.SCALAR:return"float";case tr.VEC2:return"vec2";case tr.VEC3:return"vec3";case tr.VEC4:return"vec4";case tr.MAT2:return"mat2";case tr.MAT3:return"mat3";case tr.MAT4:return"mat4"}};var qt=Object.freeze(tr);var F$=1/256,V$=256,yr={};yr.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,r=n.y;n.x=(1-Math.abs(r))*M.signNotZero(i),n.y=(1-Math.abs(i))*M.signNotZero(r)}return n.x=M.toSNorm(n.x,t),n.y=M.toSNorm(n.y,t),n};yr.octEncode=function(e,t){return yr.octEncodeInRange(e,255,t)};var yS=new W,k$=new Uint8Array(1);function oI(e){return k$[0]=e,k$[0]}yr.octEncodeToCartesian4=function(e,t){return yr.octEncodeInRange(e,65535,yS),t.x=oI(yS.x*F$),t.y=oI(yS.x),t.z=oI(yS.y*F$),t.w=oI(yS.y),t};yr.octDecodeInRange=function(e,t,n,i){if(i.x=M.fromSNorm(e,n),i.y=M.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let r=i.x;i.x=(1-Math.abs(i.y))*M.signNotZero(r),i.y=(1-Math.abs(r))*M.signNotZero(i.y)}return h.normalize(i,i)};yr.octDecode=function(e,t,n){return yr.octDecodeInRange(e,t,255,n)};yr.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,r=e.z,o=e.w,s=n*V$+i,a=r*V$+o;return yr.octDecodeInRange(s,a,65535,t)};yr.octPackFloat=function(e){return 256*e.x+e.y};var YH=new W;yr.octEncodeFloat=function(e){return yr.octEncode(e,YH),yr.octPackFloat(YH)};yr.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),r=(n-i)*256;return yr.octDecode(i,r,t)};yr.octPack=function(e,t,n,i){let r=yr.octEncodeFloat(e),o=yr.octEncodeFloat(t),s=yr.octEncode(n,YH);return i.x=65536*s.x+r,i.y=65536*s.y+o,i};yr.octUnpack=function(e,t,n,i){let r=e.x/65536,o=Math.floor(r),s=(r-o)*65536;r=e.y/65536;let a=Math.floor(r),c=(r-a)*65536;yr.octDecodeFloat(s,t),yr.octDecodeFloat(c,n),yr.octDecode(o,a,i)};yr.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};yr.decompressTextureCoordinates=function(e,t){let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function qH(e){return e>>1^-(e&1)}yr.zigZagDeltaDecode=function(e,t,n){let i=e.length,r=0,o=0,s=0;for(let a=0;a<i;++a)r+=qH(e[a]),o+=qH(t[a]),e[a]=r,t[a]=o,l(n)&&(s+=qH(n[a]),n[a]=s)};yr.dequantize=function(e,t,n,i){let r=qt.getNumberOfComponents(n),o;switch(t){case K.BYTE:o=127;break;case K.UNSIGNED_BYTE:o=255;break;case K.SHORT:o=32767;break;case K.UNSIGNED_SHORT:o=65535;break;case K.INT:o=2147483647;break;case K.UNSIGNED_INT:o=4294967295;break}let s=new Float32Array(i*r);for(let a=0;a<i;a++)for(let c=0;c<r;c++){let u=a*r+c;s[u]=Math.max(e[u]/o,-1)}return s};yr.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=(1<<5)-1,r=(1<<6)-1,o=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],u=c>>11,f=c>>5&r,d=c&i,p=3*a;t[p]=u*o,t[p+1]=f*s,t[p+2]=d*o}return t};var In=yr;var sI={};sI.getHeight=function(e,t,n){return(e-n)*t+n};var kwe=new h;sI.getPosition=function(e,t,n,i,r){let o=t.cartesianToCartographic(e,kwe),s=sI.getHeight(o.height,n,i);return h.fromRadians(o.longitude,o.latitude,s,t,r)};var el=sI;var Uwe={NONE:0,BITS12:1},Vs=Object.freeze(Uwe);var hy=new h,zwe=new h,Bu=new W,aI=new N,Hwe=new N,Gwe=Math.pow(2,12);function Na(e,t,n,i,r,o,s,a,c,u){let f=Vs.NONE,d,p;if(l(t)&&l(n)&&l(i)&&l(r)){let g=t.minimum,m=t.maximum,x=h.subtract(m,g,zwe),C=i-n;Math.max(h.maximumComponent(x),C)<Gwe-1?f=Vs.BITS12:f=Vs.NONE,d=N.inverseTransformation(r,new N);let b=h.negate(g,hy);N.multiply(N.fromTranslation(b,aI),d,d);let T=hy;T.x=1/x.x,T.y=1/x.y,T.z=1/x.z,N.multiply(N.fromScale(T,aI),d,d),p=N.clone(r),N.setTranslation(p,h.ZERO,p),r=N.clone(r,new N);let S=N.fromTranslation(g,aI),w=N.fromScale(x,Hwe),D=N.multiply(S,w,aI);N.multiply(r,D,r),N.multiply(p,D,p)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=h.clone(e),this.toScaledENU=d,this.fromScaledENU=r,this.matrix=p,this.hasVertexNormals=o,this.hasWebMercatorT=y(s,!1),this.hasGeodeticSurfaceNormals=y(a,!1),this.exaggeration=y(c,1),this.exaggerationRelativeHeight=y(u,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}Na.prototype.encode=function(e,t,n,i,r,o,s,a){let c=i.x,u=i.y;if(this.quantization===Vs.BITS12){n=N.multiplyByPoint(this.toScaledENU,n,hy),n.x=M.clamp(n.x,0,1),n.y=M.clamp(n.y,0,1),n.z=M.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,d=M.clamp((r-this.minimumHeight)/f,0,1);W.fromElements(n.x,n.y,Bu);let p=In.compressTextureCoordinates(Bu);W.fromElements(n.z,d,Bu);let g=In.compressTextureCoordinates(Bu);W.fromElements(c,u,Bu);let m=In.compressTextureCoordinates(Bu);if(e[t++]=p,e[t++]=g,e[t++]=m,this.hasWebMercatorT){W.fromElements(s,0,Bu);let x=In.compressTextureCoordinates(Bu);e[t++]=x}}else h.subtract(n,this.center,hy),e[t++]=hy.x,e[t++]=hy.y,e[t++]=hy.z,e[t++]=r,e[t++]=c,e[t++]=u,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=In.octPackFloat(o)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var Wwe=new h,U$=new h;Na.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,r=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let o=this.stride;for(let s=0;s<r;s++){for(let f=0;f<i;f++){let d=s*i+f,p=s*o+f;t[p]=e[d]}let a=this.decodePosition(t,s,Wwe),c=n.geodeticSurfaceNormal(a,U$),u=s*o+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};Na.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let r=this.stride;for(let o=0;o<i;o++)for(let s=0;s<r;s++){let a=o*n+s,c=o*r+s;t[c]=e[a]}};Na.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new h),t*=this.stride,this.quantization===Vs.BITS12){let i=In.decompressTextureCoordinates(e[t],Bu);n.x=i.x,n.y=i.y;let r=In.decompressTextureCoordinates(e[t+1],Bu);return n.z=r.x,N.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],h.add(n,this.center,n)};Na.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,r=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,U$),a=this.decodeHeight(e,t),c=el.getHeight(a,i,r)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};Na.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new W),t*=this.stride,this.quantization===Vs.BITS12?In.decompressTextureCoordinates(e[t+2],n):W.fromElements(e[t+4],e[t+5],n)};Na.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===Vs.BITS12?In.decompressTextureCoordinates(e[t+1],Bu).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};Na.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Vs.BITS12?In.decompressTextureCoordinates(e[t+3],Bu).x:e[t+6]};Na.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,r=Math.floor(i),o=(i-r)*256;return W.fromElements(r,o,n)};Na.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n};Na.prototype._calculateStrideAndOffsets=function(){let e=0;switch(this.quantization){case Vs.BITS12:e+=3;break;default:e+=6}this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var cI={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},lI={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};Na.prototype.getAttributes=function(e){let t=K.FLOAT,n=K.getSizeInBytes(t),i=this.stride*n,r=0,o=[];function s(a,c){o.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:r,strideInBytes:i}),r+=c*n}if(this.quantization===Vs.NONE){s(cI.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(cI.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(cI.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(lI.compressed0,a?4:3),c&&s(lI.compressed1,1),this.hasGeodeticSurfaceNormals&&s(lI.geodeticSurfaceNormal,3)}return o};Na.prototype.getAttributeLocations=function(){return this.quantization===Vs.NONE?cI:lI};Na.clone=function(e,t){if(!!l(e))return l(t)||(t=new Na),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=h.clone(e.center),t.toScaledENU=N.clone(e.toScaledENU),t.fromScaledENU=N.clone(e.fromScaledENU),t.matrix=N.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var mc=Na;function tl(e){this._ellipsoid=y(e,oe.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(tl.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});tl.mercatorAngleToGeodeticLatitude=function(e){return M.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};tl.geodeticLatitudeToMercatorAngle=function(e){e>tl.MaximumLatitude?e=tl.MaximumLatitude:e<-tl.MaximumLatitude&&(e=-tl.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};tl.MaximumLatitude=tl.mercatorAngleToGeodeticLatitude(Math.PI);tl.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,r=tl.geodeticLatitudeToMercatorAngle(e.latitude)*n,o=e.height;return l(t)?(t.x=i,t.y=r,t.z=o,t):new h(i,r,o)};tl.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,r=tl.mercatorAngleToGeodeticLatitude(e.y*n),o=e.z;return l(t)?(t.longitude=i,t.latitude=r,t.height=o,t):new me(i,r,o)};var ji=tl;var _h={};_h.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var XH=new h,jwe=new N,qwe=new h,Ywe=new h;_h.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,r=Math.atan,o=Math.exp,s=M.PI_OVER_TWO,a=M.toRadians,c=e.heightmap,u=e.width,f=e.height,d=e.skirtHeight,p=d>0,g=y(e.isGeographic,!0),m=y(e.ellipsoid,oe.WGS84),x=1/m.maximumRadius,C=he.clone(e.nativeRectangle),A=he.clone(e.rectangle),b,T,S,w;l(A)?(b=A.west,T=A.south,S=A.east,w=A.north):g?(b=a(C.west),T=a(C.south),S=a(C.east),w=a(C.north)):(b=C.west*x,T=s-2*r(o(-C.south*x)),S=C.east*x,w=s-2*r(o(-C.north*x)));let D=e.relativeToCenter,I=l(D);D=I?D:h.ZERO;let O=y(e.includeWebMercatorT,!1),B=y(e.exaggeration,1),L=y(e.exaggerationRelativeHeight,0),E=B!==1,v=y(e.structure,_h.DEFAULT_STRUCTURE),P=y(v.heightScale,_h.DEFAULT_STRUCTURE.heightScale),R=y(v.heightOffset,_h.DEFAULT_STRUCTURE.heightOffset),F=y(v.elementsPerHeight,_h.DEFAULT_STRUCTURE.elementsPerHeight),U=y(v.stride,_h.DEFAULT_STRUCTURE.stride),k=y(v.elementMultiplier,_h.DEFAULT_STRUCTURE.elementMultiplier),H=y(v.isBigEndian,_h.DEFAULT_STRUCTURE.isBigEndian),V=he.computeWidth(C),q=he.computeHeight(C),j=V/(u-1),X=q/(f-1);g||(V*=x,q*=x);let G=m.radiiSquared,$=G.x,J=G.y,ce=G.z,de=65536,ie=-65536,ae=yt.eastNorthUpToFixedFrame(D,m),_e=N.inverseTransformation(ae,jwe),be,Te;O&&(be=ji.geodeticLatitudeToMercatorAngle(T),Te=1/(ji.geodeticLatitudeToMercatorAngle(w)-be));let Oe=qwe;Oe.x=Number.POSITIVE_INFINITY,Oe.y=Number.POSITIVE_INFINITY,Oe.z=Number.POSITIVE_INFINITY;let Be=Ywe;Be.x=Number.NEGATIVE_INFINITY,Be.y=Number.NEGATIVE_INFINITY,Be.z=Number.NEGATIVE_INFINITY;let tt=Number.POSITIVE_INFINITY,lt=u*f,Pt=d>0?u*2+f*2:0,ht=lt+Pt,wn=new Array(ht),ii=new Array(ht),nt=new Array(ht),Mt=O?new Array(ht):[],ri=E?new Array(ht):[],we=0,_t=f,Yt=0,Gi=u;p&&(--we,++_t,--Yt,++Gi);let ti=1e-5;for(let We=we;We<_t;++We){let Ue=We;Ue<0&&(Ue=0),Ue>=f&&(Ue=f-1);let Je=C.north-X*Ue;g?Je=a(Je):Je=s-2*r(o(-Je*x));let gt=(Je-T)/(w-T);gt=M.clamp(gt,0,1);let cn=We===we,Rn=We===_t-1;d>0&&(cn?Je+=ti*q:Rn&&(Je-=ti*q));let $i=t(Je),Nr=n(Je),zo=ce*Nr,$n;O&&($n=(ji.geodeticLatitudeToMercatorAngle(Je)-be)*Te);for(let Ho=Yt;Ho<Gi;++Ho){let Go=Ho;Go<0&&(Go=0),Go>=u&&(Go=u-1);let lc=Ue*(u*U)+Go*U,jr;if(F===1)jr=c[lc];else{jr=0;let wr;if(H)for(wr=0;wr<F;++wr)jr=jr*k+c[lc+wr];else for(wr=F-1;wr>=0;--wr)jr=jr*k+c[lc+wr]}jr=jr*P+R,ie=Math.max(ie,jr),de=Math.min(de,jr);let Fr=C.west+j*Go;g?Fr=a(Fr):Fr=Fr*x;let Po=(Fr-b)/(S-b);Po=M.clamp(Po,0,1);let Kc=Ue*u+Go;if(d>0){let wr=Ho===Yt,Ll=Ho===Gi-1,ny=cn||Rn||wr||Ll;if((cn||Rn)&&(wr||Ll))continue;ny&&(jr-=d,wr?(Kc=lt+(f-Ue-1),Fr-=ti*V):Rn?Kc=lt+f+(u-Go-1):Ll?(Kc=lt+f+u+Ue,Fr+=ti*V):cn&&(Kc=lt+f+u+f+Go))}let Ls=$i*t(Fr),ca=$i*n(Fr),FC=$*Ls,vt=J*ca,ve=i(FC*Ls+vt*ca+zo*Nr),ut=1/ve,sn=FC*ut,Zn=vt*ut,go=zo*ut,io=new h;io.x=sn+Ls*jr,io.y=Zn+ca*jr,io.z=go+Nr*jr,N.multiplyByPoint(_e,io,XH),h.minimumByComponent(XH,Oe,Oe),h.maximumByComponent(XH,Be,Be),tt=Math.min(tt,jr),wn[Kc]=io,nt[Kc]=new W(Po,gt),ii[Kc]=jr,O&&(Mt[Kc]=$n),E&&(ri[Kc]=m.geodeticSurfaceNormal(io))}}let Br=re.fromPoints(wn),or;l(A)&&(or=Ai.fromRectangle(A,de,ie,m));let Lr;I&&(Lr=new g_(m).computeHorizonCullingPointPossiblyUnderEllipsoid(D,wn,de));let Pi=new ly(Oe,Be,D),gr=new mc(D,Pi,tt,ie,ae,!1,O,E,B,L),Ia=new Float32Array(ht*gr.stride),He=0;for(let We=0;We<ht;++We)He=gr.encode(Ia,He,wn[We],nt[We],ii[We],void 0,Mt[We],ri[We]);return{vertices:Ia,maximumHeight:ie,minimumHeight:de,encoding:gr,boundingSphere3D:Br,orientedBoundingBox:or,occludeePointInScaledSpace:Lr}};var xS=_h;function Xwe(){return!0}function Kwe(e,t){t=y(t,"This object was destroyed, i.e., destroy() was called.");function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=Xwe}var ue=Kwe;function z$(){if(!l(la._canTransferArrayBuffer)){let e=new Worker(G$("Workers/transferTypedArrayTest.js"));e.postMessage=y(e.webkitPostMessage,e.postMessage);let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return la._canTransferArrayBuffer=!1,la._canTransferArrayBuffer}let i=ts();e.onmessage=function(r){let o=r.data.array,s=l(o)&&o[0]===t;i.resolve(s),e.terminate(),la._canTransferArrayBuffer=s},la._canTransferArrayBuffer=i.promise}return la._canTransferArrayBuffer}var $H=new ge;function H$(e,t){--e._activeTasks;let n=t.id;if(!l(n))return;let i=e._deferreds,r=i[n];if(l(t.error)){let o=t.error;o.name==="RuntimeError"?(o=new fe(t.error.message),o.stack=t.error.stack):o.name==="DeveloperError"&&(o=new ye(t.error.message),o.stack=t.error.stack),$H.raiseEvent(o),r.reject(o)}else $H.raiseEvent(),r.resolve(t.result);delete i[n]}function G$(e){let t=Qt(e);if(YC(t)){let n=`importScripts("${t}");`,i;try{i=new Blob([n],{type:"application/javascript"})}catch{let s=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,a=new s;a.append(n),i=a.getBlob("application/javascript")}t=(window.URL||window.webkitURL).createObjectURL(i)}return t}var KH;function $we(){return l(KH)||(KH=G$("Workers/cesiumWorkerBootstrapper.js")),KH}function W$(e){let t=new Worker($we());t.postMessage=y(t.webkitPostMessage,t.postMessage);let n={loaderConfig:{paths:{Workers:Qt("Workers")},baseUrl:Qt.getCesiumBaseUrl().url},workerModule:e._workerPath};return t.postMessage(n),t.onmessage=function(i){H$(e,i.data)},t}function Zwe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Et.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new fe(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=Qt(t.fallbackModulePath),Promise.resolve(n)}return n.modulePath=Qt(t.modulePath),n.wasmBinaryFile=Qt(t.wasmBinaryFile),De.fetchArrayBuffer({url:n.wasmBinaryFile}).then(function(i){return n.wasmBinary=i,n})}function la(e,t){let n=new oi.default(e);this._workerPath=n.scheme().length!==0&&n.fragment().length===0?e:la._workerModulePrefix+e,this._maximumActiveTasks=y(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._deferreds={},this._nextID=0}var Jwe=[];la.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=W$(this)),this._activeTasks>=this._maximumActiveTasks)return;++this._activeTasks;let n=this;return Promise.resolve(z$()).then(function(i){l(t)?i||(t.length=0):t=Jwe;let r=n._nextID++,o=ts();return n._deferreds[r]=o,n._worker.postMessage({id:r,parameters:e,canTransferArrayBuffer:i},t),o.promise})};la.prototype.initWebAssemblyModule=function(e){l(this._worker)||(this._worker=W$(this));let t=ts(),n=this,i=this._worker;return Zwe(this,e).then(function(r){return Promise.resolve(z$()).then(function(o){let s,a=r.wasmBinary;l(a)&&o&&(s=[a]),i.onmessage=function(c){i.onmessage=function(u){H$(n,u.data)},t.resolve(c.data)},i.postMessage({webAssemblyConfig:r},s)})}),t.promise};la.prototype.isDestroyed=function(){return!1};la.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),ue(this)};la.taskCompletedEvent=$H;la._defaultWorkerModulePrefix="Workers/";la._workerModulePrefix=la._defaultWorkerModulePrefix;la._canTransferArrayBuffer=void 0;var Mi=la;function S_(){ye.throwInstantiationError()}Object.defineProperties(S_.prototype,{credits:{get:ye.throwInstantiationError},waterMask:{get:ye.throwInstantiationError}});S_.prototype.interpolateHeight=ye.throwInstantiationError;S_.prototype.isChildAvailable=ye.throwInstantiationError;S_.prototype.createMesh=ye.throwInstantiationError;S_.prototype.upsample=ye.throwInstantiationError;S_.prototype.wasCreatedByUpsampling=ye.throwInstantiationError;S_.maximumAsynchronousTasks=5;var gh=S_;function Qwe(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m,x){this.center=e,this.vertices=t,this.stride=y(u,6),this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=r,this.minimumHeight=o,this.maximumHeight=s,this.boundingSphere3D=a,this.occludeePointInScaledSpace=c,this.orientedBoundingBox=f,this.encoding=d,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=g,this.eastIndicesNorthToSouth=m,this.northIndicesWestToEast=x}var Kf=Qwe;var Es={UNSIGNED_BYTE:Z.UNSIGNED_BYTE,UNSIGNED_SHORT:Z.UNSIGNED_SHORT,UNSIGNED_INT:Z.UNSIGNED_INT};Es.getSizeInBytes=function(e){switch(e){case Es.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Es.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Es.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};Es.fromSizeInBytes=function(e){switch(e){case 2:return Es.UNSIGNED_SHORT;case 4:return Es.UNSIGNED_INT;case 1:return Es.UNSIGNED_BYTE}};Es.validate=function(e){return l(e)&&(e===Es.UNSIGNED_BYTE||e===Es.UNSIGNED_SHORT||e===Es.UNSIGNED_INT)};Es.createTypedArray=function(e,t){return e>=M.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};Es.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=M.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};Es.fromTypedArray=function(e){if(e instanceof Uint8Array)return Es.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Es.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Es.UNSIGNED_INT};var Le=Object.freeze(Es);function pc(){ye.throwInstantiationError()}Object.defineProperties(pc.prototype,{errorEvent:{get:ye.throwInstantiationError},credit:{get:ye.throwInstantiationError},tilingScheme:{get:ye.throwInstantiationError},ready:{get:ye.throwInstantiationError},readyPromise:{get:ye.throwInstantiationError},hasWaterMask:{get:ye.throwInstantiationError},hasVertexNormals:{get:ye.throwInstantiationError},availability:{get:ye.throwInstantiationError}});var j$=[];pc.getRegularGridIndices=function(e,t){let n=j$[e];l(n)||(j$[e]=n=[]);let i=n[t];return l(i)||(e*t<M.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),K$(e,t,i,0)),i};var q$=[];pc.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=q$[e];l(n)||(q$[e]=n=[]);let i=n[t];if(!l(i)){let r=pc.getRegularGridIndices(e,t),o=X$(e,t),s=o.westIndicesSouthToNorth,a=o.southIndicesEastToWest,c=o.eastIndicesNorthToSouth,u=o.northIndicesWestToEast;i=n[t]={indices:r,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:u}}return i};var Y$=[];pc.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=Y$[e];l(n)||(Y$[e]=n=[]);let i=n[t];if(!l(i)){let r=e*t,o=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=r+s,u=o+a,f=X$(e,t),d=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,x=Le.createTypedArray(c,u);K$(e,t,x,0),pc.addSkirtIndices(d,p,g,m,r,x,o),i=n[t]={indices:x,westIndicesSouthToNorth:d,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:m,indexCountWithoutSkirts:o}}return i};pc.addSkirtIndices=function(e,t,n,i,r,o,s){let a=r;s=uI(e,a,o,s),a+=e.length,s=uI(t,a,o,s),a+=t.length,s=uI(n,a,o,s),a+=n.length,uI(i,a,o,s)};function X$(e,t){let n=new Array(t),i=new Array(e),r=new Array(t),o=new Array(e),s;for(s=0;s<e;++s)o[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)r[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:r,northIndicesWestToEast:o}}function K$(e,t,n,i){let r=0;for(let o=0;o<t-1;++o){for(let s=0;s<e-1;++s){let a=r,c=a+e,u=c+1,f=a+1;n[i++]=a,n[i++]=c,n[i++]=f,n[i++]=f,n[i++]=c,n[i++]=u,++r}++r}}function uI(e,t,n,i){let r=e[0],o=e.length;for(let s=1;s<o;++s){let a=e[s];n[i++]=r,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,r=a,++t}return i}pc.heightmapTerrainQuality=.25;pc.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*pc.heightmapTerrainQuality/(t*n)};pc.prototype.requestTileGeometry=ye.throwInstantiationError;pc.prototype.getLevelMaximumGeometricError=ye.throwInstantiationError;pc.prototype.getTileDataAvailable=ye.throwInstantiationError;pc.prototype.loadTileDataAvailability=ye.throwInstantiationError;var ns=pc;function Hm(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=y(e.childTileMask,15),this._encoding=y(e.encoding,km.NONE);let t=xS.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=y(n.heightScale,t.heightScale),n.heightOffset=y(n.heightOffset,t.heightOffset),n.elementsPerHeight=y(n.elementsPerHeight,t.elementsPerHeight),n.stride=y(n.stride,t.stride),n.elementMultiplier=y(n.elementMultiplier,t.elementMultiplier),n.isBigEndian=y(n.isBigEndian,t.isBigEndian)):n=t,this._structure=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===km.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(Hm.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var $$="createVerticesFromHeightmap",eve=new Mi($$),tve=new Mi($$,gh.maximumAsynchronousTasks);Hm.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,r),f=t.tileXYToRectangle(n,i,r),d=c.cartographicToCartesian(he.center(f)),p=this._structure,m=ns.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(m*4,1e3);let C=(a?tve:eve).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Ii,exaggeration:o,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(C))return;let A=this;return Promise.resolve(C).then(function(b){let T;A._skirtHeight>0?T=ns.getRegularGridAndSkirtIndicesAndEdgeIndices(b.gridWidth,b.gridHeight):T=ns.getRegularGridIndicesAndEdgeIndices(b.gridWidth,b.gridHeight);let S=b.gridWidth*b.gridHeight;return A._mesh=new Kf(d,new Float32Array(b.vertices),T.indices,T.indexCountWithoutSkirts,S,b.minimumHeight,b.maximumHeight,re.clone(b.boundingSphere3D),h.clone(b.occludeePointInScaledSpace),b.numberOfAttributes,Ai.clone(b.orientedBoundingBox),mc.clone(b.encoding),T.westIndicesSouthToNorth,T.southIndicesEastToWest,T.eastIndicesNorthToSouth,T.northIndicesWestToEast),A._buffer=void 0,A._mesh})};Hm.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,r),u=t.tileXYToRectangle(n,i,r),f=a.cartographicToCartesian(he.center(u)),d=this._structure,g=ns.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(g*4,1e3);let m=xS.computeVertices({heightmap:this._buffer,structure:d,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:f,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Ii,exaggeration:o,exaggerationRelativeHeight:s});this._buffer=void 0;let x;this._skirtHeight>0?x=ns.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):x=ns.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let C=m.gridWidth*m.gridHeight;return this._mesh=new Kf(f,m.vertices,x.indices,x.indexCountWithoutSkirts,C,m.minimumHeight,m.maximumHeight,m.boundingSphere3D,m.occludeePointInScaledSpace,m.encoding.stride,m.orientedBoundingBox,m.encoding,x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),this._mesh};Hm.prototype.interpolateHeight=function(e,t,n){let i=this._width,r=this._height,o=this._structure,s=o.stride,a=o.elementsPerHeight,c=o.elementMultiplier,u=o.isBigEndian,f=o.heightOffset,d=o.heightScale,p=l(this._mesh),g=this._encoding===km.LERC;if(!p&&g)return;let x;if(p){let C=this._mesh.vertices,A=this._mesh.encoding;x=Z$(C,A,f,d,e,i,r,t,n)}else x=nve(this._buffer,a,c,s,u,e,i,r,t,n),x=x*d+f;return x};Hm.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(a))return;let c=this._width,u=this._height,f=this._structure,d=f.stride,p=new this._bufferType(c*u*d),g=a.vertices,m=a.encoding,x=e.tileXYToRectangle(t,n,i),C=e.tileXYToRectangle(r,o,s),A=f.heightOffset,b=f.heightScale,T=f.elementsPerHeight,S=f.elementMultiplier,w=f.isBigEndian,D=Math.pow(S,T-1);for(let I=0;I<u;++I){let O=M.lerp(C.north,C.south,I/(u-1));for(let B=0;B<c;++B){let L=M.lerp(C.west,C.east,B/(c-1)),_=Z$(g,m,A,b,x,c,u,L,O);_=_<f.lowestEncodedHeight?f.lowestEncodedHeight:_,_=_>f.highestEncodedHeight?f.highestEncodedHeight:_,ive(p,T,S,D,d,w,I*c+B,_)}}return Promise.resolve(new Hm({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};Hm.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};Hm.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function nve(e,t,n,i,r,o,s,a,c,u){let f=(c-o.west)*(s-1)/(o.east-o.west),d=(u-o.south)*(a-1)/(o.north-o.south),p=f|0,g=p+1;g>=s&&(g=s-1,p=s-2);let m=d|0,x=m+1;x>=a&&(x=a-1,m=a-2);let C=f-p,A=d-m;m=a-1-m,x=a-1-x;let b=fI(e,t,n,i,r,m*s+p),T=fI(e,t,n,i,r,m*s+g),S=fI(e,t,n,i,r,x*s+p),w=fI(e,t,n,i,r,x*s+g);return J$(C,A,b,T,S,w)}function Z$(e,t,n,i,r,o,s,a,c){let u=(a-r.west)*(o-1)/(r.east-r.west),f=(c-r.south)*(s-1)/(r.north-r.south),d=u|0,p=d+1;p>=o&&(p=o-1,d=o-2);let g=f|0,m=g+1;m>=s&&(m=s-1,g=s-2);let x=u-d,C=f-g;g=s-1-g,m=s-1-m;let A=(t.decodeHeight(e,g*o+d)-n)/i,b=(t.decodeHeight(e,g*o+p)-n)/i,T=(t.decodeHeight(e,m*o+d)-n)/i,S=(t.decodeHeight(e,m*o+p)-n)/i;return J$(x,C,A,b,T,S)}function J$(e,t,n,i,r,o){return t<e?n+e*(i-n)+t*(o-i):n+e*(o-r)+t*(r-n)}function fI(e,t,n,i,r,o){o*=i;let s=0,a;if(r)for(a=0;a<t;++a)s=s*n+e[o+a];else for(a=t-1;a>=0;--a)s=s*n+e[o+a];return s}function ive(e,t,n,i,r,o,s,a){s*=r;let c;if(o)for(c=0;c<t-1;++c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;else for(c=t-1;c>0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var Fa=Hm;function cA(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var my=new he;function rve(e,t,n,i){let r=i.length;for(let o=0;o<r;++o){let s=i[o];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}cA.prototype.addAvailableTileRange=function(e,t,n,i,r){let o=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=r;++p)for(let g=t;g<=i;++g)rve(e,g,p,s)||s.push(new sA(o,void 0,0,g,p));o.tileXYToRectangle(t,n,e,my);let a=my.west,c=my.north;o.tileXYToRectangle(i,r,e,my);let u=my.east,f=my.south,d=new lve(e,a,f,u,c);for(let p=0;p<s.length;++p){let g=s[p];ZH(g.extent,d)&&uve(this._maximumLevel,g,d)}};cA.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(aA(i.extent,e)){t=i;break}}return l(t)?CS(void 0,t,e):-1};var ove=[],sve=[],ave=new he,cve=new he;cA.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=ove;t.length=0,e.east<e.west?(t.push(he.fromRadians(-Math.PI,e.south,e.east,e.north,ave)),t.push(he.fromRadians(e.west,e.south,Math.PI,e.north,cve))):t.push(e);let n=sve;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)AS(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var Q$=new me;cA.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,my);return he.center(i,Q$),this.computeMaximumLevelAtPosition(Q$)>=e};cA.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let r=0;return r|=this.isTileAvailable(i,2*t,2*n+1)?1:0,r|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,r|=this.isTileAvailable(i,2*t,2*n)?4:0,r|=this.isTileAvailable(i,2*t+1,2*n)?8:0,r};function sA(e,t,n,i,r){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=r,this.extent=e.tileXYToRectangle(i,r,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(sA.prototype,{nw:{get:function(){return this._nw||(this._nw=new sA(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new sA(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new sA(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new sA(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function lve(e,t,n,i,r){this.level=e,this.west=t,this.south=n,this.east=i,this.north=r}function ZH(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),o=Math.min(e.north,t.north);return i<o&&n<r}function uve(e,t,n){for(;t.level<e;)if(dI(t.nw.extent,n))t=t.nw;else if(dI(t.ne.extent,n))t=t.ne;else if(dI(t.sw.extent,n))t=t.sw;else if(dI(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=ao(t.rectangles,n.level,fve);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function fve(e,t){return e.level-t}function dI(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function aA(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function CS(e,t,n){let i=0,r=!1;for(;!r;){let o=t._nw&&aA(t._nw.extent,n),s=t._ne&&aA(t._ne.extent,n),a=t._sw&&aA(t._sw.extent,n),c=t._se&&aA(t._se.extent,n);if(o+s+a+c>1){o&&(i=Math.max(i,CS(t,t._nw,n))),s&&(i=Math.max(i,CS(t,t._ne,n))),a&&(i=Math.max(i,CS(t,t._sw,n))),c&&(i=Math.max(i,CS(t,t._se,n)));break}else o?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:r=!0}for(;t!==e;){let o=t.rectangles;for(let s=o.length-1;s>=0&&o[s].level>i;--s){let a=o[s];aA(a,n)&&(i=a.level)}t=t.parent}return i}function AS(e,t,n){if(!t)return;let i,r=!1;for(i=0;i<n.length;++i)r=r||ZH(t.extent,n[i]);if(!r)return;let o=t.rectangles;for(i=0;i<o.length;++i){let s=o[i];e[s.level]||(e[s.level]=n),e[s.level]=dve(e[s.level],s)}AS(e,t._nw,n),AS(e,t._ne,n),AS(e,t._sw,n),AS(e,t._se,n)}function dve(e,t){let n=[];for(let i=0;i<e.length;++i){let r=e[i];ZH(r,t)?(r.west<t.west&&n.push(new he(r.west,r.south,t.west,r.north)),r.east>t.east&&n.push(new he(t.east,r.south,r.east,r.north)),r.south<t.south&&n.push(new he(Math.max(t.west,r.west),r.south,Math.min(t.east,r.east),t.south)),r.north>t.north&&n.push(new he(Math.max(t.west,r.west),t.north,Math.min(t.east,r.east),r.north))):n.push(r)}return n}var yh=cA;var eZ={};function TS(e,t){l(eZ[e])||(eZ[e]=!0,console.warn(y(t,e)))}TS.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";TS.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";TS.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";TS.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var Lt=TS;function hve(e,t){Lt(e,t)}var di=hve;function mve(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let r=e.stack;return l(r)&&(t+=`
- ${r}`),t}var Gm=mve;function w_(e,t,n,i,r,o,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=r,this.timesRetried=y(o,0),this.retry=!1,this.error=s}w_.reportError=function(e,t,n,i,r,o,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=r,c.y=o,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new w_(t,i,r,o,s,0,a),n.numberOfListeners>0?n.raiseEvent(c):console.log(`An error occurred in "${t.constructor.name}": ${Gm(i)}`),c};w_.handleError=function(e,t,n,i,r,o,s,a,c){di("TileProviderError.handleError","TileProviderError.handleError was deprecated in CesiumJS 1.96 and will be removed in 1.97. Use TileProviderError.reportError instead.");let u=w_.reportError(e,t,n,i,r,o,s,c);return u.retry&&l(a)&&a(),u};w_.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};w_.handleSuccess=function(e){di("TileProviderError.handleSuccess","TileProviderError.handleSuccess was deprecated in CesiumJS 1.96 and will be removed in 1.97. Use TileProviderError.reportSuccess instead."),w_.reportSuccess(e)};var jn=w_;function v_(e){if(e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,oe.WGS84),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1),this._projection=new ji(this._ellipsoid),l(e.rectangleSouthwestInMeters)&&l(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new W(-i,-i),this._rectangleNortheastInMeters=new W(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new he(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(v_.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});v_.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};v_.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};v_.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(he.southwest(e)),r=n.project(he.northeast(e));return l(t)?(t.west=i.x,t.south=i.y,t.east=r.x,t.north=r.y,t):new he(i.x,i.y,r.x,r.y)};v_.prototype.tileXYToNativeRectangle=function(e,t,n,i){let r=this.getNumberOfXTilesAtLevel(n),o=this.getNumberOfYTilesAtLevel(n),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/r,a=this._rectangleSouthwestInMeters.x+e*s,c=this._rectangleSouthwestInMeters.x+(e+1)*s,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/o,f=this._rectangleNortheastInMeters.y-t*u,d=this._rectangleNortheastInMeters.y-(t+1)*u;return l(i)?(i.west=a,i.south=d,i.east=c,i.north=f,i):new he(a,d,c,f)};v_.prototype.tileXYToRectangle=function(e,t,n,i){let r=this.tileXYToNativeRectangle(e,t,n,i),o=this._projection,s=o.unproject(new W(r.west,r.south)),a=o.unproject(new W(r.east,r.north));return r.west=s.longitude,r.south=s.latitude,r.east=a.longitude,r.north=a.latitude,r};v_.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!he.contains(i,e))return;let r=this.getNumberOfXTilesAtLevel(t),o=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/r,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/o,d=this._projection.project(e),p=d.x-this._rectangleSouthwestInMeters.x,g=this._rectangleNortheastInMeters.y-d.y,m=p/a|0;m>=r&&(m=r-1);let x=g/u|0;return x>=o&&(x=o-1),l(n)?(n.x=m,n.y=x,n):new W(m,x)};var is=v_;var pve=15;function lA(e){this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._ready=!1,this._width=void 0,this._height=void 0,this._encoding=void 0;let t=e.token;this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailablityLoaded=void 0,this._availableCache={};let n=this,i=y(e.ellipsoid,oe.WGS84);this._readyPromise=Promise.resolve(e.url).then(function(r){let o=De.createIfNeeded(r);return o.appendForwardSlash(),l(t)&&(o=o.getDerivedResource({queryParameters:{token:t}})),n._resource=o,o.getDerivedResource({queryParameters:{f:"pjson"}}).fetchJson()}).then(function(r){let o=r.copyrightText;l(o)&&(n._credit=new Gt(o));let s=r.spatialReference,a=y(s.latestWkid,s.wkid),c=r.extent,u={ellipsoid:i};if(a===4326)u.rectangle=he.fromDegrees(c.xmin,c.ymin,c.xmax,c.ymax),n._tilingScheme=new Qi(u);else if(a===3857)u.rectangleSouthwestInMeters=new W(c.xmin,c.ymin),u.rectangleNortheastInMeters=new W(c.xmax,c.ymax),n._tilingScheme=new is(u);else return Promise.reject(new fe("Invalid spatial reference"));let f=r.tileInfo;return l(f)?(n._width=f.rows+1,n._height=f.cols+1,n._encoding=f.format==="LERC"?km.LERC:km.NONE,n._lodCount=f.lods.length-1,(n._hasAvailability=r.capabilities.indexOf("Tilemap")!==-1)&&(n._tilesAvailable=new yh(n._tilingScheme,n._lodCount),n._tilesAvailable.addAvailableTileRange(0,0,0,n._tilingScheme.getNumberOfXTilesAtLevel(0),n._tilingScheme.getNumberOfYTilesAtLevel(0)),n._tilesAvailablityLoaded=new yh(n._tilingScheme,n._lodCount)),n._levelZeroMaximumGeometricError=ns.getEstimatedLevelZeroGeometricErrorForAHeightmap(n._tilingScheme.ellipsoid,n._width,n._tilingScheme.getNumberOfXTilesAtLevel(0)),r.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),n._terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:r.minValues[0],highestEncodedHeight:r.maxValues[0]},n._ready=!0,!0):Promise.reject(new fe("tileInfo is required"))}).catch(function(r){let o=`An error occurred while accessing ${n._resource.url}.`;return jn.reportError(void 0,n,n._errorEvent,o),Promise.reject(r)}),this._errorEvent=new ge}Object.defineProperties(lA.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});lA.prototype.requestTileGeometry=function(e,t,n,i){let r=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),o=this._hasAvailability,s=Promise.resolve(!0),a;if(o&&!l(JH(this,n+1,e*2,t*2))){let d=tZ(this,n+1,e*2,t*2);s=d.promise,a=d.request}let c=r.fetchArrayBuffer();if(!l(c)||!l(s))return;let u=this,f=this._tilesAvailable;return Promise.all([c,s]).then(function(d){return new Fa({buffer:d[0],width:u._width,height:u._height,childTileMask:o?f.computeChildMaskForTile(n,e,t):pve,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(function(d){return l(a)&&a.state===mi.CANCELLED?(i.cancel(),i.deferred.promise.finally(function(){return i.state=mi.CANCELLED,Promise.reject(d)})):Promise.reject(d)})};function JH(e,t,n,i){if(!e._hasAvailability)return;let r=e._tilesAvailablityLoaded,o=e._tilesAvailable;if(t>e._lodCount)return!1;if(o.isTileAvailable(t,n,i))return!0;if(r.isTileAvailable(t,n,i))return!1}lA.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};lA.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=JH(this,n,e,t);if(l(i))return i;tZ(this,n,e,t)};lA.prototype.loadTileDataAvailability=function(e,t,n){};function _ve(e,t,n,i){let r=t-1,o=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},u=new W(e.x+1,e.y+1),f=!1,d=!1;for(;!(f&&d);){let p=u.x,g=d?u.y+1:u.y;if(!f){for(let m=e.y;m<g;++m)if(i[m*t+u.x]!==s){f=!0;break}f?(a.push(new W(u.x,e.y)),--u.x,--p,c.endX=u.x):u.x===r?(c.endX=u.x,f=!0):++u.x}if(!d){let m=u.y*t;for(let x=e.x;x<=p;++x)if(i[m+x]!==s){d=!0;break}d?(a.push(new W(e.x,u.y)),--u.y,c.endY=u.y):u.y===o?(c.endY=u.y,d=!0):++u.y}}return{endingIndices:a,range:c,value:s}}function gve(e,t,n,i,r){let o=[];if(r.every(function(c){return c===r[0]}))return r[0]===1&&o.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),o;let a=[new W(0,0)];for(;a.length>0;){let c=a.pop(),u=_ve(c,n,i,r);if(u.value===1){let d=u.range;d.startX+=e,d.endX+=e,d.startY+=t,d.endY+=t,o.push(d)}let f=u.endingIndices;f.length>0&&(a=a.concat(f))}return o}function tZ(e,t,n,i){if(!e._hasAvailability)return{};let r=Math.floor(n/128)*128,o=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${o}/${r}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let u=new oo({throttle:!1,throttleByServer:!0,type:ro.TERRAIN}),d=e._resource.getDerivedResource({url:a,request:u}).fetchJson();return l(d)?(d=d.then(function(p){let g=gve(r,o,s,s,p.data);e._tilesAvailablityLoaded.addAvailableTileRange(t,r,o,r+s,o+s);let m=e._tilesAvailable;for(let x=0;x<g.length;++x){let C=g[x];m.addAvailableTileRange(t,C.startX,C.startY,C.endX,C.endY)}return JH(e,t,n,i)}),c[a]={promise:d,request:u},d=d.finally(function(p){return delete c[a],p}),{promise:d,request:u}):{}}var nZ=lA;var yve={NONE:0,GEODESIC:1,RHUMB:2},Kt=Object.freeze(yve);var iZ=M.EPSILON10;function xve(e,t,n,i){if(!l(e))return;n=y(n,!1);let r=l(i),o=e.length;if(o<2)return e;let s,a=e[0],c,u,f=0,d=-1;for(s=1;s<o;++s)c=e[s],t(a,c,iZ)?(l(u)||(u=e.slice(0,s),f=s-1,d=0),r&&i.push(s)):(l(u)&&(u.push(c),f=s,r&&(d=i.length)),a=c);return n&&t(e[0],e[o-1],iZ)&&(r&&(l(u)?i.splice(d,0,f):i.push(o-1)),l(u)?u.length-=1:u=e.slice(0,-1)),l(u)?u:e}var vr=xve;var Cve={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},_c=Object.freeze(Cve);function py(){this._array=[],this._hash={}}Object.defineProperties(py.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});py.prototype.contains=function(e){return l(this._hash[e])};py.prototype.set=function(e,t){let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};py.prototype.get=function(e){return this._hash[e]};py.prototype.remove=function(e){let t=this._hash[e],n=l(t);if(n){let i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n};py.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var xt=py;var rZ=new h,oZ=new h,sZ=new h;function Ave(e,t,n,i,r){l(r)||(r=new h);let o,s,a,c,u,f,d,p;if(l(t.z)){if(h.equalsEpsilon(e,t,M.EPSILON14))return h.clone(h.UNIT_X,r);if(h.equalsEpsilon(e,n,M.EPSILON14))return h.clone(h.UNIT_Y,r);if(h.equalsEpsilon(e,i,M.EPSILON14))return h.clone(h.UNIT_Z,r);o=h.subtract(n,t,rZ),s=h.subtract(i,t,oZ),a=h.subtract(e,t,sZ),c=h.dot(o,o),u=h.dot(o,s),f=h.dot(o,a),d=h.dot(s,s),p=h.dot(s,a)}else{if(W.equalsEpsilon(e,t,M.EPSILON14))return h.clone(h.UNIT_X,r);if(W.equalsEpsilon(e,n,M.EPSILON14))return h.clone(h.UNIT_Y,r);if(W.equalsEpsilon(e,i,M.EPSILON14))return h.clone(h.UNIT_Z,r);o=W.subtract(n,t,rZ),s=W.subtract(i,t,oZ),a=W.subtract(e,t,sZ),c=W.dot(o,o),u=W.dot(o,s),f=W.dot(o,a),d=W.dot(s,s),p=W.dot(s,a)}r.y=d*f-u*p,r.z=c*p-u*f;let g=c*d-u*u;if(g!==0)return r.y/=g,r.z/=g,r.x=1-r.y-r.z,r}var uA=Ave;var aZ="https://dev.virtualearth.net/REST/v1/Locations";function QH(e){e=y(e,y.EMPTY_OBJECT);let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new De({url:aZ,queryParameters:n})}Object.defineProperties(QH.prototype,{url:{get:function(){return aZ}},key:{get:function(){return this._key}}});QH.prototype.geocode=function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(r){let o=r.bbox,s=o[0],a=o[1],c=o[2],u=o[3];return{displayName:r.name,destination:he.fromDegrees(a,s,u,c)}})})};var cZ=QH;function Ro(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.width=y(n,0),this.height=y(i,0)}Ro.packedLength=4;Ro.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};Ro.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ro),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};Ro.fromPoints=function(e,t){if(l(t)||(t=new Ro),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,r=e[0].y,o=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],u=c.x,f=c.y;i=Math.min(u,i),o=Math.max(u,o),r=Math.min(f,r),s=Math.max(f,s)}return t.x=i,t.y=r,t.width=o-i,t.height=s-r,t};var Tve=new Ii,bve=new me,Eve=new me;Ro.fromRectangle=function(e,t,n){if(l(n)||(n=new Ro),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;t=y(t,Tve);let i=t.project(he.southwest(e,bve)),r=t.project(he.northeast(e,Eve));return W.subtract(r,i,r),n.x=i.x,n.y=i.y,n.width=r.x,n.height=r.y,n};Ro.clone=function(e,t){if(!!l(e))return l(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new Ro(e.x,e.y,e.width,e.height)};Ro.union=function(e,t,n){l(n)||(n=new Ro);let i=Math.min(e.x,t.x),r=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=r,n.width=o-i,n.height=s-r,n};Ro.expand=function(e,t,n){n=Ro.clone(e,n);let i=t.x-n.x,r=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),r>n.height?n.height=r:r<0&&(n.height-=r,n.y=t.y),n};Ro.intersect=function(e,t){let n=e.x,i=e.y,r=t.x,o=t.y;return n>r+t.width||n+e.width<r||i+e.height<o||i>o+t.height?Jt.OUTSIDE:Jt.INTERSECTING};Ro.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};Ro.prototype.clone=function(e){return Ro.clone(this,e)};Ro.prototype.intersect=function(e){return Ro.intersect(this,e)};Ro.prototype.equals=function(e){return Ro.equals(this,e)};var je=Ro;var Sve={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},$f=Object.freeze(Sve);var ua={POINTS:Z.POINTS,LINES:Z.LINES,LINE_LOOP:Z.LINE_LOOP,LINE_STRIP:Z.LINE_STRIP,TRIANGLES:Z.TRIANGLES,TRIANGLE_STRIP:Z.TRIANGLE_STRIP,TRIANGLE_FAN:Z.TRIANGLE_FAN};ua.isLines=function(e){return e===ua.LINES||e===ua.LINE_LOOP||e===ua.LINE_STRIP};ua.isTriangles=function(e){return e===ua.TRIANGLES||e===ua.TRIANGLE_STRIP||e===ua.TRIANGLE_FAN};ua.validate=function(e){return e===ua.POINTS||e===ua.LINES||e===ua.LINE_LOOP||e===ua.LINE_STRIP||e===ua.TRIANGLES||e===ua.TRIANGLE_STRIP||e===ua.TRIANGLE_FAN};var Me=Object.freeze(ua);function e5(e){e=y(e,y.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=y(e.primitiveType,Me.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=y(e.geometryType,$f.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}e5.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var wve=new me,vve=new h,lZ=new N,Dve=[new me,new me,new me],Pve=[new W,new W,new W],Ive=[new W,new W,new W],Ove=new h,Rve=new Re,Mve=new N,Bve=new Ri;e5._textureCoordinateRotationPoints=function(e,t,n,i){let r,o=he.center(i,wve),s=me.toCartesian(o,n,vve),a=yt.eastNorthUpToFixedFrame(s,n,lZ),c=N.inverse(a,lZ),u=Pve,f=Dve;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let d=Ove;for(r=0;r<3;r++)me.toCartesian(f[r],n,d),d=N.multiplyByPointAsVector(c,d,d),u[r].x=d.x,u[r].y=d.y;let p=Re.fromAxisAngle(h.UNIT_Z,-t,Rve),g=Q.fromQuaternion(p,Mve),m=e.length,x=Number.POSITIVE_INFINITY,C=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,b=Number.NEGATIVE_INFINITY;for(r=0;r<m;r++)d=N.multiplyByPointAsVector(c,e[r],d),d=Q.multiplyByVector(g,d,d),x=Math.min(x,d.x),C=Math.min(C,d.y),A=Math.max(A,d.x),b=Math.max(b,d.y);let T=Ri.fromRotation(t,Bve),S=Ive;S[0].x=x,S[0].y=C,S[1].x=x,S[1].y=b,S[2].x=A,S[2].y=C;let w=u[0],D=u[2].x-w.x,I=u[1].y-w.y;for(r=0;r<3;r++){let E=S[r];Ri.multiplyByVector(T,E,E),E.x=(E.x-w.x)/D,E.y=(E.y-w.y)/I}let O=S[0],B=S[1],L=S[2],_=new Array(6);return W.pack(O,_),W.pack(B,_,2),W.pack(L,_,4),_};var ot=e5;function Lve(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.values=e.values}var Ee=Lve;function Nve(e){e=y(e,y.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}var dn=Nve;var Fve={NONE:0,TOP:1,ALL:2},nn=Object.freeze(Fve);function rs(e){e=y(e,y.EMPTY_OBJECT),this.position=y(e.position,!1),this.normal=y(e.normal,!1),this.st=y(e.st,!1),this.bitangent=y(e.bitangent,!1),this.tangent=y(e.tangent,!1),this.color=y(e.color,!1)}rs.POSITION_ONLY=Object.freeze(new rs({position:!0}));rs.POSITION_AND_NORMAL=Object.freeze(new rs({position:!0,normal:!0}));rs.POSITION_NORMAL_AND_ST=Object.freeze(new rs({position:!0,normal:!0,st:!0}));rs.POSITION_AND_ST=Object.freeze(new rs({position:!0,st:!0}));rs.POSITION_AND_COLOR=Object.freeze(new rs({position:!0,color:!0}));rs.ALL=Object.freeze(new rs({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));rs.DEFAULT=rs.POSITION_NORMAL_AND_ST;rs.packedLength=6;rs.pack=function(e,t,n){return n=y(n,0),t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t};rs.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new rs),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n};rs.clone=function(e,t){if(!!l(e))return l(t)||(t=new rs),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var Pe=rs;var Vve=new h;function Fl(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum,i=y(e.vertexFormat,Pe.DEFAULT);this._minimum=h.clone(t),this._maximum=h.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}Fl.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new Fl({minimum:h.negate(n,new h),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};Fl.fromAxisAlignedBoundingBox=function(e){return new Fl({minimum:e.minimum,maximum:e.maximum})};Fl.packedLength=2*h.packedLength+Pe.packedLength+1;Fl.pack=function(e,t,n){return n=y(n,0),h.pack(e._minimum,t,n),h.pack(e._maximum,t,n+h.packedLength),Pe.pack(e._vertexFormat,t,n+2*h.packedLength),t[n+2*h.packedLength+Pe.packedLength]=y(e._offsetAttribute,-1),t};var fZ=new h,dZ=new h,hZ=new Pe,uZ={minimum:fZ,maximum:dZ,vertexFormat:hZ,offsetAttribute:void 0};Fl.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,fZ),r=h.unpack(e,t+h.packedLength,dZ),o=Pe.unpack(e,t+2*h.packedLength,hZ),s=e[t+2*h.packedLength+Pe.packedLength];return l(n)?(n._minimum=h.clone(i,n._minimum),n._maximum=h.clone(r,n._maximum),n._vertexFormat=Pe.clone(o,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(uZ.offsetAttribute=s===-1?void 0:s,new Fl(uZ))};Fl.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(h.equals(t,n))return;let r=new dn,o,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(6*4*3),s[0]=t.x,s[1]=t.y,s[2]=n.z,s[3]=n.x,s[4]=t.y,s[5]=n.z,s[6]=n.x,s[7]=n.y,s[8]=n.z,s[9]=t.x,s[10]=n.y,s[11]=n.z,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=n.x,s[16]=t.y,s[17]=t.z,s[18]=n.x,s[19]=n.y,s[20]=t.z,s[21]=t.x,s[22]=n.y,s[23]=t.z,s[24]=n.x,s[25]=t.y,s[26]=t.z,s[27]=n.x,s[28]=n.y,s[29]=t.z,s[30]=n.x,s[31]=n.y,s[32]=n.z,s[33]=n.x,s[34]=t.y,s[35]=n.z,s[36]=t.x,s[37]=t.y,s[38]=t.z,s[39]=t.x,s[40]=n.y,s[41]=t.z,s[42]=t.x,s[43]=n.y,s[44]=n.z,s[45]=t.x,s[46]=t.y,s[47]=n.z,s[48]=t.x,s[49]=n.y,s[50]=t.z,s[51]=n.x,s[52]=n.y,s[53]=t.z,s[54]=n.x,s[55]=n.y,s[56]=n.z,s[57]=t.x,s[58]=n.y,s[59]=n.z,s[60]=t.x,s[61]=t.y,s[62]=t.z,s[63]=n.x,s[64]=t.y,s[65]=t.z,s[66]=n.x,s[67]=t.y,s[68]=n.z,s[69]=t.x,s[70]=t.y,s[71]=n.z,r.position=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,r.normal=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,r.st=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,r.tangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,r.bitangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:u})}o=new Uint16Array(6*2*3),o[0]=0,o[1]=1,o[2]=2,o[3]=0,o[4]=2,o[5]=3,o[6]=4+2,o[7]=4+1,o[8]=4+0,o[9]=4+3,o[10]=4+2,o[11]=4+0,o[12]=8+0,o[13]=8+1,o[14]=8+2,o[15]=8+0,o[16]=8+2,o[17]=8+3,o[18]=12+2,o[19]=12+1,o[20]=12+0,o[21]=12+3,o[22]=12+2,o[23]=12+0,o[24]=16+2,o[25]=16+1,o[26]=16+0,o[27]=16+3,o[28]=16+2,o[29]=16+0,o[30]=20+0,o[31]=20+1,o[32]=20+2,o[33]=20+0,o[34]=20+2,o[35]=20+3}else s=new Float64Array(8*3),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=n.x,s[4]=t.y,s[5]=t.z,s[6]=n.x,s[7]=n.y,s[8]=t.z,s[9]=t.x,s[10]=n.y,s[11]=t.z,s[12]=t.x,s[13]=t.y,s[14]=n.z,s[15]=n.x,s[16]=t.y,s[17]=n.z,s[18]=n.x,s[19]=n.y,s[20]=n.z,s[21]=t.x,s[22]=n.y,s[23]=n.z,r.position=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:s}),o=new Uint16Array(6*2*3),o[0]=4,o[1]=5,o[2]=6,o[3]=4,o[4]=6,o[5]=7,o[6]=1,o[7]=0,o[8]=3,o[9]=1,o[10]=3,o[11]=2,o[12]=1,o[13]=6,o[14]=5,o[15]=1,o[16]=2,o[17]=6,o[18]=2,o[19]=3,o[20]=7,o[21]=2,o[22]=7,o[23]=6,o[24]=3,o[25]=0,o[26]=4,o[27]=3,o[28]=4,o[29]=7,o[30]=0,o[31]=1,o[32]=5,o[33]=0,o[34]=5,o[35]=4;let a=h.subtract(n,t,Vve),c=h.magnitude(a)*.5;if(l(e._offsetAttribute)){let u=s.length,f=e._offsetAttribute===nn.NONE?0:1,d=new Uint8Array(u/3).fill(f);r.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new ot({attributes:r,indices:o,primitiveType:Me.TRIANGLES,boundingSphere:new re(h.ZERO,c),offsetAttribute:e._offsetAttribute})};var t5;Fl.getUnitBox=function(){return l(t5)||(t5=Fl.createGeometry(Fl.fromDimensions({dimensions:new h(1,1,1),vertexFormat:Pe.POSITION_ONLY}))),t5};var Vl=Fl;var kve=new h;function xh(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum;this._min=h.clone(t),this._max=h.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}xh.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new xh({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};xh.fromAxisAlignedBoundingBox=function(e){return new xh({minimum:e.minimum,maximum:e.maximum})};xh.packedLength=2*h.packedLength+1;xh.pack=function(e,t,n){return n=y(n,0),h.pack(e._min,t,n),h.pack(e._max,t,n+h.packedLength),t[n+h.packedLength*2]=y(e._offsetAttribute,-1),t};var pZ=new h,_Z=new h,mZ={minimum:pZ,maximum:_Z,offsetAttribute:void 0};xh.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,pZ),r=h.unpack(e,t+h.packedLength,_Z),o=e[t+h.packedLength*2];return l(n)?(n._min=h.clone(i,n._min),n._max=h.clone(r,n._max),n._offsetAttribute=o===-1?void 0:o,n):(mZ.offsetAttribute=o===-1?void 0:o,new xh(mZ))};xh.createGeometry=function(e){let t=e._min,n=e._max;if(h.equals(t,n))return;let i=new dn,r=new Uint16Array(12*2),o=new Float64Array(8*3);o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=n.x,o[4]=t.y,o[5]=t.z,o[6]=n.x,o[7]=n.y,o[8]=t.z,o[9]=t.x,o[10]=n.y,o[11]=t.z,o[12]=t.x,o[13]=t.y,o[14]=n.z,o[15]=n.x,o[16]=t.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=t.x,o[22]=n.y,o[23]=n.z,i.position=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:o}),r[0]=4,r[1]=5,r[2]=5,r[3]=6,r[4]=6,r[5]=7,r[6]=7,r[7]=4,r[8]=0,r[9]=1,r[10]=1,r[11]=2,r[12]=2,r[13]=3,r[14]=3,r[15]=0,r[16]=0,r[17]=4,r[18]=1,r[19]=5,r[20]=2,r[21]=6,r[22]=3,r[23]=7;let s=h.subtract(n,t,kve),a=h.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=o.length,u=e._offsetAttribute===nn.NONE?0:1,f=new Uint8Array(c/3).fill(u);i.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new ot({attributes:i,indices:r,primitiveType:Me.LINES,boundingSphere:new re(h.ZERO,a),offsetAttribute:e._offsetAttribute})};var Ch=xh;var Wm;typeof cancelAnimationFrame<"u"&&(Wm=cancelAnimationFrame);(function(){if(!l(Wm)&&typeof window<"u"){let e=["webkit","moz","ms","o"],t=0,n=e.length;for(;t<n&&!l(Wm);)Wm=window[`${e[t]}CancelAnimationFrame`],l(Wm)||(Wm=window[`${e[t]}CancelRequestAnimationFrame`]),++t}l(Wm)||(Wm=clearTimeout)})();function Uve(e){di("Cesium.cancelAnimationFrame","Cesium.cancelAnimationFrame was deprecated in CesiumJS 1.96 and will be removed in 1.99. Use the native cancelAnimationFrame method instead."),Wm(e)}var gZ=Uve;function yZ(){}yZ.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],r=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let o=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(o);o.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(r)){let o={displayName:e,destination:h.fromDegrees(n,i,r)};return Promise.resolve([o])}}return Promise.resolve([])};var hI=yZ;function fA(){this.times=void 0,this.points=void 0,ye.throwInstantiationError()}fA.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof Re)return Re};fA.prototype.evaluate=ye.throwInstantiationError;fA.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=y(t,0),e>=n[t]){if(t+1<i&&e<n[t+1])return t;if(t+2<i&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let r;if(e>n[t])for(r=t;r<i-1&&!(e>=n[r]&&e<n[r+1]);++r);else for(r=t-1;r>=0&&!(e>=n[r]&&e<n[r+1]);--r);return r===i-1&&(r=i-2),r};fA.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],r=n-i,o;return e<i&&(o=Math.floor((i-e)/r)+1,e+=o*r),e>n&&(o=Math.floor((e-n)/r)+1,e-=o*r),e};fA.prototype.clampTime=function(e){let t=this.times;return M.clamp(e,t[0],t[t.length-1])};var qi=fA;function dA(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=qi.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(dA.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});dA.prototype.findTimeInterval=qi.prototype.findTimeInterval;dA.prototype.wrapTime=qi.prototype.wrapTime;dA.prototype.clampTime=qi.prototype.clampTime;dA.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);return this._pointType===Number?(1-o)*n[r]+o*n[r+1]:(l(t)||(t=new h),h.lerp(n[r],n[r+1],o,t))};var jm=dA;var xZ={};xZ.solve=function(e,t,n,i){let r=new Array(n.length),o=new Array(i.length),s=new Array(i.length),a;for(a=0;a<o.length;a++)o[a]=new h,s[a]=new h;r[0]=n[0]/t[0],o[0]=h.multiplyByScalar(i[0],1/t[0],o[0]);let c;for(a=1;a<r.length;++a)c=1/(t[a]-r[a-1]*e[a-1]),r[a]=n[a]*c,o[a]=h.subtract(i[a],h.multiplyByScalar(o[a-1],e[a-1],o[a]),o[a]),o[a]=h.multiplyByScalar(o[a],c,o[a]);for(c=1/(t[a]-r[a-1]*e[a-1]),o[a]=h.subtract(i[a],h.multiplyByScalar(o[a-1],e[a-1],o[a]),o[a]),o[a]=h.multiplyByScalar(o[a],c,o[a]),s[s.length-1]=o[o.length-1],a=s.length-2;a>=0;--a)s[a]=h.subtract(o[a],h.multiplyByScalar(s[a+1],r[a],s[a]),s[a]);return s};var bS=xZ;var CZ=[],AZ=[],TZ=[],bZ=[];function zve(e,t,n){let i=CZ,r=TZ,o=AZ,s=bZ;i.length=r.length=e.length-1,o.length=s.length=e.length;let a;i[0]=o[0]=1,r[0]=0;let c=s[0];for(l(c)||(c=s[0]=new h),h.clone(t,c),a=1;a<i.length-1;++a)i[a]=r[a]=1,o[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c);return i[a]=0,r[a]=1,o[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c),o[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new h),h.clone(n,c),bS.solve(i,o,r,s)}function Hve(e){let t=CZ,n=TZ,i=AZ,r=bZ;t.length=n.length=e.length-1,i.length=r.length=e.length;let o;t[0]=n[0]=1,i[0]=2;let s=r[0];for(l(s)||(s=r[0]=new h),h.subtract(e[1],e[0],s),h.multiplyByScalar(s,3,s),o=1;o<t.length;++o)t[o]=n[o]=1,i[o]=4,s=r[o],l(s)||(s=r[o]=new h),h.subtract(e[o+1],e[o-1],s),h.multiplyByScalar(s,3,s);return i[o]=2,s=r[o],l(s)||(s=r[o]=new h),h.subtract(e[o],e[o-1],s),h.multiplyByScalar(s,3,s),bS.solve(t,i,n,r)}function nl(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.inTangents,r=e.outTangents;this._times=n,this._points=t,this._pointType=qi.getPointType(t[0]),this._inTangents=i,this._outTangents=r,this._lastTimeIndex=0}Object.defineProperties(nl.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}});nl.createC1=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.tangents,r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new nl({times:t,points:n,inTangents:o,outTangents:r})};nl.createNaturalCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points;if(n.length<3)return new jm({points:n,times:t});let i=Hve(n),r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new nl({times:t,points:n,inTangents:o,outTangents:r})};nl.createClampedCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.firstTangent,r=e.lastTangent,o=qi.getPointType(n[0]);if(n.length<3)return new jm({points:n,times:t});let s=zve(n,i,r),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new nl({times:t,points:n,inTangents:c,outTangents:a})};nl.hermiteCoefficientMatrix=new N(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);nl.prototype.findTimeInterval=qi.prototype.findTimeInterval;var Gve=new se,hA=new h;nl.prototype.wrapTime=qi.prototype.wrapTime;nl.prototype.clampTime=qi.prototype.clampTime;nl.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this.inTangents,o=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,u=Gve;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=N.multiplyByVector(nl.hermiteCoefficientMatrix,u,u);f.z*=a,f.w*=a;let d=this._pointType;return d===Number?n[s]*f.x+n[s+1]*f.y+o[s]*f.z+r[s]*f.w:(l(t)||(t=new d),t=d.multiplyByScalar(n[s],f.x,t),d.multiplyByScalar(n[s+1],f.y,hA),d.add(t,hA,t),d.multiplyByScalar(o[s],f.z,hA),d.add(t,hA,t),d.multiplyByScalar(r[s],f.w,hA),d.add(t,hA,t))};var _y=nl;var Wve=new se,EZ=new h,mA=new h;function jve(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],r=1/(n[1]-i),o=t[0],s=t[1];return function(a,c){l(c)||(c=new h);let u=(a-i)*r;return h.lerp(o,s,u,c)}}return function(i,r){l(r)||(r=new h);let o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[o])/(n[o+1]-n[o]),a=Wve;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,u,f,d,p;return o===0?(c=t[0],u=t[1],f=e.firstTangent,d=h.subtract(t[2],c,EZ),h.multiplyByScalar(d,.5,d),p=N.multiplyByVector(_y.hermiteCoefficientMatrix,a,a)):o===t.length-2?(c=t[o],u=t[o+1],d=e.lastTangent,f=h.subtract(u,t[o-1],EZ),h.multiplyByScalar(f,.5,f),p=N.multiplyByVector(_y.hermiteCoefficientMatrix,a,a)):(c=t[o-1],u=t[o],f=t[o+1],d=t[o+2],p=N.multiplyByVector(D_.catmullRomCoefficientMatrix,a,a)),r=h.multiplyByScalar(c,p.x,r),h.multiplyByScalar(u,p.y,mA),h.add(r,mA,r),h.multiplyByScalar(f,p.z,mA),h.add(r,mA,r),h.multiplyByScalar(d,p.w,mA),h.add(r,mA,r)}}var qve=new h,Yve=new h;function D_(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.firstTangent,r=e.lastTangent;if(t.length>2&&(l(i)||(i=qve,h.multiplyByScalar(t[1],2,i),h.subtract(i,t[2],i),h.subtract(i,t[0],i),h.multiplyByScalar(i,.5,i)),!l(r))){let o=t.length-1;r=Yve,h.multiplyByScalar(t[o-1],2,r),h.subtract(t[o],r,r),h.add(r,t[o-2],r),h.multiplyByScalar(r,.5,r)}this._times=n,this._points=t,this._firstTangent=h.clone(i),this._lastTangent=h.clone(r),this._evaluateFunction=jve(this),this._lastTimeIndex=0}Object.defineProperties(D_.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});D_.catmullRomCoefficientMatrix=new N(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);D_.prototype.findTimeInterval=qi.prototype.findTimeInterval;D_.prototype.wrapTime=qi.prototype.wrapTime;D_.prototype.clampTime=qi.prototype.clampTime;D_.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var SZ=D_;function P_(e,t,n){return t=y(t,0),n=y(n,e.byteLength-t),e=e.subarray(t,t+n),P_.decode(e)}P_.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};P_.decodeWithFromCharCode=function(e){let t="",n=Xve(e),i=n.length;for(let r=0;r<i;++r){let o=n[r];o<=65535?t+=String.fromCharCode(o):(o-=65536,t+=String.fromCharCode((o>>10)+55296,(o&1023)+56320))}return t};function ES(e,t,n){return t<=e&&e<=n}function Xve(e){let t=0,n=0,i=0,r=128,o=191,s=[],a=e.length;for(let c=0;c<a;++c){let u=e[c];if(i===0){if(ES(u,0,127)){s.push(u);continue}if(ES(u,194,223)){i=1,t=u&31;continue}if(ES(u,224,239)){u===224&&(r=160),u===237&&(o=159),i=2,t=u&15;continue}if(ES(u,240,244)){u===240&&(r=144),u===244&&(o=143),i=3,t=u&7;continue}throw new fe("String decoding failed.")}if(!ES(u,r,o)){t=i=n=0,r=128,o=191,--c;continue}r=128,o=191,t=t<<6|u&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?P_.decode=P_.decodeWithTextDecoder:P_.decode=P_.decodeWithFromCharCode;var fa=P_;function Kve(e,t,n){return JSON.parse(fa(e,t,n))}var Vr=Kve;var mI={};mI.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,r,o){l(o)?o.length=0:o=[];let s,a,c;t?(s=n<e,a=i<e,c=r<e):(s=n>e,a=i>e,c=r>e);let u=s+a+c,f,d,p,g,m,x;return u===1?s?(f=(e-n)/(i-n),d=(e-n)/(r-n),o.push(1),o.push(2),d!==1&&(o.push(-1),o.push(0),o.push(2),o.push(d)),f!==1&&(o.push(-1),o.push(0),o.push(1),o.push(f))):a?(p=(e-i)/(r-i),g=(e-i)/(n-i),o.push(2),o.push(0),g!==1&&(o.push(-1),o.push(1),o.push(0),o.push(g)),p!==1&&(o.push(-1),o.push(1),o.push(2),o.push(p))):c&&(m=(e-r)/(n-r),x=(e-r)/(i-r),o.push(0),o.push(1),x!==1&&(o.push(-1),o.push(2),o.push(1),o.push(x)),m!==1&&(o.push(-1),o.push(2),o.push(0),o.push(m))):u===2?!s&&n!==e?(g=(e-i)/(n-i),m=(e-r)/(n-r),o.push(0),o.push(-1),o.push(1),o.push(0),o.push(g),o.push(-1),o.push(2),o.push(0),o.push(m)):!a&&i!==e?(x=(e-r)/(i-r),f=(e-n)/(i-n),o.push(1),o.push(-1),o.push(2),o.push(1),o.push(x),o.push(-1),o.push(0),o.push(1),o.push(f)):!c&&r!==e&&(d=(e-n)/(r-n),p=(e-i)/(r-i),o.push(2),o.push(-1),o.push(0),o.push(2),o.push(d),o.push(-1),o.push(1),o.push(2),o.push(p)):u!==3&&(o.push(0),o.push(1),o.push(2)),o};mI.computeBarycentricCoordinates=function(e,t,n,i,r,o,s,a,c){let u=n-s,f=s-r,d=o-a,p=i-a,g=1/(d*u+f*p),m=t-a,x=e-s,C=(d*x+f*m)*g,A=(-p*x+u*m)*g,b=1-C-A;return l(c)?(c.x=C,c.y=A,c.z=b,c):new h(C,A,b)};mI.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,r,o,s,a,c){let u=(s-r)*(t-o)-(a-o)*(e-r),f=(n-e)*(t-o)-(i-t)*(e-r),d=(a-o)*(n-e)-(s-r)*(i-t);if(d===0)return;let p=u/d,g=f/d;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new W),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var I_=mI;function O_(e){this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function r(s,a){return i[s]-i[a]}function o(s,a){return n[s]-n[a]}this._westIndices=_I(e.westIndices,r,t),this._southIndices=_I(e.southIndices,o,t),this._eastIndices=_I(e.eastIndices,r,t),this._northIndices=_I(e.northIndices,o,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=y(e.childTileMask,15),this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(O_.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var pI=[];function _I(e,t,n){pI.length=e.length;let i=!1;for(let r=0,o=e.length;r<o;++r)pI[r]=e[r],i=i||r>0&&t(e[r-1],e[r])>0;return i?(pI.sort(t),Le.createTypedArray(n,pI)):e}var wZ="createVerticesFromQuantizedTerrainMesh",$ve=new Mi(wZ),Zve=new Mi(wZ,gh.maximumAsynchronousTasks);O_.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,u=t.tileXYToRectangle(n,i,r),d=(a?Zve:$ve).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:o,exaggerationRelativeHeight:s});if(!l(d))return;let p=this;return Promise.resolve(d).then(function(g){let m=p._quantizedVertices.length/3,x=m+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,C=Le.createTypedArray(x,g.indices),A=new Float32Array(g.vertices),b=g.center,T=g.minimumHeight,S=g.maximumHeight,w=p._boundingSphere,D=p._orientedBoundingBox,I=y(h.clone(g.occludeePointInScaledSpace),p._horizonOcclusionPoint),O=g.vertexStride,B=mc.clone(g.encoding);return p._mesh=new Kf(b,A,C,g.indexCountWithoutSkirts,m,T,S,w,I,O,D,B,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var Jve=new Mi("upsampleQuantizedTerrainMesh",gh.maximumAsynchronousTasks);O_.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==r,u=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,s),p=Jve.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=Math.min(this._westSkirtHeight,this._eastSkirtHeight);g=Math.min(g,this._southSkirtHeight),g=Math.min(g,this._northSkirtHeight);let m=c?g*.5:this._westSkirtHeight,x=u?g*.5:this._southSkirtHeight,C=c?this._eastSkirtHeight:g*.5,A=u?this._northSkirtHeight:g*.5,b=this._credits;return Promise.resolve(p).then(function(T){let S=new Uint16Array(T.vertices),w=Le.createTypedArray(S.length/3,T.indices),D;return l(T.encodedNormals)&&(D=new Uint8Array(T.encodedNormals)),new O_({quantizedVertices:S,indices:w,encodedNormals:D,minimumHeight:T.minimumHeight,maximumHeight:T.maximumHeight,boundingSphere:re.clone(T.boundingSphere),orientedBoundingBox:Ai.clone(T.orientedBoundingBox),horizonOcclusionPoint:h.clone(T.horizonOcclusionPoint),westIndices:T.westIndices,southIndices:T.southIndices,eastIndices:T.eastIndices,northIndices:T.northIndices,westSkirtHeight:m,southSkirtHeight:x,eastSkirtHeight:C,northSkirtHeight:A,childTileMask:0,credits:b,createdByUpsampling:!0})})};var n5=32767,vZ=new h;O_.prototype.interpolateHeight=function(e,t,n){let i=M.clamp((t-e.west)/e.width,0,1);i*=n5;let r=M.clamp((n-e.south)/e.height,0,1);return r*=n5,l(this._mesh)?nDe(this,i,r):iDe(this,i,r)};function DZ(e,t,n,i,r,o,s,a){let c=Math.min(n,r,s),u=Math.max(n,r,s),f=Math.min(i,o,a),d=Math.max(i,o,a);return e>=c&&e<=u&&t>=f&&t<=d}var Qve=new W,eDe=new W,tDe=new W;function nDe(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=o.decodeTextureCoordinates(r,u,Qve),g=o.decodeTextureCoordinates(r,f,eDe),m=o.decodeTextureCoordinates(r,d,tDe);if(DZ(t,n,p.x,p.y,g.x,g.y,m.x,m.y)){let x=I_.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,vZ);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let C=o.decodeHeight(r,u),A=o.decodeHeight(r,f),b=o.decodeHeight(r,d);return x.x*C+x.y*A+x.z*b}}}}function iDe(e,t,n){let i=e._uValues,r=e._vValues,o=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=i[u],g=i[f],m=i[d],x=r[u],C=r[f],A=r[d];if(DZ(t,n,p,x,g,C,m,A)){let b=I_.computeBarycentricCoordinates(t,n,p,x,g,C,m,A,vZ);if(b.x>=-1e-15&&b.y>=-1e-15&&b.z>=-1e-15){let T=b.x*o[u]+b.y*o[f]+b.z*o[d];return M.lerp(e._minimumHeight,e._maximumHeight,T/n5)}}}}O_.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};O_.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var pA=O_;function rDe(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function gy(e){this._heightmapWidth=65,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=y(e.requestVertexNormals,!1),this._requestWaterMask=y(e.requestWaterMask,!1),this._requestMetadata=y(e.requestMetadata,!0),this._errorEvent=new ge;let t=e.credit;typeof t=="string"&&(t=new Gt(t)),this._credit=t,this._availability=void 0,this._ready=!1,this._tileCredits=void 0;let n=this,i,r,o,s=this._layers=[],a="",c=[],u=0;this._readyPromise=Promise.resolve(e.url).then(function(x){let C=De.createIfNeeded(x);return C.appendForwardSlash(),i=C,r=i.getDerivedResource({url:"layer.json"}),n._tileCredits=C.credits,m()});function f(x){let C;if(!x.format)return C="The tile format is not specified in the layer.json file.",o=jn.reportError(o,n,n._errorEvent,C),o.retry?m():Promise.reject(new fe(C));if(!x.tiles||x.tiles.length===0)return C="The layer.json file does not specify any tile URL templates.",o=jn.reportError(o,n,n._errorEvent,C),o.retry?m():Promise.reject(new fe(C));let A=!1,b=!1,T=!1,S=!0,w=!1;if(x.format==="heightmap-1.0")w=!0,l(n._heightmapStructure)||(n._heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),b=!0,n._requestWaterMask=!0;else if(x.format.indexOf("quantized-mesh-1.")!==0)return C=`The tile format "${x.format}" is invalid or not supported.`,o=jn.reportError(o,n,n._errorEvent,C),o.retry?m():Promise.reject(new fe(C));let D=x.tiles,I=x.maxzoom;if(u=Math.max(u,I),!x.projection||x.projection==="EPSG:4326")n._tilingScheme=new Qi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:n._ellipsoid});else if(x.projection==="EPSG:3857")n._tilingScheme=new is({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:n._ellipsoid});else return C=`The projection "${x.projection}" is invalid or not supported.`,o=jn.reportError(o,n,n._errorEvent,C),o.retry?m():Promise.reject(new fe(C));if(n._levelZeroMaximumGeometricError=ns.getEstimatedLevelZeroGeometricErrorForAHeightmap(n._tilingScheme.ellipsoid,n._heightmapWidth,n._tilingScheme.getNumberOfXTilesAtLevel(0)),!x.scheme||x.scheme==="tms"||x.scheme==="slippyMap")n._scheme=x.scheme;else return C=`The scheme "${x.scheme}" is invalid or not supported.`,o=jn.reportError(o,n,n._errorEvent,C),o.retry?m():Promise.reject(new fe(C));let O;l(x.extensions)&&x.extensions.indexOf("octvertexnormals")!==-1?A=!0:l(x.extensions)&&x.extensions.indexOf("vertexnormals")!==-1&&(A=!0,S=!1),l(x.extensions)&&x.extensions.indexOf("watermask")!==-1&&(b=!0),l(x.extensions)&&x.extensions.indexOf("metadata")!==-1&&(T=!0);let B=x.metadataAvailability,L=x.available,_;if(l(L)&&!l(B)){_=new yh(n._tilingScheme,L.length);for(let v=0;v<L.length;++v){let P=L[v],R=n._tilingScheme.getNumberOfYTilesAtLevel(v);l(c[v])||(c[v]=[]);for(let F=0;F<P.length;++F){let U=P[F],k=R-U.endY-1,H=R-U.startY-1;c[v].push([U.startX,k,U.endX,H]),_.addAvailableTileRange(v,U.startX,k,U.endX,H)}}}else l(B)&&(O=new yh(n._tilingScheme,I),_=new yh(n._tilingScheme,I),c[0]=[[0,0,1,0]],_.addAvailableTileRange(0,0,0,1,0));n._hasWaterMask=n._hasWaterMask||b,n._hasVertexNormals=n._hasVertexNormals||A,n._hasMetadata=n._hasMetadata||T,l(x.attribution)&&(a.length>0&&(a+=" "),a+=x.attribution),s.push(new rDe({resource:i,version:x.version,isHeightmap:w,tileUrlTemplates:D,availability:_,hasVertexNormals:A,hasWaterMask:b,hasMetadata:T,availabilityLevels:B,availabilityTilesLoaded:O,littleEndianExtensionSize:S}));let E=x.parentUrl;if(l(E)){if(!l(_))return console.log("A layer.json can't have a parentUrl if it does't have an available array."),Promise.resolve(!0);i=i.getDerivedResource({url:E}),i.appendForwardSlash(),r=i.getDerivedResource({url:"layer.json"});let v=r.fetchJson();return Promise.resolve(v).then(f).catch(d)}return Promise.resolve(!0)}function d(x){let C=`An error occurred while accessing ${r.url}.`;return o=jn.reportError(o,n,n._errorEvent,C),o.retry?m():Promise.reject(new fe(C))}function p(x){return f(x).then(function(){if(l(o))return;let C=c.length;if(C>0){let A=n._availability=new yh(n._tilingScheme,u);for(let b=0;b<C;++b){let T=c[b];for(let S=0;S<T.length;++S){let w=T[S];A.addAvailableTileRange(b,w[0],w[1],w[2],w[3])}}}if(a.length>0){let A=new Gt(a);l(n._tileCredits)?n._tileCredits.push(A):n._tileCredits=[A]}return n._ready=!0,Promise.resolve(!0)})}function g(x){return l(x)&&x.statusCode===404?p({tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]}):d(x)}function m(){return Promise.resolve(r.fetchJson()).then(p).catch(g)}}var i5={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function PZ(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function oDe(e,t,n,i,r){let o=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Fa({buffer:o,childTileMask:new Uint8Array(t,o.byteLength,1)[0],waterMask:new Uint8Array(t,o.byteLength+1,t.byteLength-o.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function sDe(e,t,n,i,r,o){let s=o.littleEndianExtensionSize,a=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,d=Float64Array.BYTES_PER_ELEMENT*u,p=3,g=Uint16Array.BYTES_PER_ELEMENT*p,m=3,x=Uint16Array.BYTES_PER_ELEMENT,C=x*m,A=new DataView(t),b=new h(A.getFloat64(a,!0),A.getFloat64(a+8,!0),A.getFloat64(a+16,!0));a+=f;let T=A.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let S=A.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let w=new re(new h(A.getFloat64(a,!0),A.getFloat64(a+8,!0),A.getFloat64(a+16,!0)),A.getFloat64(a+f,!0));a+=d;let D=new h(A.getFloat64(a,!0),A.getFloat64(a+8,!0),A.getFloat64(a+16,!0));a+=f;let I=A.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let O=new Uint16Array(t,a,I*3);a+=I*g,I>64*1024&&(x=Uint32Array.BYTES_PER_ELEMENT,C=x*m);let B=O.subarray(0,I),L=O.subarray(I,2*I),_=O.subarray(I*2,3*I);In.zigZagDeltaDecode(B,L,_),a%x!==0&&(a+=x-a%x);let E=A.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let v=Le.createTypedArrayFromArrayBuffer(I,t,a,E*m);a+=E*C;let P=0,R=v.length;for(let ie=0;ie<R;++ie){let ae=v[ie];v[ie]=P-ae,ae===0&&++P}let F=A.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let U=Le.createTypedArrayFromArrayBuffer(I,t,a,F);a+=F*x;let k=A.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let H=Le.createTypedArrayFromArrayBuffer(I,t,a,k);a+=k*x;let V=A.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let q=Le.createTypedArrayFromArrayBuffer(I,t,a,V);a+=V*x;let j=A.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let X=Le.createTypedArrayFromArrayBuffer(I,t,a,j);a+=j*x;let G,$;for(;a<A.byteLength;){let ie=A.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let ae=A.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,ie===i5.OCT_VERTEX_NORMALS&&e._requestVertexNormals)G=new Uint8Array(t,a,I*2);else if(ie===i5.WATER_MASK&&e._requestWaterMask)$=new Uint8Array(t,a,ae);else if(ie===i5.METADATA&&e._requestMetadata){let _e=A.getUint32(a,!0);if(_e>0){let Te=Vr(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,_e).available;if(l(Te))for(let Oe=0;Oe<Te.length;++Oe){let Be=n+Oe+1,tt=Te[Oe],lt=e._tilingScheme.getNumberOfYTilesAtLevel(Be);for(let Pt=0;Pt<tt.length;++Pt){let ht=tt[Pt],wn=lt-ht.endY-1,ii=lt-ht.startY-1;e.availability.addAvailableTileRange(Be,ht.startX,wn,ht.endX,ii),o.availability.addAvailableTileRange(Be,ht.startX,wn,ht.endX,ii)}}}o.availabilityTilesLoaded.addAvailableTileRange(n,i,r,i,r)}a+=ae}let J=e.getLevelMaximumGeometricError(n)*5,ce=e._tilingScheme.tileXYToRectangle(i,r,n),de=Ai.fromRectangle(ce,T,S,e._tilingScheme.ellipsoid);return new pA({center:b,minimumHeight:T,maximumHeight:S,boundingSphere:w,orientedBoundingBox:de,horizonOcclusionPoint:D,quantizedVertices:O,encodedNormals:G,indices:v,westIndices:U,southIndices:H,eastIndices:q,northIndices:X,westSkirtHeight:J,southSkirtHeight:J,eastSkirtHeight:J,northSkirtHeight:J,childTileMask:e.availability.computeChildMaskForTile(n,i,r),waterMask:$,credits:e._tileCredits})}gy.prototype.requestTileGeometry=function(e,t,n,i){let r=this._layers,o,s=r.length;if(s===1)o=r[0];else for(let a=0;a<s;++a){let c=r[a];if(!l(c.availability)||c.availability.isTileAvailable(n,e,t)){o=c;break}}return IZ(this,e,t,n,o,i)};function IZ(e,t,n,i,r,o){if(!l(r))return Promise.reject(new fe("Terrain tile doesn't exist"));let s=r.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&r.hasVertexNormals&&c.push(r.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&r.hasWaterMask&&c.push("watermask"),e._requestMetadata&&r.hasMetadata&&c.push("metadata");let u,f,d=s[(t+a+i)%s.length],p=r.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),u=PZ(void 0)):u=PZ(c);let g=p.getDerivedResource({url:d,templateValues:{version:r.version,z:i,x:t,y:a},queryParameters:f,headers:u,request:o}).fetchArrayBuffer();if(!!l(g))return g.then(function(m){return l(m)?l(e._heightmapStructure)?oDe(e,m,i,t,n):sDe(e,m,i,t,n,r):Promise.reject(new fe("Mesh buffer doesn't exist."))})}Object.defineProperties(gy.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});gy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};gy.prototype.getTileDataAvailable=function(e,t,n){if(!l(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,r=i.length;for(let o=0;o<r;++o)if(OZ(this,e,t,n,i[o],o===0).result)return;return!1};gy.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,r=i.length;for(let o=0;o<r;++o){let s=OZ(this,e,t,n,i[o],o===0);if(l(s.promise))return s.promise}};function r5(e,t,n,i){if(i===0)return;let r=e.availabilityLevels,o=i%r===0?i-r:(i/r|0)*r,s=1<<i-o,a=t/s|0,c=n/s|0;return{level:o,x:a,y:c}}function OZ(e,t,n,i,r,o){if(!l(r.availabilityLevels))return{result:!1};let s,a=function(){delete r.availabilityPromiseCache[s]},c=r.availabilityTilesLoaded,u=r.availability,f=r5(r,t,n,i);for(;l(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!c.isTileAvailable(f.level,f.x,f.y)){let d;if(!o&&(s=`${f.level}-${f.x}-${f.y}`,d=r.availabilityPromiseCache[s],!l(d))){let p=new oo({throttle:!1,throttleByServer:!0,type:ro.TERRAIN});d=IZ(e,f.x,f.y,f.level,r,p),l(d)&&(r.availabilityPromiseCache[s]=d,d.then(a))}return{result:!0,promise:d}}f=r5(r,f.x,f.y,f.level)}return{result:!1}}gy._getAvailabilityTile=r5;var gI=gy;var s5={},yI=new h,RZ=new h,MZ=new Re,BZ=new Q;function _A(e,t,n,i,r,o,s,a,c,u){let f=e+t;h.multiplyByScalar(i,Math.cos(f),yI),h.multiplyByScalar(n,Math.sin(f),RZ),h.add(yI,RZ,yI);let d=Math.cos(e);d=d*d;let p=Math.sin(e);p=p*p;let m=o/Math.sqrt(s*d+r*p)/a;return Re.fromAxisAngle(yI,m,MZ),Q.fromQuaternion(MZ,BZ),Q.multiplyByVector(BZ,c,u),h.normalize(u,u),h.multiplyByScalar(u,a,u),u}var LZ=new h,NZ=new h,o5=new h,aDe=new h;s5.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,r=t.height,o=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,u=n?c:0;for(let f=0;f<c;f+=3){let d=f+1,p=f+2,g=h.fromArray(e,f,LZ);i.scaleToGeodeticSurface(g,g);let m=h.clone(g,NZ),x=i.geodeticSurfaceNormal(g,aDe),C=h.multiplyByScalar(x,r,o5);h.add(g,C,g),n&&(h.multiplyByScalar(x,o,C),h.add(m,C,m),a[f+u]=m.x,a[d+u]=m.y,a[p+u]=m.z),a[f]=g.x,a[d]=g.y,a[p]=g.z}return a};var cDe=new h,lDe=new h,uDe=new h;s5.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,r=e.semiMajorAxis,o=e.rotation,s=e.center,a=e.granularity*8,c=i*i,u=r*r,f=r*i,d=h.magnitude(s),p=h.normalize(s,cDe),g=h.cross(h.UNIT_Z,s,lDe);g=h.normalize(g,g);let m=h.cross(p,g,uDe),x=1+Math.ceil(M.PI_OVER_TWO/a),C=M.PI_OVER_TWO/(x-1),A=M.PI_OVER_TWO-x*C;A<0&&(x-=Math.ceil(Math.abs(A)/C));let b=2*(x*(x+2)),T=t?new Array(b*3):void 0,S=0,w=LZ,D=NZ,I=x*4*3,O=I-1,B=0,L=n?new Array(I):void 0,_,E,v,P,R;for(A=M.PI_OVER_TWO,w=_A(A,o,m,g,c,f,u,d,p,w),t&&(T[S++]=w.x,T[S++]=w.y,T[S++]=w.z),n&&(L[O--]=w.z,L[O--]=w.y,L[O--]=w.x),A=M.PI_OVER_TWO-C,_=1;_<x+1;++_){if(w=_A(A,o,m,g,c,f,u,d,p,w),D=_A(Math.PI-A,o,m,g,c,f,u,d,p,D),t){for(T[S++]=w.x,T[S++]=w.y,T[S++]=w.z,v=2*_+2,E=1;E<v-1;++E)P=E/(v-1),R=h.lerp(w,D,P,o5),T[S++]=R.x,T[S++]=R.y,T[S++]=R.z;T[S++]=D.x,T[S++]=D.y,T[S++]=D.z}n&&(L[O--]=w.z,L[O--]=w.y,L[O--]=w.x,L[B++]=D.x,L[B++]=D.y,L[B++]=D.z),A=M.PI_OVER_TWO-(_+1)*C}for(_=x;_>1;--_){if(A=M.PI_OVER_TWO-(_-1)*C,w=_A(-A,o,m,g,c,f,u,d,p,w),D=_A(A+Math.PI,o,m,g,c,f,u,d,p,D),t){for(T[S++]=w.x,T[S++]=w.y,T[S++]=w.z,v=2*(_-1)+2,E=1;E<v-1;++E)P=E/(v-1),R=h.lerp(w,D,P,o5),T[S++]=R.x,T[S++]=R.y,T[S++]=R.z;T[S++]=D.x,T[S++]=D.y,T[S++]=D.z}n&&(L[O--]=w.z,L[O--]=w.y,L[O--]=w.x,L[B++]=D.x,L[B++]=D.y,L[B++]=D.z)}A=M.PI_OVER_TWO,w=_A(-A,o,m,g,c,f,u,d,p,w);let F={};return t&&(T[S++]=w.x,T[S++]=w.y,T[S++]=w.z,F.positions=T,F.numPts=x),n&&(L[O--]=w.z,L[O--]=w.y,L[O--]=w.x,F.outerPositions=L),F};var kl=s5;function fDe(e){e=y(e,y.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=y(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var pt=fDe;function Ah(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}Ah.encode=function(e,t){l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var qm={high:0,low:0};Ah.fromCartesian=function(e,t){l(t)||(t=new Ah);let n=t.high,i=t.low;return Ah.encode(e.x,qm),n.x=qm.high,i.x=qm.low,Ah.encode(e.y,qm),n.y=qm.high,i.y=qm.low,Ah.encode(e.z,qm),n.z=qm.high,i.z=qm.low,t};var a5=new Ah;Ah.writeElements=function(e,t,n){Ah.fromCartesian(e,a5);let i=a5.high,r=a5.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=r.x,t[n+4]=r.y,t[n+5]=r.z};var zn=Ah;var c5={};c5.calculateACMR=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),r=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;a<r;)c>n&&(n=c),++a,c=t[a]}let o=[];for(let a=0;a<n+1;a++)o[a]=0;let s=i+1;for(let a=0;a<r;++a)s-o[t[a]]>i&&(o[t[a]]=s,++s);return(s-i+1)/(r/3)};c5.tipsify=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),r;function o(_,E,v,P){for(;E.length>=1;){let R=E[E.length-1];if(E.splice(E.length-1,1),_[R].numLiveTriangles>0)return R}for(;r<P;){if(_[r].numLiveTriangles>0)return++r,r-1;++r}return-1}function s(_,E,v,P,R,F,U){let k=-1,H,V=-1,q=0;for(;q<v.length;){let j=v[q];P[j].numLiveTriangles&&(H=0,R-P[j].timeStamp+2*P[j].numLiveTriangles<=E&&(H=R-P[j].timeStamp),(H>V||V===-1)&&(V=H,k=j)),++q}return k===-1?o(P,F,_,U):k}let a=t.length,c=0,u=0,f=t[u],d=a;if(l(n))c=n+1;else{for(;u<d;)f>c&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],g;for(g=0;g<c;g++)p[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let m=0;for(;u<d;)p[t[u]].vertexTriangles.push(m),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(m),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(m),++p[t[u+2]].numLiveTriangles,++m,u+=3;let x=0,C=i+1;r=1;let A=[],b=[],T,S,w=0,D=[],I=a/3,O=[];for(g=0;g<I;g++)O[g]=!1;let B,L;for(;x!==-1;){A=[],S=p[x],L=S.vertexTriangles.length;for(let _=0;_<L;++_)if(m=S.vertexTriangles[_],!O[m]){O[m]=!0,u=m+m+m;for(let E=0;E<3;++E)B=t[u],A.push(B),b.push(B),D[w]=B,++w,T=p[B],--T.numLiveTriangles,C-T.timeStamp>i&&(T.timeStamp=C,++C),++u}x=s(t,i,A,p,C,b,c)}return D};var xI=c5;var gc={};function wI(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function dDe(e){let t=e.length,n=t/3*6,i=Le.createTypedArray(t,n),r=0;for(let o=0;o<t;o+=3,r+=6)wI(i,r,e[o],e[o+1],e[o+2]);return i}function hDe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Le.createTypedArray(t,n);wI(i,0,e[0],e[1],e[2]);let r=6;for(let o=3;o<t;++o,r+=6)wI(i,r,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function mDe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Le.createTypedArray(t,n),r=e[0],o=0;for(let s=1;s<t;++s,o+=6)wI(i,o,r,e[s],e[s+1]);return i}return new Uint16Array}gc.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Me.TRIANGLES:e.indices=dDe(t);break;case Me.TRIANGLE_STRIP:e.indices=hDe(t);break;case Me.TRIANGLE_FAN:e.indices=mDe(t);break}e.primitiveType=Me.LINES}return e};gc.createLineSegmentsForVectors=function(e,t,n){t=y(t,"normal"),n=y(n,1e4);let i=e.attributes.position.values,r=e.attributes[t].values,o=i.length,s=new Float64Array(2*o),a=0;for(let f=0;f<o;f+=3)s[a++]=i[f],s[a++]=i[f+1],s[a++]=i[f+2],s[a++]=i[f]+r[f]*n,s[a++]=i[f+1]+r[f+1]*n,s[a++]=i[f+2]+r[f+2]*n;let c,u=e.boundingSphere;return l(u)&&(c=new re(u.center,u.radius+n)),new ot({attributes:{position:new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Me.LINES,boundingSphere:c})};gc.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},r=0,o,s=t.length;for(o=0;o<s;++o){let a=t[o];l(n[a])&&(i[a]=r++)}for(let a in n)n.hasOwnProperty(a)&&!l(i[a])&&(i[a]=r++);return i};gc.reorderForPreVertexCache=function(e){let t=ot.computeNumberOfVertices(e),n=e.indices;if(l(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let r=n,o=r.length,s=Le.createTypedArray(t,o),a=0,c=0,u=0,f;for(;a<o;)f=i[r[a]],f!==-1?s[c]=f:(f=r[a],i[f]=u,s[c]=u,++u),++a,++c;e.indices=s;let d=e.attributes;for(let p in d)if(d.hasOwnProperty(p)&&l(d[p])&&l(d[p].values)){let g=d[p],m=g.values,x=0,C=g.componentsPerAttribute,A=K.createTypedArray(g.componentDatatype,u*C);for(;x<t;){let b=i[x];if(b!==-1)for(let T=0;T<C;T++)A[C*b+T]=m[C*x+T];++x}g.values=A}}return e};gc.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Me.TRIANGLES&&l(n)){let i=n.length,r=0;for(let o=0;o<i;o++)n[o]>r&&(r=n[o]);e.indices=xI.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e};function FZ(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new Ee({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function pDe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let r=t[i];for(let o=0;o<r.componentsPerAttribute;++o)e[i].values.push(r.values[n*r.componentsPerAttribute+o])}}gc.fitToUnsignedShortIndices=function(e){let t=[],n=ot.computeNumberOfVertices(e);if(l(e.indices)&&n>=M.SIXTY_FOUR_KILOBYTES){let i=[],r=[],o=0,s=FZ(e.attributes),a=e.indices,c=a.length,u;e.primitiveType===Me.TRIANGLES?u=3:e.primitiveType===Me.LINES?u=2:e.primitiveType===Me.POINTS&&(u=1);for(let f=0;f<c;f+=u){for(let d=0;d<u;++d){let p=a[f+d],g=i[p];l(g)||(g=o++,i[p]=g,pDe(s,e.attributes,p)),r.push(g)}o+u>=M.SIXTY_FOUR_KILOBYTES&&(t.push(new ot({attributes:s,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],r=[],o=0,s=FZ(e.attributes))}r.length!==0&&t.push(new ot({attributes:s,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var VZ=new h,_De=new me;gc.projectTo2D=function(e,t,n,i,r){let o=e.attributes[t];r=l(r)?r:new Ii;let s=r.ellipsoid,a=o.values,c=new Float64Array(a.length),u=0;for(let f=0;f<a.length;f+=3){let d=h.fromArray(a,f,VZ),p=s.cartesianToCartographic(d,_De),g=r.project(p,VZ);c[u++]=g.x,c[u++]=g.y,c[u++]=g.z}return e.attributes[n]=o,e.attributes[i]=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var l5={high:0,low:0};gc.encodeAttribute=function(e,t,n,i){let r=e.attributes[t],o=r.values,s=o.length,a=new Float32Array(s),c=new Float32Array(s);for(let f=0;f<s;++f)zn.encode(o[f],l5),a[f]=l5.high,c[f]=l5.low;let u=r.componentsPerAttribute;return e.attributes[n]=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:u,values:a}),e.attributes[i]=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:u,values:c}),delete e.attributes[t],e};var Jf=new h;function u5(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,Jf),N.multiplyByPoint(e,Jf,Jf),h.pack(Jf,n,r)}}function f5(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,Jf),Q.multiplyByVector(e,Jf,Jf),Jf=h.normalize(Jf,Jf),h.pack(Jf,n,r)}}var CI=new N,AI=new Q;gc.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(N.equals(t,N.IDENTITY))return e;let n=e.geometry.attributes;u5(t,n.position),u5(t,n.prevPosition),u5(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(N.inverse(t,CI),N.transpose(CI,CI),N.getMatrix3(CI,AI),f5(AI,n.normal),f5(AI,n.tangent),f5(AI,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=re.transform(i,t,i)),e.modelMatrix=N.clone(N.IDENTITY),e};function gDe(e,t){let n=e.length,i={},r=e[0][t].attributes,o;for(o in r)if(r.hasOwnProperty(o)&&l(r[o])&&l(r[o].values)){let s=r[o],a=s.values.length,c=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[o];if(!l(f)||s.componentDatatype!==f.componentDatatype||s.componentsPerAttribute!==f.componentsPerAttribute||s.normalize!==f.normalize){c=!1;break}a+=f.values.length}c&&(i[o]=new Ee({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:K.createTypedArray(s.componentDatatype,a)}))}return i}var yDe=new h;function d5(e,t){let n=e.length,i,r,o,s,a=e[0].modelMatrix,c=l(e[0][t].indices),u=e[0][t].primitiveType,f=gDe(e,t),d,p,g;for(i in f)if(f.hasOwnProperty(i))for(d=f[i].values,s=0,r=0;r<n;++r)for(p=e[r][t].attributes[i].values,g=p.length,o=0;o<g;++o)d[s++]=p[o];let m;if(c){let b=0;for(r=0;r<n;++r)b+=e[r][t].indices.length;let T=ot.computeNumberOfVertices(new ot({attributes:f,primitiveType:Me.POINTS})),S=Le.createTypedArray(T,b),w=0,D=0;for(r=0;r<n;++r){let I=e[r][t].indices,O=I.length;for(s=0;s<O;++s)S[w++]=D+I[s];D+=ot.computeNumberOfVertices(e[r][t])}m=S}let x=new h,C=0,A;for(r=0;r<n;++r){if(A=e[r][t].boundingSphere,!l(A)){x=void 0;break}h.add(A.center,x,x)}if(l(x))for(h.divideByScalar(x,n,x),r=0;r<n;++r){A=e[r][t].boundingSphere;let b=h.magnitude(h.subtract(A.center,x,yDe))+A.radius;b>C&&(C=b)}return new ot({attributes:f,indices:m,primitiveType:u,boundingSphere:l(x)?new re(x,C):void 0})}gc.combineInstances=function(e){let t=[],n=[],i=e.length;for(let o=0;o<i;++o){let s=e[o];l(s.geometry)?t.push(s):l(s.westHemisphereGeometry)&&l(s.eastHemisphereGeometry)&&n.push(s)}let r=[];return t.length>0&&r.push(d5(t,"geometry")),n.length>0&&(r.push(d5(n,"westHemisphereGeometry")),r.push(d5(n,"eastHemisphereGeometry"))),r};var Lu=new h,SS=new h,gA=new h,yA=new h;gc.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,r=n.position.values.length/3,o=t.length,s=new Array(r),a=new Array(o/3),c=new Array(o),u;for(u=0;u<r;u++)s[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<o;u+=3){let m=t[u],x=t[u+1],C=t[u+2],A=m*3,b=x*3,T=C*3;SS.x=i[A],SS.y=i[A+1],SS.z=i[A+2],gA.x=i[b],gA.y=i[b+1],gA.z=i[b+2],yA.x=i[T],yA.y=i[T+1],yA.z=i[T+2],s[m].count++,s[x].count++,s[C].count++,h.subtract(gA,SS,gA),h.subtract(yA,SS,yA),a[f]=h.cross(gA,yA,new h),f++}let d=0;for(u=0;u<r;u++)s[u].indexOffset+=d,d+=s[u].count;f=0;let p;for(u=0;u<o;u+=3){p=s[t[u]];let m=p.indexOffset+p.currentCount;c[m]=f,p.currentCount++,p=s[t[u+1]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,p=s[t[u+2]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,f++}let g=new Float32Array(r*3);for(u=0;u<r;u++){let m=u*3;if(p=s[u],h.clone(h.ZERO,Lu),p.count>0){for(f=0;f<p.count;f++)h.add(Lu,a[c[p.indexOffset+f]],Lu);h.equalsEpsilon(h.ZERO,Lu,M.EPSILON10)&&h.clone(a[c[p.indexOffset]],Lu)}h.equalsEpsilon(h.ZERO,Lu,M.EPSILON10)&&(Lu.z=1),h.normalize(Lu,Lu),g[m]=Lu.x,g[m+1]=Lu.y,g[m+2]=Lu.z}return e.attributes.normal=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:g}),e};var xDe=new h,kZ=new h,CDe=new h;gc.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,r=e.attributes.normal.values,o=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),u;for(u=0;u<c.length;u++)c[u]=0;let f,d,p;for(u=0;u<a;u+=3){let x=n[u],C=n[u+1],A=n[u+2];f=x*3,d=C*3,p=A*3;let b=x*2,T=C*2,S=A*2,w=i[f],D=i[f+1],I=i[f+2],O=o[b],B=o[b+1],L=o[T+1]-B,_=o[S+1]-B,E=1/((o[T]-O)*_-(o[S]-O)*L),v=(_*(i[d]-w)-L*(i[p]-w))*E,P=(_*(i[d+1]-D)-L*(i[p+1]-D))*E,R=(_*(i[d+2]-I)-L*(i[p+2]-I))*E;c[f]+=v,c[f+1]+=P,c[f+2]+=R,c[d]+=v,c[d+1]+=P,c[d+2]+=R,c[p]+=v,c[p+1]+=P,c[p+2]+=R}let g=new Float32Array(s*3),m=new Float32Array(s*3);for(u=0;u<s;u++){f=u*3,d=f+1,p=f+2;let x=h.fromArray(r,f,xDe),C=h.fromArray(c,f,CDe),A=h.dot(x,C);h.multiplyByScalar(x,A,kZ),h.normalize(h.subtract(C,kZ,C),C),g[f]=C.x,g[d]=C.y,g[p]=C.z,h.normalize(h.cross(x,C,C),C),m[f]=C.x,m[d]=C.y,m[p]=C.z}return e.attributes.tangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:m}),e};var wS=new W,Zf=new h,UZ=new h,zZ=new h,TI=new W;gc.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let D=t.values;i=D.length/3;let I=new Float32Array(i*2),O=0;for(n=0;n<i;++n){if(h.fromArray(D,n*3,Zf),h.equals(Zf,h.ZERO)){O+=2;continue}TI=In.octEncodeInRange(Zf,65535,TI),I[O++]=TI.x,I[O++]=TI.y}return e.attributes.compressedAttributes=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:I}),delete e.attributes.extrudeDirection,e}let r=e.attributes.normal,o=e.attributes.st,s=l(r),a=l(o);if(!s&&!a)return e;let c=e.attributes.tangent,u=e.attributes.bitangent,f=l(c),d=l(u),p,g,m,x;s&&(p=r.values),a&&(g=o.values),f&&(m=c.values),d&&(x=u.values),i=(s?p.length:g.length)/(s?3:2);let b=i,T=a&&s?2:1;T+=f||d?1:0,b*=T;let S=new Float32Array(b),w=0;for(n=0;n<i;++n){a&&(W.fromArray(g,n*2,wS),S[w++]=In.compressTextureCoordinates(wS));let D=n*3;s&&l(m)&&l(x)?(h.fromArray(p,D,Zf),h.fromArray(m,D,UZ),h.fromArray(x,D,zZ),In.octPack(Zf,UZ,zZ,wS),S[w++]=wS.x,S[w++]=wS.y):(s&&(h.fromArray(p,D,Zf),S[w++]=In.octEncodeFloat(Zf)),f&&(h.fromArray(m,D,Zf),S[w++]=In.octEncodeFloat(Zf)),d&&(h.fromArray(x,D,Zf),S[w++]=In.octEncodeFloat(Zf)))}return e.attributes.compressedAttributes=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:T,values:S}),s&&delete e.attributes.normal,a&&delete e.attributes.st,d&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function ADe(e){if(l(e.indices))return e;let t=ot.computeNumberOfVertices(e),n=Le.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function TDe(e){let t=ot.computeNumberOfVertices(e),n=Le.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let r=3;r<t;++r)n[i++]=r-1,n[i++]=0,n[i++]=r;return e.indices=n,e.primitiveType=Me.TRIANGLES,e}function bDe(e){let t=ot.computeNumberOfVertices(e),n=Le.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let r=3;r<t-1;r+=2)n[i++]=r,n[i++]=r-1,n[i++]=r+1,r+2<t&&(n[i++]=r,n[i++]=r+1,n[i++]=r+2);return e.indices=n,e.primitiveType=Me.TRIANGLES,e}function EDe(e){if(l(e.indices))return e;let t=ot.computeNumberOfVertices(e),n=Le.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function SDe(e){let t=ot.computeNumberOfVertices(e),n=Le.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let r=2;r<t;++r)n[i++]=r-1,n[i++]=r;return e.indices=n,e.primitiveType=Me.LINES,e}function wDe(e){let t=ot.computeNumberOfVertices(e),n=Le.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let r=2;r<t;++r)n[i++]=r-1,n[i++]=r;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Me.LINES,e}function vDe(e){switch(e.primitiveType){case Me.TRIANGLE_FAN:return TDe(e);case Me.TRIANGLE_STRIP:return bDe(e);case Me.TRIANGLES:return ADe(e);case Me.LINE_STRIP:return SDe(e);case Me.LINE_LOOP:return wDe(e);case Me.LINES:return EDe(e)}return e}function R_(e,t){Math.abs(e.y)<M.EPSILON6&&(t?e.y=-M.EPSILON6:e.y=M.EPSILON6)}function DDe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){R_(e,e.y<0),R_(t,t.y<0),R_(n,n.y<0);return}let i=Math.abs(e.y),r=Math.abs(t.y),o=Math.abs(n.y),s;i>r?i>o?s=M.sign(e.y):s=M.sign(n.y):r>o?s=M.sign(t.y):s=M.sign(n.y);let a=s<0;R_(e,a),R_(t,a),R_(n,a)}var HZ=new h;function Nu(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,HZ),e.y/(e.y-t.y),HZ),n),h.clone(n,i),R_(n,!0),R_(i,!1)}var yy=new h,xy=new h,Cy=new h,Ay=new h,h5={positions:new Array(7),indices:new Array(3*3)};function PDe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;DDe(e,t,n);let i=e.y<0,r=t.y<0,o=n.y<0,s=0;s+=i?1:0,s+=r?1:0,s+=o?1:0;let a=h5.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Nu(e,t,yy,Cy),Nu(e,n,xy,Ay),a[0]=0,a[3]=1,a[4]=2,a[6]=1):r?(Nu(t,n,yy,Cy),Nu(t,e,xy,Ay),a[0]=1,a[3]=2,a[4]=0,a[6]=2):o&&(Nu(n,e,yy,Cy),Nu(n,t,xy,Ay),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?r?o||(Nu(n,e,yy,Cy),Nu(n,t,xy,Ay),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Nu(t,n,yy,Cy),Nu(t,e,xy,Ay),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Nu(e,t,yy,Cy),Nu(e,n,xy,Ay),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=h5.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=yy,c[4]=xy,c[5]=Cy,c[6]=Ay,c.length=7),h5}function GZ(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let r in n)if(n.hasOwnProperty(r)&&l(n[r])&&l(n[r].values)){let o=n[r];o.values=K.createTypedArray(o.componentDatatype,o.values)}let i=ot.computeNumberOfVertices(e);return e.indices=Le.createTypedArray(i,e.indices),t&&(e.boundingSphere=re.fromVertices(n.position.values)),e}function CA(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let r=t[i];n[i]=new Ee({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return new ot({attributes:n,indices:[],primitiveType:e.primitiveType})}function g5(e,t,n){let i=l(e.geometry.boundingSphere);t=GZ(t,i),n=GZ(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function y5(e,t){let n=new e,i=new e,r=new e;return function(o,s,a,c,u,f,d,p){let g=e.fromArray(u,o*t,n),m=e.fromArray(u,s*t,i),x=e.fromArray(u,a*t,r);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(m,c.y,m),e.multiplyByScalar(x,c.z,x);let C=e.add(g,m,g);e.add(C,x,C),p&&e.normalize(C,C),e.pack(C,f,d*t)}}var IDe=y5(se,4),SI=y5(h,3),KZ=y5(W,2),ODe=function(e,t,n,i,r,o,s){let a=r[e]*i.x,c=r[t]*i.y,u=r[n]*i.z;o[s]=a+c+u>M.EPSILON6?1:0},vS=new h,m5=new h,p5=new h,RDe=new h;function bI(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m,x){if(!l(o)&&!l(s)&&!l(a)&&!l(c)&&!l(u)&&g===0)return;let C=h.fromArray(r,e*3,vS),A=h.fromArray(r,t*3,m5),b=h.fromArray(r,n*3,p5),T=uA(i,C,A,b,RDe);if(!!l(T)){if(l(o)&&SI(e,t,n,T,o,d.normal.values,x,!0),l(u)){let S=h.fromArray(u,e*3,vS),w=h.fromArray(u,t*3,m5),D=h.fromArray(u,n*3,p5);h.multiplyByScalar(S,T.x,S),h.multiplyByScalar(w,T.y,w),h.multiplyByScalar(D,T.z,D);let I;!h.equals(S,h.ZERO)||!h.equals(w,h.ZERO)||!h.equals(D,h.ZERO)?(I=h.add(S,w,S),h.add(I,D,I),h.normalize(I,I)):(I=vS,I.x=0,I.y=0,I.z=0),h.pack(I,d.extrudeDirection.values,x*3)}if(l(f)&&ODe(e,t,n,T,f,d.applyOffset.values,x),l(s)&&SI(e,t,n,T,s,d.tangent.values,x,!0),l(a)&&SI(e,t,n,T,a,d.bitangent.values,x,!0),l(c)&&KZ(e,t,n,T,c,d.st.values,x),g>0)for(let S=0;S<g;S++){let w=p[S];MDe(e,t,n,T,x,m[w],d[w])}}}function MDe(e,t,n,i,r,o,s){let a=o.componentsPerAttribute,c=o.values,u=s.values;switch(a){case 4:IDe(e,t,n,i,c,u,r,!1);break;case 3:SI(e,t,n,i,c,u,r,!1);break;case 2:KZ(e,t,n,i,c,u,r,!1);break;default:u[r]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function Th(e,t,n,i,r,o){let s=e.position.values.length/3;if(r!==-1){let a=i[r],c=n[a];return c===-1?(n[a]=s,e.position.values.push(o.x,o.y,o.z),t.push(s),s):(t.push(c),c)}return e.position.values.push(o.x,o.y,o.z),t.push(s),s}var BDe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function WZ(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=l(n.normal)?n.normal.values:void 0,o=l(n.bitangent)?n.bitangent.values:void 0,s=l(n.tangent)?n.tangent.values:void 0,a=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=l(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,d=[];for(let I in n)n.hasOwnProperty(I)&&!BDe[I]&&l(n[I])&&d.push(I);let p=d.length,g=CA(t),m=CA(t),x,C,A,b,T,S=[];S.length=i.length/3;let w=[];for(w.length=i.length/3,T=0;T<S.length;++T)S[T]=-1,w[T]=-1;let D=f.length;for(T=0;T<D;T+=3){let I=f[T],O=f[T+1],B=f[T+2],L=h.fromArray(i,I*3),_=h.fromArray(i,O*3),E=h.fromArray(i,B*3),v=PDe(L,_,E);if(l(v)&&v.positions.length>3){let P=v.positions,R=v.indices,F=R.length;for(let U=0;U<F;++U){let k=R[U],H=P[k];H.y<0?(x=m.attributes,C=m.indices,A=S):(x=g.attributes,C=g.indices,A=w),b=Th(x,C,A,f,k<3?T+k:-1,H),bI(I,O,B,H,i,r,s,o,a,c,u,x,d,p,n,b)}}else l(v)&&(L=v.positions[0],_=v.positions[1],E=v.positions[2]),L.y<0?(x=m.attributes,C=m.indices,A=S):(x=g.attributes,C=g.indices,A=w),b=Th(x,C,A,f,T,L),bI(I,O,B,L,i,r,s,o,a,c,u,x,d,p,n,b),b=Th(x,C,A,f,T+1,_),bI(I,O,B,_,i,r,s,o,a,c,u,x,d,p,n,b),b=Th(x,C,A,f,T+2,E),bI(I,O,B,E,i,r,s,o,a,c,u,x,d,p,n,b)}g5(e,m,g)}var $Z=an.fromPointNormal(h.ZERO,h.UNIT_Y),LDe=new h,NDe=new h;function xA(e,t,n,i,r,o,s){if(!l(s))return;let a=h.fromArray(i,e*3,vS);h.equalsEpsilon(a,n,M.EPSILON10)?o.applyOffset.values[r]=s[e]:o.applyOffset.values[r]=s[t]}function jZ(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=l(n.applyOffset)?n.applyOffset.values:void 0,o=t.indices,s=CA(t),a=CA(t),c,u=o.length,f=[];f.length=i.length/3;let d=[];for(d.length=i.length/3,c=0;c<f.length;++c)f[c]=-1,d[c]=-1;for(c=0;c<u;c+=2){let p=o[c],g=o[c+1],m=h.fromArray(i,p*3,vS),x=h.fromArray(i,g*3,m5),C;Math.abs(m.y)<M.EPSILON6&&(m.y<0?m.y=-M.EPSILON6:m.y=M.EPSILON6),Math.abs(x.y)<M.EPSILON6&&(x.y<0?x.y=-M.EPSILON6:x.y=M.EPSILON6);let A=s.attributes,b=s.indices,T=d,S=a.attributes,w=a.indices,D=f,I=er.lineSegmentPlane(m,x,$Z,p5);if(l(I)){let O=h.multiplyByScalar(h.UNIT_Y,5*M.EPSILON9,LDe);m.y<0&&(h.negate(O,O),A=a.attributes,b=a.indices,T=f,S=s.attributes,w=s.indices,D=d);let B=h.add(I,O,NDe);C=Th(A,b,T,o,c,m),xA(p,g,m,i,C,A,r),C=Th(A,b,T,o,-1,B),xA(p,g,B,i,C,A,r),h.negate(O,O),h.add(I,O,B),C=Th(S,w,D,o,-1,B),xA(p,g,B,i,C,S,r),C=Th(S,w,D,o,c+1,x),xA(p,g,x,i,C,S,r)}else{let O,B,L;m.y<0?(O=a.attributes,B=a.indices,L=f):(O=s.attributes,B=s.indices,L=d),C=Th(O,B,L,o,c,m),xA(p,g,m,i,C,O,r),C=Th(O,B,L,o,c+1,x),xA(p,g,x,i,C,O,r)}}g5(e,a,s)}var qZ=new W,FDe=new W,ZZ=new h,JZ=new h,_5=new h,VDe=new h,kDe=new h,UDe=new h,YZ=new se;function XZ(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,r=t.nextPosition.values,o=n.length;for(let s=0;s<o;s+=3){let a=h.unpack(n,s,ZZ);if(a.x>0)continue;let c=h.unpack(i,s,JZ);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):h.pack(a,i,s));let u=h.unpack(r,s,_5);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+3<o?(r[s]=n[s+3],r[s+1]=n[s+4],r[s+2]=n[s+5]):h.pack(a,r,s))}}var zDe=5*M.EPSILON9,EI=M.EPSILON6;function HDe(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=n.prevPosition.values,o=n.nextPosition.values,s=n.expandAndWidth.values,a=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,u=CA(t),f=CA(t),d,p,g,m=!1,x=i.length/3;for(d=0;d<x;d+=4){let C=d,A=d+2,b=h.fromArray(i,C*3,ZZ),T=h.fromArray(i,A*3,JZ);if(Math.abs(b.y)<EI)for(b.y=EI*(T.y<0?-1:1),i[d*3+1]=b.y,i[(d+1)*3+1]=b.y,p=C*3;p<C*3+4*3;p+=3)r[p]=i[d*3],r[p+1]=i[d*3+1],r[p+2]=i[d*3+2];if(Math.abs(T.y)<EI)for(T.y=EI*(b.y<0?-1:1),i[(d+2)*3+1]=T.y,i[(d+3)*3+1]=T.y,p=C*3;p<C*3+4*3;p+=3)o[p]=i[(d+2)*3],o[p+1]=i[(d+2)*3+1],o[p+2]=i[(d+2)*3+2];let S=u.attributes,w=u.indices,D=f.attributes,I=f.indices,O=er.lineSegmentPlane(b,T,$Z,VDe);if(l(O)){m=!0;let B=h.multiplyByScalar(h.UNIT_Y,zDe,kDe);b.y<0&&(h.negate(B,B),S=f.attributes,w=f.indices,D=u.attributes,I=u.indices);let L=h.add(O,B,UDe);S.position.values.push(b.x,b.y,b.z,b.x,b.y,b.z),S.position.values.push(L.x,L.y,L.z),S.position.values.push(L.x,L.y,L.z),S.prevPosition.values.push(r[C*3],r[C*3+1],r[C*3+2]),S.prevPosition.values.push(r[C*3+3],r[C*3+4],r[C*3+5]),S.prevPosition.values.push(b.x,b.y,b.z,b.x,b.y,b.z),S.nextPosition.values.push(L.x,L.y,L.z),S.nextPosition.values.push(L.x,L.y,L.z),S.nextPosition.values.push(L.x,L.y,L.z),S.nextPosition.values.push(L.x,L.y,L.z),h.negate(B,B),h.add(O,B,L),D.position.values.push(L.x,L.y,L.z),D.position.values.push(L.x,L.y,L.z),D.position.values.push(T.x,T.y,T.z,T.x,T.y,T.z),D.prevPosition.values.push(L.x,L.y,L.z),D.prevPosition.values.push(L.x,L.y,L.z),D.prevPosition.values.push(L.x,L.y,L.z),D.prevPosition.values.push(L.x,L.y,L.z),D.nextPosition.values.push(T.x,T.y,T.z,T.x,T.y,T.z),D.nextPosition.values.push(o[A*3],o[A*3+1],o[A*3+2]),D.nextPosition.values.push(o[A*3+3],o[A*3+4],o[A*3+5]);let _=W.fromArray(s,C*2,qZ),E=Math.abs(_.y);S.expandAndWidth.values.push(-1,E,1,E),S.expandAndWidth.values.push(-1,-E,1,-E),D.expandAndWidth.values.push(-1,E,1,E),D.expandAndWidth.values.push(-1,-E,1,-E);let v=h.magnitudeSquared(h.subtract(O,b,_5));if(v/=h.magnitudeSquared(h.subtract(T,b,_5)),l(c)){let P=se.fromArray(c,C*4,YZ),R=se.fromArray(c,A*4,YZ),F=M.lerp(P.x,R.x,v),U=M.lerp(P.y,R.y,v),k=M.lerp(P.z,R.z,v),H=M.lerp(P.w,R.w,v);for(p=C*4;p<C*4+2*4;++p)S.color.values.push(c[p]);for(S.color.values.push(F,U,k,H),S.color.values.push(F,U,k,H),D.color.values.push(F,U,k,H),D.color.values.push(F,U,k,H),p=A*4;p<A*4+2*4;++p)D.color.values.push(c[p])}if(l(a)){let P=W.fromArray(a,C*2,qZ),R=W.fromArray(a,(d+3)*2,FDe),F=M.lerp(P.x,R.x,v);for(p=C*2;p<C*2+2*2;++p)S.st.values.push(a[p]);for(S.st.values.push(F,P.y),S.st.values.push(F,R.y),D.st.values.push(F,P.y),D.st.values.push(F,R.y),p=A*2;p<A*2+2*2;++p)D.st.values.push(a[p])}g=S.position.values.length/3-4,w.push(g,g+2,g+1),w.push(g+1,g+2,g+3),g=D.position.values.length/3-4,I.push(g,g+2,g+1),I.push(g+1,g+2,g+3)}else{let B,L;for(b.y<0?(B=f.attributes,L=f.indices):(B=u.attributes,L=u.indices),B.position.values.push(b.x,b.y,b.z),B.position.values.push(b.x,b.y,b.z),B.position.values.push(T.x,T.y,T.z),B.position.values.push(T.x,T.y,T.z),p=d*3;p<d*3+4*3;++p)B.prevPosition.values.push(r[p]),B.nextPosition.values.push(o[p]);for(p=d*2;p<d*2+4*2;++p)B.expandAndWidth.values.push(s[p]),l(a)&&B.st.values.push(a[p]);if(l(c))for(p=d*4;p<d*4+4*4;++p)B.color.values.push(c[p]);g=B.position.values.length/3-4,L.push(g,g+2,g+1),L.push(g+1,g+2,g+3)}}m&&(XZ(f),XZ(u)),g5(e,f,u)}gc.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||re.intersectPlane(n,an.ORIGIN_ZX_PLANE)!==Jt.INTERSECTING))return e;if(t.geometryType!==$f.NONE)switch(t.geometryType){case $f.POLYLINES:HDe(e);break;case $f.TRIANGLES:WZ(e);break;case $f.LINES:jZ(e);break}else vDe(t),t.primitiveType===Me.TRIANGLES?WZ(e):t.primitiveType===Me.LINES&&jZ(e);return e};var Bn=gc;var AA=new h,x5=new h,C5=new h,QZ=new h,ds=new W,eJ=new Q,GDe=new Q,A5=new Re,tJ=new h,nJ=new h,iJ=new h,PI=new me,rJ=new h,oJ=new W,sJ=new W;function aJ(e,t,n){let i=t.vertexFormat,r=t.center,o=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,d=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,g=i.tangent?new Float32Array(u*3):void 0,m=i.bitangent?new Float32Array(u*3):void 0,x=f?new Float32Array(u*3):void 0,C=0,A=tJ,b=nJ,T=iJ,S=new Ii(a),w=S.project(a.cartesianToCartographic(r,PI),rJ),D=a.scaleToGeodeticSurface(r,AA);a.geodeticSurfaceNormal(D,D);let I=eJ,O=GDe;if(c!==0){let R=Re.fromAxisAngle(D,c,A5);I=Q.fromQuaternion(R,I),R=Re.fromAxisAngle(D,-c,A5),O=Q.fromQuaternion(R,O)}else I=Q.clone(Q.IDENTITY,I),O=Q.clone(Q.IDENTITY,O);let B=W.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,oJ),L=W.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,sJ),_=e.length,E=n?_:0,v=E/3*2;for(let R=0;R<_;R+=3){let F=R+1,U=R+2,k=h.fromArray(e,R,AA);if(i.st){let H=Q.multiplyByVector(I,k,x5),V=S.project(a.cartesianToCartographic(H,PI),C5);h.subtract(V,w,V),ds.x=(V.x+o)/(2*o),ds.y=(V.y+s)/(2*s),B.x=Math.min(ds.x,B.x),B.y=Math.min(ds.y,B.y),L.x=Math.max(ds.x,L.x),L.y=Math.max(ds.y,L.y),n&&(d[C+v]=ds.x,d[C+1+v]=ds.y),d[C++]=ds.x,d[C++]=ds.y}(i.normal||i.tangent||i.bitangent||f)&&(A=a.geodeticSurfaceNormal(k,A),f&&(x[R+E]=-A.x,x[F+E]=-A.y,x[U+E]=-A.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(b=h.normalize(h.cross(h.UNIT_Z,A,b),b),Q.multiplyByVector(O,b,b)),i.normal&&(p[R]=A.x,p[F]=A.y,p[U]=A.z,n&&(p[R+E]=-A.x,p[F+E]=-A.y,p[U+E]=-A.z)),i.tangent&&(g[R]=b.x,g[F]=b.y,g[U]=b.z,n&&(g[R+E]=-b.x,g[F+E]=-b.y,g[U+E]=-b.z)),i.bitangent&&(T=h.normalize(h.cross(A,b,T),T),m[R]=T.x,m[F]=T.y,m[U]=T.z,n&&(m[R+E]=T.x,m[F+E]=T.y,m[U+E]=T.z))))}if(i.st){_=d.length;for(let R=0;R<_;R+=2)d[R]=(d[R]-B.x)/(L.x-B.x),d[R+1]=(d[R+1]-B.y)/(L.y-B.y)}let P=new dn;if(i.position){let R=kl.raisePositionsToHeight(e,t,n);P.position=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:R})}if(i.st&&(P.st=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:d})),i.normal&&(P.normal=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(P.tangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(P.bitangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:m})),f&&(P.extrudeDirection=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:x})),n&&l(t.offsetAttribute)){let R=new Uint8Array(u);if(t.offsetAttribute===nn.TOP)R=R.fill(1,0,u/2);else{let F=t.offsetAttribute===nn.NONE?0:1;R=R.fill(F)}P.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}return P}function cJ(e){let t=new Array(12*(e*(e+1))-6),n=0,i,r,o,s,a;for(i=0,o=1,s=0;s<3;s++)t[n++]=o++,t[n++]=i,t[n++]=o;for(s=2;s<e+1;++s){for(o=s*(s+1)-1,i=(s-1)*s-1,t[n++]=o++,t[n++]=i,t[n++]=o,r=2*s,a=0;a<r-1;++a)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;t[n++]=o++,t[n++]=i,t[n++]=o}for(r=e*2,++o,++i,s=0;s<r-1;++s)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;for(t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=o,r=2*s,a=0;a<r-1;++a)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;t[n++]=i++,t[n++]=i++,t[n++]=o++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=o;return t}var Ty=new h;function WDe(e){let t=e.center;Ty=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,Ty),e.height,Ty),Ty=h.add(t,Ty,Ty);let n=new re(Ty,e.semiMajorAxis),i=kl.computeEllipsePositions(e,!0,!1),r=i.positions,o=i.numPts,s=aJ(r,e,!1),a=cJ(o);return a=Le.createTypedArray(r.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function jDe(e,t){let n=t.vertexFormat,i=t.center,r=t.semiMajorAxis,o=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,d=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,g=n.normal?new Float32Array(f*3):void 0,m=n.tangent?new Float32Array(f*3):void 0,x=n.bitangent?new Float32Array(f*3):void 0,C=t.shadowVolume,A=C?new Float32Array(f*3):void 0,b=0,T=tJ,S=nJ,w=iJ,D=new Ii(s),I=D.project(s.cartesianToCartographic(i,PI),rJ),O=s.scaleToGeodeticSurface(i,AA);s.geodeticSurfaceNormal(O,O);let B=Re.fromAxisAngle(O,u,A5),L=Q.fromQuaternion(B,eJ),_=W.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,oJ),E=W.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,sJ),v=e.length,P=v/3*2;for(let F=0;F<v;F+=3){let U=F+1,k=F+2,H=h.fromArray(e,F,AA),V;if(n.st){let j=Q.multiplyByVector(L,H,x5),X=D.project(s.cartesianToCartographic(j,PI),C5);h.subtract(X,I,X),ds.x=(X.x+r)/(2*r),ds.y=(X.y+o)/(2*o),_.x=Math.min(ds.x,_.x),_.y=Math.min(ds.y,_.y),E.x=Math.max(ds.x,E.x),E.y=Math.max(ds.y,E.y),p[b+P]=ds.x,p[b+1+P]=ds.y,p[b++]=ds.x,p[b++]=ds.y}H=s.scaleToGeodeticSurface(H,H),V=h.clone(H,x5),T=s.geodeticSurfaceNormal(H,T),C&&(A[F+v]=-T.x,A[U+v]=-T.y,A[k+v]=-T.z);let q=h.multiplyByScalar(T,a,QZ);if(H=h.add(H,q,H),q=h.multiplyByScalar(T,c,q),V=h.add(V,q,V),n.position&&(d[F+v]=V.x,d[U+v]=V.y,d[k+v]=V.z,d[F]=H.x,d[U]=H.y,d[k]=H.z),n.normal||n.tangent||n.bitangent){w=h.clone(T,w);let j=h.fromArray(e,(F+3)%v,QZ);h.subtract(j,H,j);let X=h.subtract(V,H,C5);T=h.normalize(h.cross(X,j,T),T),n.normal&&(g[F]=T.x,g[U]=T.y,g[k]=T.z,g[F+v]=T.x,g[U+v]=T.y,g[k+v]=T.z),n.tangent&&(S=h.normalize(h.cross(w,T,S),S),m[F]=S.x,m[U]=S.y,m[k]=S.z,m[F+v]=S.x,m[F+1+v]=S.y,m[F+2+v]=S.z),n.bitangent&&(x[F]=w.x,x[U]=w.y,x[k]=w.z,x[F+v]=w.x,x[U+v]=w.y,x[k+v]=w.z)}}if(n.st){v=p.length;for(let F=0;F<v;F+=2)p[F]=(p[F]-_.x)/(E.x-_.x),p[F+1]=(p[F+1]-_.y)/(E.y-_.y)}let R=new dn;if(n.position&&(R.position=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:d})),n.st&&(R.st=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(R.normal=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(R.tangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:m})),n.bitangent&&(R.bitangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:x})),C&&(R.extrudeDirection=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:A})),l(t.offsetAttribute)){let F=new Uint8Array(f);if(t.offsetAttribute===nn.TOP)F=F.fill(1,0,f/2);else{let U=t.offsetAttribute===nn.NONE?0:1;F=F.fill(U)}R.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}return R}function qDe(e){let t=e.length/3,n=Le.createTypedArray(t,t*6),i=0;for(let r=0;r<t;r++){let o=r,s=r+t,a=(o+1)%t,c=a+t;n[i++]=o,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=c}return n}var vI=new re,DI=new re;function YDe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,AA),e.height,AA);vI.center=h.add(t,r,vI.center),vI.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),DI.center=h.add(t,r,DI.center),DI.radius=i;let o=kl.computeEllipsePositions(e,!0,!0),s=o.positions,a=o.numPts,c=o.outerPositions,u=re.union(vI,DI),f=aJ(s,e,!0),d=cJ(a),p=d.length;d.length=p*2;let g=s.length/3;for(let S=0;S<p;S+=3)d[S+p]=d[S+2]+g,d[S+1+p]=d[S+1]+g,d[S+2+p]=d[S]+g;let m=Le.createTypedArray(g*2/3,d),x=new ot({attributes:f,indices:m,primitiveType:Me.TRIANGLES}),C=jDe(c,e);d=qDe(c);let A=Le.createTypedArray(c.length*2/3,d),b=new ot({attributes:C,indices:A,primitiveType:Me.TRIANGLES}),T=Bn.combineInstances([new pt({geometry:x}),new pt({geometry:b})]);return{boundingSphere:u,attributes:T[0].attributes,indices:T[0].indices}}function lJ(e,t,n,i,r,o,s){let c=kl.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:r},!1,!0).outerPositions,u=c.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=h.fromArray(c,p*3);let d=he.fromCartesianArray(f,o,s);return d.width>M.PI&&(d.north=d.north>0?M.PI_OVER_TWO-M.EPSILON7:d.north,d.south=d.south<0?M.EPSILON7-M.PI_OVER_TWO:d.south,d.east=M.PI,d.west=-M.PI),d}function Eh(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,oe.WGS84),i=e.semiMajorAxis,r=e.semiMinorAxis,o=y(e.granularity,M.RADIANS_PER_DEGREE),s=y(e.vertexFormat,Pe.DEFAULT),a=y(e.height,0),c=y(e.extrudedHeight,a);this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=oe.clone(n),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._height=Math.max(c,a),this._granularity=o,this._vertexFormat=Pe.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Eh.packedLength=h.packedLength+oe.packedLength+Pe.packedLength+9;Eh.pack=function(e,t,n){return n=y(n,0),h.pack(e._center,t,n),n+=h.packedLength,oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var uJ=new h,fJ=new oe,dJ=new Pe,bh={center:uJ,ellipsoid:fJ,vertexFormat:dJ,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Eh.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,uJ);t+=h.packedLength;let r=oe.unpack(e,t,fJ);t+=oe.packedLength;let o=Pe.unpack(e,t,dJ);t+=Pe.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++],g=e[t++]===1,m=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=oe.clone(r,n._ellipsoid),n._vertexFormat=Pe.clone(o,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=d,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=m===-1?void 0:m,n):(bh.height=f,bh.extrudedHeight=p,bh.granularity=d,bh.stRotation=u,bh.rotation=c,bh.semiMajorAxis=s,bh.semiMinorAxis=a,bh.shadowVolume=g,bh.offsetAttribute=m===-1?void 0:m,new Eh(bh))};Eh.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.center,i=y(e.ellipsoid,oe.WGS84),r=e.semiMajorAxis,o=e.semiMinorAxis,s=y(e.granularity,M.RADIANS_PER_DEGREE),a=y(e.rotation,0);return lJ(n,r,o,a,s,i,t)};Eh.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!M.equalsEpsilon(t,n,0,M.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},o;if(i)r.extrudedHeight=n,r.shadowVolume=e._shadowVolume,r.offsetAttribute=e._offsetAttribute,o=YDe(r);else if(o=WDe(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===nn.NONE?0:1,c=new Uint8Array(s/3).fill(a);o.attributes.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new ot({attributes:o.attributes,indices:o.indices,primitiveType:Me.TRIANGLES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};Eh.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new Eh({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:r,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:o,height:s,vertexFormat:Pe.POSITION_ONLY,shadowVolume:!0})};function XDe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=kl.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,r=i.length/3,o=new Array(r);for(let c=0;c<r;++c)o[c]=h.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return ot._textureCoordinateRotationPoints(o,t,s,a)}Object.defineProperties(Eh.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=lJ(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=XDe(this)),this._textureCoordinateRotationPoints}}});var il=Eh;function Ym(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new il(n),this._workerName="createCircleGeometry"}Ym.packedLength=il.packedLength;Ym.pack=function(e,t,n){return il.pack(e._ellipseGeometry,t,n)};var KDe=new il({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Va={center:new h,radius:void 0,ellipsoid:oe.clone(oe.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Pe,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};Ym.unpack=function(e,t,n){let i=il.unpack(e,t,KDe);return Va.center=h.clone(i._center,Va.center),Va.ellipsoid=oe.clone(i._ellipsoid,Va.ellipsoid),Va.height=i._height,Va.extrudedHeight=i._extrudedHeight,Va.granularity=i._granularity,Va.vertexFormat=Pe.clone(i._vertexFormat,Va.vertexFormat),Va.stRotation=i._stRotation,Va.shadowVolume=i._shadowVolume,l(n)?(Va.semiMajorAxis=i._semiMajorAxis,Va.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new il(Va),n):(Va.radius=i._semiMajorAxis,new Ym(Va))};Ym.createGeometry=function(e){return il.createGeometry(e._ellipseGeometry)};Ym.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,r=e._ellipseGeometry._ellipsoid,o=t(i,r),s=n(i,r);return new Ym({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:r,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:o,height:s,vertexFormat:Pe.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(Ym.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var hJ=Ym;var mJ=new h,by=new h;function $De(e){let t=e.center;by=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,by),e.height,by),by=h.add(t,by,by);let n=new re(by,e.semiMajorAxis),i=kl.computeEllipsePositions(e,!1,!0).outerPositions,r=new dn({position:new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:kl.raisePositionsToHeight(i,e,!1)})}),o=i.length/3,s=Le.createTypedArray(o,o*2),a=0;for(let c=0;c<o;++c)s[a++]=c,s[a++]=(c+1)%o;return{boundingSphere:n,attributes:r,indices:s}}var II=new re,OI=new re;function ZDe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,mJ),e.height,mJ);II.center=h.add(t,r,II.center),II.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),OI.center=h.add(t,r,OI.center),OI.radius=i;let o=kl.computeEllipsePositions(e,!1,!0).outerPositions,s=new dn({position:new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:kl.raisePositionsToHeight(o,e,!0)})});o=s.position.values;let a=re.union(II,OI),c=o.length/3;if(l(e.offsetAttribute)){let m=new Uint8Array(c);if(e.offsetAttribute===nn.TOP)m=m.fill(1,0,c/2);else{let x=e.offsetAttribute===nn.NONE?0:1;m=m.fill(x)}s.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}let u=y(e.numberOfVerticalLines,16);u=M.clamp(u,0,c/2);let f=Le.createTypedArray(c,c*2+u*2);c/=2;let d=0,p;for(p=0;p<c;++p)f[d++]=p,f[d++]=(p+1)%c,f[d++]=p+c,f[d++]=(p+1)%c+c;let g;if(u>0){let m=Math.min(u,c);g=Math.round(c/m);let x=Math.min(g*u,c);for(p=0;p<x;p+=g)f[d++]=p,f[d++]=p+c}return{boundingSphere:a,attributes:s,indices:f}}function TA(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,oe.WGS84),i=e.semiMajorAxis,r=e.semiMinorAxis,o=y(e.granularity,M.RADIANS_PER_DEGREE),s=y(e.height,0),a=y(e.extrudedHeight,s);this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=oe.clone(n),this._rotation=y(e.rotation,0),this._height=Math.max(a,s),this._granularity=o,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(y(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}TA.packedLength=h.packedLength+oe.packedLength+8;TA.pack=function(e,t,n){return n=y(n,0),h.pack(e._center,t,n),n+=h.packedLength,oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var pJ=new h,_J=new oe,Xm={center:pJ,ellipsoid:_J,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};TA.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,pJ);t+=h.packedLength;let r=oe.unpack(e,t,_J);t+=oe.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=oe.clone(r,n._ellipsoid),n._semiMajorAxis=o,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=d,n._offsetAttribute=p===-1?void 0:p,n):(Xm.height=c,Xm.extrudedHeight=f,Xm.granularity=u,Xm.rotation=a,Xm.semiMajorAxis=o,Xm.semiMinorAxis=s,Xm.numberOfVerticalLines=d,Xm.offsetAttribute=p===-1?void 0:p,new TA(Xm))};TA.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!M.equalsEpsilon(t,n,0,M.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},o;if(i)r.extrudedHeight=n,r.offsetAttribute=e._offsetAttribute,o=ZDe(r);else if(o=$De(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===nn.NONE?0:1,c=new Uint8Array(s/3).fill(a);o.attributes.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new ot({attributes:o.attributes,indices:o.indices,primitiveType:Me.LINES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};var Fu=TA;function bA(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new Fu(n),this._workerName="createCircleOutlineGeometry"}bA.packedLength=Fu.packedLength;bA.pack=function(e,t,n){return Fu.pack(e._ellipseGeometry,t,n)};var JDe=new Fu({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Ul={center:new h,radius:void 0,ellipsoid:oe.clone(oe.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};bA.unpack=function(e,t,n){let i=Fu.unpack(e,t,JDe);return Ul.center=h.clone(i._center,Ul.center),Ul.ellipsoid=oe.clone(i._ellipsoid,Ul.ellipsoid),Ul.height=i._height,Ul.extrudedHeight=i._extrudedHeight,Ul.granularity=i._granularity,Ul.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(Ul.semiMajorAxis=i._semiMajorAxis,Ul.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Fu(Ul),n):(Ul.radius=i._semiMajorAxis,new bA(Ul))};bA.createGeometry=function(e){return Fu.createGeometry(e._ellipseGeometry)};var gJ=bA;var QDe={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},jo=Object.freeze(QDe);var e1e={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},xr=Object.freeze(e1e);var T5;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?T5=function(){return performance.now()}:T5=function(){return Date.now()};var Bi=T5;function b5(e){e=y(e,y.EMPTY_OBJECT);let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=ee.clone(t):l(n)?t=ee.clone(n):l(i)?t=ee.addDays(i,-1,new ee):t=ee.now(),l(n)?n=ee.clone(n):n=ee.clone(t),l(i)?i=ee.clone(i):i=ee.addDays(n,1,new ee),this.startTime=n,this.stopTime=i,this.clockRange=y(e.clockRange,jo.UNBOUNDED),this.canAnimate=y(e.canAnimate,!0),this.onTick=new ge,this.onStop=new ge,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=Bi(),this.currentTime=t,this.multiplier=y(e.multiplier,1),this.shouldAnimate=y(e.shouldAnimate,!1),this.clockStep=y(e.clockStep,xr.SYSTEM_CLOCK_MULTIPLIER)}Object.defineProperties(b5.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){ee.equals(this._currentTime,e)||(this._clockStep===xr.SYSTEM_CLOCK&&(this._clockStep=xr.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===xr.SYSTEM_CLOCK&&(this._clockStep=xr.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===xr.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=ee.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===xr.SYSTEM_CLOCK&&(this._clockStep=xr.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});b5.prototype.tick=function(){let e=Bi(),t=ee.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===xr.SYSTEM_CLOCK)t=ee.now(t);else{let i=this._multiplier;if(n===xr.TICK_DEPENDENT)t=ee.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=ee.addSeconds(t,i*(a/1e3),t)}let r=this.clockRange,o=this.startTime,s=this.stopTime;if(r===jo.CLAMPED)ee.lessThan(t,o)?t=ee.clone(o,t):ee.greaterThan(t,s)&&(t=ee.clone(s,t),this.onStop.raiseEvent(this));else if(r===jo.LOOP_STOP)for(ee.lessThan(t,o)&&(t=ee.clone(o,t));ee.greaterThan(t,s);)t=ee.addSeconds(o,ee.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var Sh=b5;function E5(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function ne(e,t,n,i){this.red=y(e,1),this.green=y(t,1),this.blue=y(n,1),this.alpha=y(i,1)}ne.fromCartesian4=function(e,t){return l(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new ne(e.x,e.y,e.z,e.w)};ne.fromBytes=function(e,t,n,i,r){return e=ne.byteToFloat(y(e,255)),t=ne.byteToFloat(y(t,255)),n=ne.byteToFloat(y(n,255)),i=ne.byteToFloat(y(i,255)),l(r)?(r.red=e,r.green=t,r.blue=n,r.alpha=i,r):new ne(e,t,n,i)};ne.fromAlpha=function(e,t,n){return l(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new ne(e.red,e.green,e.blue,t)};var S5,w5,Km;Et.supportsTypedArrays()&&(S5=new ArrayBuffer(4),w5=new Uint32Array(S5),Km=new Uint8Array(S5));ne.fromRgba=function(e,t){return w5[0]=e,ne.fromBytes(Km[0],Km[1],Km[2],Km[3],t)};ne.fromHsl=function(e,t,n,i,r){e=y(e,0)%1,t=y(t,0),n=y(n,0),i=y(i,1);let o=n,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let u=2*n-c;o=E5(u,c,e+1/3),s=E5(u,c,e),a=E5(u,c,e-1/3)}return l(r)?(r.red=o,r.green=s,r.blue=a,r.alpha=i,r):new ne(o,s,a,i)};ne.fromRandom=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.red;if(!l(n)){let s=y(e.minimumRed,0),a=y(e.maximumRed,1);n=s+M.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=y(e.minimumGreen,0),a=y(e.maximumGreen,1);i=s+M.nextRandomNumber()*(a-s)}let r=e.blue;if(!l(r)){let s=y(e.minimumBlue,0),a=y(e.maximumBlue,1);r=s+M.nextRandomNumber()*(a-s)}let o=e.alpha;if(!l(o)){let s=y(e.minimumAlpha,0),a=y(e.maximumAlpha,1);o=s+M.nextRandomNumber()*(a-s)}return l(t)?(t.red=n,t.green=i,t.blue=r,t.alpha=o,t):new ne(n,i,r,o)};var t1e=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,n1e=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,i1e=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,r1e=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;ne.fromCssColorString=function(e,t){l(t)||(t=new ne),e=e.replace(/\s/g,"");let n=ne[e.toUpperCase()];if(l(n))return ne.clone(n,t),t;let i=t1e.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(y(i[4],"f"),16)/15,t):(i=n1e.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(y(i[4],"ff"),16)/255,t):(i=i1e.exec(e),i!==null?(t.red=parseFloat(i[1])/(i[1].substr(-1)==="%"?100:255),t.green=parseFloat(i[2])/(i[2].substr(-1)==="%"?100:255),t.blue=parseFloat(i[3])/(i[3].substr(-1)==="%"?100:255),t.alpha=parseFloat(y(i[4],"1.0")),t):(i=r1e.exec(e),i!==null?ne.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(y(i[4],"1.0")),t):(t=void 0,t))))};ne.packedLength=4;ne.pack=function(e,t,n){return n=y(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};ne.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ne),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};ne.byteToFloat=function(e){return e/255};ne.floatToByte=function(e){return e===1?255:e*256|0};ne.clone=function(e,t){if(!!l(e))return l(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new ne(e.red,e.green,e.blue,e.alpha)};ne.equals=function(e,t){return e===t||l(e)&&l(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};ne.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]};ne.prototype.clone=function(e){return ne.clone(this,e)};ne.prototype.equals=function(e){return ne.equals(this,e)};ne.prototype.equalsEpsilon=function(e,t){return this===e||l(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t};ne.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};ne.prototype.toCssColorString=function(){let e=ne.floatToByte(this.red),t=ne.floatToByte(this.green),n=ne.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};ne.prototype.toCssHexString=function(){let e=ne.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=ne.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=ne.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=ne.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};ne.prototype.toBytes=function(e){let t=ne.floatToByte(this.red),n=ne.floatToByte(this.green),i=ne.floatToByte(this.blue),r=ne.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=r,e):[t,n,i,r]};ne.prototype.toRgba=function(){return Km[0]=ne.floatToByte(this.red),Km[1]=ne.floatToByte(this.green),Km[2]=ne.floatToByte(this.blue),Km[3]=ne.floatToByte(this.alpha),w5[0]};ne.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t};ne.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};ne.prototype.withAlpha=function(e,t){return ne.fromAlpha(this,e,t)};ne.add=function(e,t,n){return n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n};ne.subtract=function(e,t,n){return n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n};ne.multiply=function(e,t,n){return n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n};ne.divide=function(e,t,n){return n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n};ne.mod=function(e,t,n){return n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n};ne.lerp=function(e,t,n,i){return i.red=M.lerp(e.red,t.red,n),i.green=M.lerp(e.green,t.green,n),i.blue=M.lerp(e.blue,t.blue,n),i.alpha=M.lerp(e.alpha,t.alpha,n),i};ne.multiplyByScalar=function(e,t,n){return n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};ne.divideByScalar=function(e,t,n){return n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};ne.ALICEBLUE=Object.freeze(ne.fromCssColorString("#F0F8FF"));ne.ANTIQUEWHITE=Object.freeze(ne.fromCssColorString("#FAEBD7"));ne.AQUA=Object.freeze(ne.fromCssColorString("#00FFFF"));ne.AQUAMARINE=Object.freeze(ne.fromCssColorString("#7FFFD4"));ne.AZURE=Object.freeze(ne.fromCssColorString("#F0FFFF"));ne.BEIGE=Object.freeze(ne.fromCssColorString("#F5F5DC"));ne.BISQUE=Object.freeze(ne.fromCssColorString("#FFE4C4"));ne.BLACK=Object.freeze(ne.fromCssColorString("#000000"));ne.BLANCHEDALMOND=Object.freeze(ne.fromCssColorString("#FFEBCD"));ne.BLUE=Object.freeze(ne.fromCssColorString("#0000FF"));ne.BLUEVIOLET=Object.freeze(ne.fromCssColorString("#8A2BE2"));ne.BROWN=Object.freeze(ne.fromCssColorString("#A52A2A"));ne.BURLYWOOD=Object.freeze(ne.fromCssColorString("#DEB887"));ne.CADETBLUE=Object.freeze(ne.fromCssColorString("#5F9EA0"));ne.CHARTREUSE=Object.freeze(ne.fromCssColorString("#7FFF00"));ne.CHOCOLATE=Object.freeze(ne.fromCssColorString("#D2691E"));ne.CORAL=Object.freeze(ne.fromCssColorString("#FF7F50"));ne.CORNFLOWERBLUE=Object.freeze(ne.fromCssColorString("#6495ED"));ne.CORNSILK=Object.freeze(ne.fromCssColorString("#FFF8DC"));ne.CRIMSON=Object.freeze(ne.fromCssColorString("#DC143C"));ne.CYAN=Object.freeze(ne.fromCssColorString("#00FFFF"));ne.DARKBLUE=Object.freeze(ne.fromCssColorString("#00008B"));ne.DARKCYAN=Object.freeze(ne.fromCssColorString("#008B8B"));ne.DARKGOLDENROD=Object.freeze(ne.fromCssColorString("#B8860B"));ne.DARKGRAY=Object.freeze(ne.fromCssColorString("#A9A9A9"));ne.DARKGREEN=Object.freeze(ne.fromCssColorString("#006400"));ne.DARKGREY=ne.DARKGRAY;ne.DARKKHAKI=Object.freeze(ne.fromCssColorString("#BDB76B"));ne.DARKMAGENTA=Object.freeze(ne.fromCssColorString("#8B008B"));ne.DARKOLIVEGREEN=Object.freeze(ne.fromCssColorString("#556B2F"));ne.DARKORANGE=Object.freeze(ne.fromCssColorString("#FF8C00"));ne.DARKORCHID=Object.freeze(ne.fromCssColorString("#9932CC"));ne.DARKRED=Object.freeze(ne.fromCssColorString("#8B0000"));ne.DARKSALMON=Object.freeze(ne.fromCssColorString("#E9967A"));ne.DARKSEAGREEN=Object.freeze(ne.fromCssColorString("#8FBC8F"));ne.DARKSLATEBLUE=Object.freeze(ne.fromCssColorString("#483D8B"));ne.DARKSLATEGRAY=Object.freeze(ne.fromCssColorString("#2F4F4F"));ne.DARKSLATEGREY=ne.DARKSLATEGRAY;ne.DARKTURQUOISE=Object.freeze(ne.fromCssColorString("#00CED1"));ne.DARKVIOLET=Object.freeze(ne.fromCssColorString("#9400D3"));ne.DEEPPINK=Object.freeze(ne.fromCssColorString("#FF1493"));ne.DEEPSKYBLUE=Object.freeze(ne.fromCssColorString("#00BFFF"));ne.DIMGRAY=Object.freeze(ne.fromCssColorString("#696969"));ne.DIMGREY=ne.DIMGRAY;ne.DODGERBLUE=Object.freeze(ne.fromCssColorString("#1E90FF"));ne.FIREBRICK=Object.freeze(ne.fromCssColorString("#B22222"));ne.FLORALWHITE=Object.freeze(ne.fromCssColorString("#FFFAF0"));ne.FORESTGREEN=Object.freeze(ne.fromCssColorString("#228B22"));ne.FUCHSIA=Object.freeze(ne.fromCssColorString("#FF00FF"));ne.GAINSBORO=Object.freeze(ne.fromCssColorString("#DCDCDC"));ne.GHOSTWHITE=Object.freeze(ne.fromCssColorString("#F8F8FF"));ne.GOLD=Object.freeze(ne.fromCssColorString("#FFD700"));ne.GOLDENROD=Object.freeze(ne.fromCssColorString("#DAA520"));ne.GRAY=Object.freeze(ne.fromCssColorString("#808080"));ne.GREEN=Object.freeze(ne.fromCssColorString("#008000"));ne.GREENYELLOW=Object.freeze(ne.fromCssColorString("#ADFF2F"));ne.GREY=ne.GRAY;ne.HONEYDEW=Object.freeze(ne.fromCssColorString("#F0FFF0"));ne.HOTPINK=Object.freeze(ne.fromCssColorString("#FF69B4"));ne.INDIANRED=Object.freeze(ne.fromCssColorString("#CD5C5C"));ne.INDIGO=Object.freeze(ne.fromCssColorString("#4B0082"));ne.IVORY=Object.freeze(ne.fromCssColorString("#FFFFF0"));ne.KHAKI=Object.freeze(ne.fromCssColorString("#F0E68C"));ne.LAVENDER=Object.freeze(ne.fromCssColorString("#E6E6FA"));ne.LAVENDAR_BLUSH=Object.freeze(ne.fromCssColorString("#FFF0F5"));ne.LAWNGREEN=Object.freeze(ne.fromCssColorString("#7CFC00"));ne.LEMONCHIFFON=Object.freeze(ne.fromCssColorString("#FFFACD"));ne.LIGHTBLUE=Object.freeze(ne.fromCssColorString("#ADD8E6"));ne.LIGHTCORAL=Object.freeze(ne.fromCssColorString("#F08080"));ne.LIGHTCYAN=Object.freeze(ne.fromCssColorString("#E0FFFF"));ne.LIGHTGOLDENRODYELLOW=Object.freeze(ne.fromCssColorString("#FAFAD2"));ne.LIGHTGRAY=Object.freeze(ne.fromCssColorString("#D3D3D3"));ne.LIGHTGREEN=Object.freeze(ne.fromCssColorString("#90EE90"));ne.LIGHTGREY=ne.LIGHTGRAY;ne.LIGHTPINK=Object.freeze(ne.fromCssColorString("#FFB6C1"));ne.LIGHTSEAGREEN=Object.freeze(ne.fromCssColorString("#20B2AA"));ne.LIGHTSKYBLUE=Object.freeze(ne.fromCssColorString("#87CEFA"));ne.LIGHTSLATEGRAY=Object.freeze(ne.fromCssColorString("#778899"));ne.LIGHTSLATEGREY=ne.LIGHTSLATEGRAY;ne.LIGHTSTEELBLUE=Object.freeze(ne.fromCssColorString("#B0C4DE"));ne.LIGHTYELLOW=Object.freeze(ne.fromCssColorString("#FFFFE0"));ne.LIME=Object.freeze(ne.fromCssColorString("#00FF00"));ne.LIMEGREEN=Object.freeze(ne.fromCssColorString("#32CD32"));ne.LINEN=Object.freeze(ne.fromCssColorString("#FAF0E6"));ne.MAGENTA=Object.freeze(ne.fromCssColorString("#FF00FF"));ne.MAROON=Object.freeze(ne.fromCssColorString("#800000"));ne.MEDIUMAQUAMARINE=Object.freeze(ne.fromCssColorString("#66CDAA"));ne.MEDIUMBLUE=Object.freeze(ne.fromCssColorString("#0000CD"));ne.MEDIUMORCHID=Object.freeze(ne.fromCssColorString("#BA55D3"));ne.MEDIUMPURPLE=Object.freeze(ne.fromCssColorString("#9370DB"));ne.MEDIUMSEAGREEN=Object.freeze(ne.fromCssColorString("#3CB371"));ne.MEDIUMSLATEBLUE=Object.freeze(ne.fromCssColorString("#7B68EE"));ne.MEDIUMSPRINGGREEN=Object.freeze(ne.fromCssColorString("#00FA9A"));ne.MEDIUMTURQUOISE=Object.freeze(ne.fromCssColorString("#48D1CC"));ne.MEDIUMVIOLETRED=Object.freeze(ne.fromCssColorString("#C71585"));ne.MIDNIGHTBLUE=Object.freeze(ne.fromCssColorString("#191970"));ne.MINTCREAM=Object.freeze(ne.fromCssColorString("#F5FFFA"));ne.MISTYROSE=Object.freeze(ne.fromCssColorString("#FFE4E1"));ne.MOCCASIN=Object.freeze(ne.fromCssColorString("#FFE4B5"));ne.NAVAJOWHITE=Object.freeze(ne.fromCssColorString("#FFDEAD"));ne.NAVY=Object.freeze(ne.fromCssColorString("#000080"));ne.OLDLACE=Object.freeze(ne.fromCssColorString("#FDF5E6"));ne.OLIVE=Object.freeze(ne.fromCssColorString("#808000"));ne.OLIVEDRAB=Object.freeze(ne.fromCssColorString("#6B8E23"));ne.ORANGE=Object.freeze(ne.fromCssColorString("#FFA500"));ne.ORANGERED=Object.freeze(ne.fromCssColorString("#FF4500"));ne.ORCHID=Object.freeze(ne.fromCssColorString("#DA70D6"));ne.PALEGOLDENROD=Object.freeze(ne.fromCssColorString("#EEE8AA"));ne.PALEGREEN=Object.freeze(ne.fromCssColorString("#98FB98"));ne.PALETURQUOISE=Object.freeze(ne.fromCssColorString("#AFEEEE"));ne.PALEVIOLETRED=Object.freeze(ne.fromCssColorString("#DB7093"));ne.PAPAYAWHIP=Object.freeze(ne.fromCssColorString("#FFEFD5"));ne.PEACHPUFF=Object.freeze(ne.fromCssColorString("#FFDAB9"));ne.PERU=Object.freeze(ne.fromCssColorString("#CD853F"));ne.PINK=Object.freeze(ne.fromCssColorString("#FFC0CB"));ne.PLUM=Object.freeze(ne.fromCssColorString("#DDA0DD"));ne.POWDERBLUE=Object.freeze(ne.fromCssColorString("#B0E0E6"));ne.PURPLE=Object.freeze(ne.fromCssColorString("#800080"));ne.RED=Object.freeze(ne.fromCssColorString("#FF0000"));ne.ROSYBROWN=Object.freeze(ne.fromCssColorString("#BC8F8F"));ne.ROYALBLUE=Object.freeze(ne.fromCssColorString("#4169E1"));ne.SADDLEBROWN=Object.freeze(ne.fromCssColorString("#8B4513"));ne.SALMON=Object.freeze(ne.fromCssColorString("#FA8072"));ne.SANDYBROWN=Object.freeze(ne.fromCssColorString("#F4A460"));ne.SEAGREEN=Object.freeze(ne.fromCssColorString("#2E8B57"));ne.SEASHELL=Object.freeze(ne.fromCssColorString("#FFF5EE"));ne.SIENNA=Object.freeze(ne.fromCssColorString("#A0522D"));ne.SILVER=Object.freeze(ne.fromCssColorString("#C0C0C0"));ne.SKYBLUE=Object.freeze(ne.fromCssColorString("#87CEEB"));ne.SLATEBLUE=Object.freeze(ne.fromCssColorString("#6A5ACD"));ne.SLATEGRAY=Object.freeze(ne.fromCssColorString("#708090"));ne.SLATEGREY=ne.SLATEGRAY;ne.SNOW=Object.freeze(ne.fromCssColorString("#FFFAFA"));ne.SPRINGGREEN=Object.freeze(ne.fromCssColorString("#00FF7F"));ne.STEELBLUE=Object.freeze(ne.fromCssColorString("#4682B4"));ne.TAN=Object.freeze(ne.fromCssColorString("#D2B48C"));ne.TEAL=Object.freeze(ne.fromCssColorString("#008080"));ne.THISTLE=Object.freeze(ne.fromCssColorString("#D8BFD8"));ne.TOMATO=Object.freeze(ne.fromCssColorString("#FF6347"));ne.TURQUOISE=Object.freeze(ne.fromCssColorString("#40E0D0"));ne.VIOLET=Object.freeze(ne.fromCssColorString("#EE82EE"));ne.WHEAT=Object.freeze(ne.fromCssColorString("#F5DEB3"));ne.WHITE=Object.freeze(ne.fromCssColorString("#FFFFFF"));ne.WHITESMOKE=Object.freeze(ne.fromCssColorString("#F5F5F5"));ne.YELLOW=Object.freeze(ne.fromCssColorString("#FFFF00"));ne.YELLOWGREEN=Object.freeze(ne.fromCssColorString("#9ACD32"));ne.TRANSPARENT=Object.freeze(new ne(0,0,0,0));var z=ne;function EA(e,t,n,i){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,1),this.value=new Uint8Array([z.floatToByte(e),z.floatToByte(t),z.floatToByte(n),z.floatToByte(i)])}Object.defineProperties(EA.prototype,{componentDatatype:{get:function(){return K.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});EA.fromColor=function(e){return new EA(e.red,e.green,e.blue,e.alpha)};EA.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};EA.equals=function(e,t){return e===t||l(e)&&l(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var Ot=EA;function SA(e,t,n,i,r){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=r}Object.defineProperties(SA.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}}});SA.clone=function(e){if(!!l(e))return new SA(e._format,e._datatype,e._width,e._height,e._buffer)};SA.prototype.clone=function(){return SA.clone(this)};var RI=SA;function wA(e){this._value=e,this._valueType=qi.getPointType(e)}Object.defineProperties(wA.prototype,{value:{get:function(){return this._value}}});wA.prototype.findTimeInterval=function(e){};wA.prototype.wrapTime=function(e){return 0};wA.prototype.clampTime=function(e){return 0};wA.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var vA=wA;var DS={},o1e=new h,yJ=new h,xJ=new h,CJ=new h,AJ=new Ai;DS.validOutline=function(e){let n=Ai.fromPoints(e,AJ).halfAxes,i=Q.getColumn(n,0,yJ),r=Q.getColumn(n,1,xJ),o=Q.getColumn(n,2,CJ),s=h.magnitude(i),a=h.magnitude(r),c=h.magnitude(o);return!(s===0&&(a===0||c===0)||a===0&&c===0)};DS.computeProjectTo2DArguments=function(e,t,n,i){let r=Ai.fromPoints(e,AJ),o=r.halfAxes,s=Q.getColumn(o,0,yJ),a=Q.getColumn(o,1,xJ),c=Q.getColumn(o,2,CJ),u=h.magnitude(s),f=h.magnitude(a),d=h.magnitude(c),p=Math.min(u,f,d);if(u===0&&(f===0||d===0)||f===0&&d===0)return!1;let g,m;return(p===f||p===d)&&(g=s),p===u?g=a:p===d&&(m=a),(p===u||p===f)&&(m=c),h.normalize(g,n),h.normalize(m,i),h.clone(r.center,t),!0};function TJ(e,t,n,i,r){let o=h.subtract(e,t,o1e),s=h.dot(n,o),a=h.dot(i,o);return W.fromElements(s,a,r)}DS.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let r=new Array(i.length);for(let o=0;o<i.length;o++)r[o]=TJ(i[o],e,t,n);return r}};DS.createProjectPointTo2DFunction=function(e,t,n){return function(i,r){return TJ(i,e,t,n,r)}};var M_=DS;function D5(e,t,n){if(e===0)return t*n;let i=e*e,r=i*i,o=r*i,s=o*i,a=s*i,c=a*i,u=n,f=Math.sin(2*u),d=Math.sin(4*u),p=Math.sin(6*u),g=Math.sin(8*u),m=Math.sin(10*u),x=Math.sin(12*u);return t*((1-i/4-3*r/64-5*o/256-175*s/16384-441*a/65536-4851*c/1048576)*u-(3*i/8+3*r/32+45*o/1024+105*s/4096+2205*a/131072+6237*c/524288)*f+(15*r/256+45*o/1024+525*s/16384+1575*a/65536+155925*c/8388608)*d-(35*o/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*g-(693*a/1310720+6237*c/5242880)*m+1001*c/8388608*x)}function s1e(e,t,n){let i=e/n;if(t===0)return i;let r=i*i,o=r*i,s=o*i,a=t,c=a*a,u=c*c,f=u*c,d=f*c,p=d*c,g=p*c,m=Math.sin(2*i),x=Math.cos(2*i),C=Math.sin(4*i),A=Math.cos(4*i),b=Math.sin(6*i),T=Math.cos(6*i),S=Math.sin(8*i),w=Math.cos(8*i),D=Math.sin(10*i),I=Math.cos(10*i),O=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*d/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*u/16+45*i*f/256-i*(32*r-561)*d/4096-i*(232*r-1677)*p/16384+i*(399985-90560*r+512*s)*g/5242880)*x+(21*i*f/256+483*i*d/4096-i*(224*r-1969)*p/16384-i*(33152*r-112599)*g/1048576)*A+(151*i*d/4096+4681*i*p/65536+1479*i*g/16384-453*o*g/32768)*T+(1097*i*p/65536+42783*i*g/1048576)*w+8011*i*g/1048576*I+(3*c/8+3*u/16+213*f/2048-3*r*f/64+255*d/4096-33*r*d/512+20861*p/524288-33*r*p/512+s*p/1024+28273*g/1048576-471*r*g/8192+9*s*g/4096)*m+(21*u/256+21*f/256+533*d/8192-21*r*d/512+197*p/4096-315*r*p/4096+584039*g/16777216-12517*r*g/131072+7*s*g/2048)*C+(151*f/6144+151*d/4096+5019*p/131072-453*r*p/16384+26965*g/786432-8607*r*g/131072)*b+(1097*d/131072+1097*p/65536+225797*g/10485760-1097*r*g/65536)*S+(8011*p/2621440+8011*g/1048576)*D+293393*g/251658240*O}function DA(e,t){if(e===0)return Math.log(Math.tan(.5*(M.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(M.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function a1e(e,t,n,i,r){let o=DA(e._ellipticity,n),s=DA(e._ellipticity,r);return Math.atan2(M.negativePiToPi(i-t),s-o)}function c1e(e,t,n,i,r,o,s){let a=e._heading,c=o-i,u=0;if(M.equalsEpsilon(Math.abs(a),M.PI_OVER_TWO,M.EPSILON8))if(t===n)u=t*Math.cos(r)*M.negativePiToPi(c);else{let f=Math.sin(r);u=t*Math.cos(r)*M.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=D5(e._ellipticity,t,r);u=(D5(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var l1e=new h,v5=new h;function bJ(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,v5),l1e),o=h.normalize(i.cartographicToCartesian(n,v5),v5),s=i.maximumRadius,a=i.minimumRadius,c=s*s,u=a*a;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=me.clone(t,e._start),e._start.height=0,e._end=me.clone(n,e._end),e._end.height=0,e._heading=a1e(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=c1e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function EJ(e,t,n,i,r,o){if(n===0)return me.clone(e,o);let s=r*r,a,c,u;if(Math.abs(M.PI_OVER_TWO-Math.abs(t))>M.EPSILON8){let f=D5(r,i,e.latitude),d=n*Math.cos(t),p=f+d;c=s1e(p,r,i);let g=DA(r,e.latitude),m=DA(r,c);u=Math.tan(t)*(m-g),a=M.negativePiToPi(e.longitude+u)}else{c=e.latitude;let f;if(r===0)f=i*Math.cos(e.latitude);else{let d=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*d*d)}u=n/f,t>0?a=M.negativePiToPi(e.longitude+u):a=M.negativePiToPi(e.longitude-u)}return l(o)?(o.longitude=a,o.latitude=c,o.height=0,o):new me(a,c,0)}function $m(e,t,n){let i=y(n,oe.WGS84);this._ellipsoid=i,this._start=new me,this._end=new me,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&bJ(this,e,t,i)}Object.defineProperties($m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});$m.fromStartHeadingDistance=function(e,t,n,i,r){let o=y(i,oe.WGS84),s=o.maximumRadius,a=o.minimumRadius,c=s*s,u=a*a,f=Math.sqrt((c-u)/c);t=M.negativePiToPi(t);let d=EJ(e,t,n,o.maximumRadius,f);return!l(r)||l(i)&&!i.equals(r.ellipsoid)?new $m(e,d,o):(r.setEndPoints(e,d),r)};$m.prototype.setEndPoints=function(e,t){bJ(this,e,t,this._ellipsoid)};$m.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};$m.prototype.interpolateUsingSurfaceDistance=function(e,t){return EJ(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};$m.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,r=Math.abs(i),o=this._start;if(e=M.negativePiToPi(e),M.equalsEpsilon(Math.abs(e),Math.PI,M.EPSILON14)&&(e=M.sign(o.longitude)*Math.PI),l(t)||(t=new me),Math.abs(M.PI_OVER_TWO-r)<=M.EPSILON8)return t.longitude=e,t.latitude=o.latitude,t.height=0,t;if(M.equalsEpsilon(Math.abs(M.PI_OVER_TWO-r),M.PI_OVER_TWO,M.EPSILON8))return M.equalsEpsilon(e,o.longitude,M.EPSILON12)?void 0:(t.longitude=e,t.latitude=M.PI_OVER_TWO*M.sign(M.PI_OVER_TWO-i),t.height=0,t);let s=o.latitude,a=n*Math.sin(s),c=Math.tan(.5*(M.PI_OVER_TWO+s))*Math.exp((e-o.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=o.latitude,d;do{d=f;let p=n*Math.sin(d),g=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(g/u,n/2))-M.PI_OVER_TWO}while(!M.equalsEpsilon(f,d,M.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};$m.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,r=this._start;if(M.equalsEpsilon(Math.abs(i),M.PI_OVER_TWO,M.EPSILON8))return;let o=DA(n,r.latitude),s=DA(n,e),a=Math.tan(i)*(s-o),c=M.negativePiToPi(r.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new me(c,e,0)};var ka=$m;var RS=Ns(PJ(),1);var FI={CLOCKWISE:Z.CW,COUNTER_CLOCKWISE:Z.CCW};FI.validate=function(e){return e===FI.CLOCKWISE||e===FI.COUNTER_CLOCKWISE};var hs=Object.freeze(FI);var S1e=new h,w1e=new h,B_={};B_.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,r=0;r<t;i=r++){let o=e[i],s=e[r];n+=o.x*s.y-s.x*o.y}return n*.5};B_.computeWindingOrder2D=function(e){return B_.computeArea2D(e)>0?hs.COUNTER_CLOCKWISE:hs.CLOCKWISE};B_.triangulate=function(e,t){let n=W.packArray(e);return(0,RS.default)(n,t,2)};var MJ=new h,BJ=new h,LJ=new h,IJ=new h,OJ=new h,RJ=new h,Zm=new h,NJ=new W,FJ=new W,VJ=new W,IA=new W;B_.computeSubdivision=function(e,t,n,i,r){r=y(r,M.RADIANS_PER_DEGREE);let o=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let T=t[a];if(u[d++]=T.x,u[d++]=T.y,u[d++]=T.z,o){let S=i[a];f[p++]=S.x,f[p++]=S.y}}let g=[],m={},x=e.maximumRadius,C=M.chordLength(r,x),A=C*C;for(;s.length>0;){let T=s.pop(),S=s.pop(),w=s.pop(),D=h.fromArray(u,w*3,MJ),I=h.fromArray(u,S*3,BJ),O=h.fromArray(u,T*3,LJ),B,L,_;o&&(B=W.fromArray(f,w*2,NJ),L=W.fromArray(f,S*2,FJ),_=W.fromArray(f,T*2,VJ));let E=h.multiplyByScalar(h.normalize(D,IJ),x,IJ),v=h.multiplyByScalar(h.normalize(I,OJ),x,OJ),P=h.multiplyByScalar(h.normalize(O,RJ),x,RJ),R=h.magnitudeSquared(h.subtract(E,v,Zm)),F=h.magnitudeSquared(h.subtract(v,P,Zm)),U=h.magnitudeSquared(h.subtract(P,E,Zm)),k=Math.max(R,F,U),H,V,q;k>A?R===k?(H=`${Math.min(w,S)} ${Math.max(w,S)}`,a=m[H],l(a)||(V=h.add(D,I,Zm),h.multiplyByScalar(V,.5,V),u.push(V.x,V.y,V.z),a=u.length/3-1,m[H]=a,o&&(q=W.add(B,L,IA),W.multiplyByScalar(q,.5,q),f.push(q.x,q.y))),s.push(w,a,T),s.push(a,S,T)):F===k?(H=`${Math.min(S,T)} ${Math.max(S,T)}`,a=m[H],l(a)||(V=h.add(I,O,Zm),h.multiplyByScalar(V,.5,V),u.push(V.x,V.y,V.z),a=u.length/3-1,m[H]=a,o&&(q=W.add(L,_,IA),W.multiplyByScalar(q,.5,q),f.push(q.x,q.y))),s.push(S,a,w),s.push(a,T,w)):U===k&&(H=`${Math.min(T,w)} ${Math.max(T,w)}`,a=m[H],l(a)||(V=h.add(O,D,Zm),h.multiplyByScalar(V,.5,V),u.push(V.x,V.y,V.z),a=u.length/3-1,m[H]=a,o&&(q=W.add(_,B,IA),W.multiplyByScalar(q,.5,q),f.push(q.x,q.y))),s.push(T,a,S),s.push(a,w,S)):(g.push(w),g.push(S),g.push(T))}let b={attributes:{position:new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Me.TRIANGLES};return o&&(b.attributes.st=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:f})),new ot(b)};var v1e=new me,D1e=new me,P1e=new me,M5=new me;B_.computeRhumbLineSubdivision=function(e,t,n,i,r){r=y(r,M.RADIANS_PER_DEGREE);let o=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let w=t[a];if(u[d++]=w.x,u[d++]=w.y,u[d++]=w.z,o){let D=i[a];f[p++]=D.x,f[p++]=D.y}}let g=[],m={},x=e.maximumRadius,C=M.chordLength(r,x),A=new ka(void 0,void 0,e),b=new ka(void 0,void 0,e),T=new ka(void 0,void 0,e);for(;s.length>0;){let w=s.pop(),D=s.pop(),I=s.pop(),O=h.fromArray(u,I*3,MJ),B=h.fromArray(u,D*3,BJ),L=h.fromArray(u,w*3,LJ),_,E,v;o&&(_=W.fromArray(f,I*2,NJ),E=W.fromArray(f,D*2,FJ),v=W.fromArray(f,w*2,VJ));let P=e.cartesianToCartographic(O,v1e),R=e.cartesianToCartographic(B,D1e),F=e.cartesianToCartographic(L,P1e);A.setEndPoints(P,R);let U=A.surfaceDistance;b.setEndPoints(R,F);let k=b.surfaceDistance;T.setEndPoints(F,P);let H=T.surfaceDistance,V=Math.max(U,k,H),q,j,X,G,$;V>C?U===V?(q=`${Math.min(I,D)} ${Math.max(I,D)}`,a=m[q],l(a)||(j=A.interpolateUsingFraction(.5,M5),X=(P.height+R.height)*.5,G=h.fromRadians(j.longitude,j.latitude,X,e,Zm),u.push(G.x,G.y,G.z),a=u.length/3-1,m[q]=a,o&&($=W.add(_,E,IA),W.multiplyByScalar($,.5,$),f.push($.x,$.y))),s.push(I,a,w),s.push(a,D,w)):k===V?(q=`${Math.min(D,w)} ${Math.max(D,w)}`,a=m[q],l(a)||(j=b.interpolateUsingFraction(.5,M5),X=(R.height+F.height)*.5,G=h.fromRadians(j.longitude,j.latitude,X,e,Zm),u.push(G.x,G.y,G.z),a=u.length/3-1,m[q]=a,o&&($=W.add(E,v,IA),W.multiplyByScalar($,.5,$),f.push($.x,$.y))),s.push(D,a,I),s.push(a,w,I)):H===V&&(q=`${Math.min(w,I)} ${Math.max(w,I)}`,a=m[q],l(a)||(j=T.interpolateUsingFraction(.5,M5),X=(F.height+P.height)*.5,G=h.fromRadians(j.longitude,j.latitude,X,e,Zm),u.push(G.x,G.y,G.z),a=u.length/3-1,m[q]=a,o&&($=W.add(v,_,IA),W.multiplyByScalar($,.5,$),f.push($.x,$.y))),s.push(w,a,D),s.push(a,I,D)):(g.push(I),g.push(D),g.push(w))}let S={attributes:{position:new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Me.TRIANGLES};return o&&(S.attributes.st=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:f})),new ot(S)};B_.scaleToGeodeticHeight=function(e,t,n,i){n=y(n,oe.WGS84);let r=S1e,o=w1e;if(t=y(t,0),i=y(i,!0),l(e)){let s=e.length;for(let a=0;a<s;a+=3)h.fromArray(e,a,o),i&&(o=n.scaleToGeodeticSurface(o,o)),t!==0&&(r=n.geodeticSurfaceNormal(o,r),h.multiplyByScalar(r,t,r),h.add(o,r,o)),e[a]=o.x,e[a+1]=o.y,e[a+2]=o.z}return e};var si=B_;function L_(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(L_.prototype,{length:{get:function(){return this._length}}});L_.prototype.enqueue=function(e){this._array.push(e),this._length++};L_.prototype.dequeue=function(){if(this._length===0)return;let e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};L_.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};L_.prototype.contains=function(e){return this._array.indexOf(e)!==-1};L_.prototype.clear=function(){this._array.length=this._offset=this._length=0};L_.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var rl=L_;var co={};co.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let r=i.pop();if(!l(r))continue;n+=2;let o=r.positions,s=r.holes;if(l(o)&&o.length>0&&(n+=o.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c<a;++c)i.push(s[c])}}return n};co.packPolygonHierarchy=function(e,t,n,i){let r=[e];for(;r.length>0;){let o=r.pop();if(!l(o))continue;let s=o.positions,a=o.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let u=0;u<c;++u,n+=i.packedLength)i.pack(s[u],t,n)}if(l(a)){let c=a.length;for(let u=0;u<c;++u)r.push(a[u])}}return n};co.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],r=e[t++],o=new Array(i),s=r>0?new Array(r):void 0;for(let a=0;a<i;++a,t+=n.packedLength)o[a]=n.unpack(e,t);for(let a=0;a<r;++a)s[a]=co.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:o,holes:s,startingIndex:t}};var Sy=new W;function HJ(e,t,n,i){return W.subtract(t,e,Sy),W.multiplyByScalar(Sy,n/i,Sy),W.add(e,Sy,Sy),[Sy.x,Sy.y]}var N_=new h;function I1e(e,t,n,i){return h.subtract(t,e,N_),h.multiplyByScalar(N_,n/i,N_),h.add(e,N_,N_),[N_.x,N_.y,N_.z]}co.subdivideLineCount=function(e,t,n){let r=h.distance(e,t)/n,o=Math.max(0,Math.ceil(M.log2(r)));return Math.pow(2,o)};var B5=new me,L5=new me,O1e=new me,R1e=new h,kJ=new ka;co.subdivideRhumbLineCount=function(e,t,n,i){let r=e.cartesianToCartographic(t,B5),o=e.cartesianToCartographic(n,L5),a=new ka(r,o,e).surfaceDistance/i,c=Math.max(0,Math.ceil(M.log2(a)));return Math.pow(2,c)};co.subdivideTexcoordLine=function(e,t,n,i,r,o){let s=co.subdivideLineCount(n,i,r),a=W.distance(e,t),c=a/s,u=o;u.length=s*2;let f=0;for(let d=0;d<s;d++){let p=HJ(e,t,d*c,a);u[f++]=p[0],u[f++]=p[1]}return u};co.subdivideLine=function(e,t,n,i){let r=co.subdivideLineCount(e,t,n),o=h.distance(e,t),s=o/r;l(i)||(i=[]);let a=i;a.length=r*3;let c=0;for(let u=0;u<r;u++){let f=I1e(e,t,u*s,o);a[c++]=f[0],a[c++]=f[1],a[c++]=f[2]}return a};co.subdivideTexcoordRhumbLine=function(e,t,n,i,r,o,s){let a=n.cartesianToCartographic(i,B5),c=n.cartesianToCartographic(r,L5);kJ.setEndPoints(a,c);let u=kJ.surfaceDistance/o,f=Math.max(0,Math.ceil(M.log2(u))),d=Math.pow(2,f),p=W.distance(e,t),g=p/d,m=s;m.length=d*2;let x=0;for(let C=0;C<d;C++){let A=HJ(e,t,C*g,p);m[x++]=A[0],m[x++]=A[1]}return m};co.subdivideRhumbLine=function(e,t,n,i,r){let o=e.cartesianToCartographic(t,B5),s=e.cartesianToCartographic(n,L5),a=new ka(o,s,e),c=a.surfaceDistance/i,u=Math.max(0,Math.ceil(M.log2(c))),f=Math.pow(2,u),d=a.surfaceDistance/f;l(r)||(r=[]);let p=r;p.length=f*3;let g=0;for(let m=0;m<f;m++){let x=a.interpolateUsingSurfaceDistance(m*d,O1e),C=e.cartographicToCartesian(x,R1e);p[g++]=C.x,p[g++]=C.y,p[g++]=C.z}return p};var M1e=new h,B1e=new h,L1e=new h,N1e=new h;co.scaleToGeodeticHeightExtruded=function(e,t,n,i,r){i=y(i,oe.WGS84);let o=M1e,s=B1e,a=L1e,c=N1e;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let d=0;d<f;d+=3)h.fromArray(u,d,a),i.geodeticSurfaceNormal(a,o),c=i.scaleToGeodeticSurface(a,c),s=h.multiplyByScalar(o,n,s),s=h.add(c,s,s),u[d+f]=s.x,u[d+1+f]=s.y,u[d+2+f]=s.z,r&&(c=h.clone(a,c)),s=h.multiplyByScalar(o,t,s),s=h.add(c,s,s),u[d]=s.x,u[d+1]=s.y,u[d+2]=s.z}return e};co.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],r=new rl;r.enqueue(e);let o,s,a;for(;r.length!==0;){let c=r.dequeue(),u=c.positions;if(t)for(a=u.length,o=0;o<a;o++)n.scaleToGeodeticSurface(u[o],u[o]);if(u=vr(u,h.equalsEpsilon,!0),u.length<3)continue;let f=c.holes?c.holes.length:0;for(o=0;o<f;o++){let d=c.holes[o],p=d.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=vr(p,h.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(l(d.holes)&&(g=d.holes.length),s=0;s<g;s++)r.enqueue(d.holes[s])}i.push(u)}return i};co.polygonsFromHierarchy=function(e,t,n,i,r){let o=[],s=[],a=new rl;for(a.enqueue(e);a.length!==0;){let c=a.dequeue(),u=c.positions,f=c.holes,d,p;if(i)for(p=u.length,d=0;d<p;d++)r.scaleToGeodeticSurface(u[d],u[d]);if(t||(u=vr(u,h.equalsEpsilon,!0)),u.length<3)continue;let g=n(u);if(!l(g))continue;let m=[],x=si.computeWindingOrder2D(g);x===hs.CLOCKWISE&&(g.reverse(),u=u.slice().reverse());let C=u.slice(),A=l(f)?f.length:0,b=[],T;for(d=0;d<A;d++){let S=f[d],w=S.positions;if(i)for(p=w.length,T=0;T<p;++T)r.scaleToGeodeticSurface(w[T],w[T]);if(t||(w=vr(w,h.equalsEpsilon,!0)),w.length<3)continue;let D=n(w);if(!l(D))continue;x=si.computeWindingOrder2D(D),x===hs.CLOCKWISE&&(D.reverse(),w=w.slice().reverse()),b.push(w),m.push(C.length),C=C.concat(w),g=g.concat(D);let I=0;for(l(S.holes)&&(I=S.holes.length),T=0;T<I;T++)a.enqueue(S.holes[T])}o.push({outerRing:u,holes:b}),s.push({positions:C,positions2D:g,holes:m})}return{hierarchy:o,polygons:s}};var F1e=new W,V1e=new h,k1e=new Re,U1e=new Q;co.computeBoundingRectangle=function(e,t,n,i,r){let o=Re.fromAxisAngle(e,i,k1e),s=Q.fromQuaternion(o,U1e),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,d=n.length;for(let p=0;p<d;++p){let g=h.clone(n[p],V1e);Q.multiplyByVector(s,g,g);let m=t(g,F1e);l(m)&&(a=Math.min(a,m.x),c=Math.max(c,m.x),u=Math.min(u,m.y),f=Math.max(f,m.y))}return r.x=a,r.y=u,r.width=c-a,r.height=f-u,r};co.createGeometryFromPositions=function(e,t,n,i,r,o,s){let a=si.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,u=l(n),f=u?n.positions:void 0;if(r){let d=c.length,p=new Array(d*3),g=0;for(let C=0;C<d;C++){let A=c[C];p[g++]=A.x,p[g++]=A.y,p[g++]=A.z}let m={attributes:{position:new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Me.TRIANGLES};u&&(m.attributes.st=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:W.packArray(f)}));let x=new ot(m);return o.normal?Bn.computeNormal(x):x}if(s===Kt.GEODESIC)return si.computeSubdivision(e,c,a,f,i);if(s===Kt.RHUMB)return si.computeRhumbLineSubdivision(e,c,a,f,i)};var UJ=[],zJ=[],z1e=new h,H1e=new h;co.computeWallGeometry=function(e,t,n,i,r,o){let s,a,c,u,f,d,p,g,m,x=e.length,C=0,A=0,b=l(t),T=b?t.positions:void 0;if(r)for(a=x*3*2,s=new Array(a*2),b&&(m=x*2*2,g=new Array(m*2)),c=0;c<x;c++)u=e[c],f=e[(c+1)%x],s[C]=s[C+a]=u.x,++C,s[C]=s[C+a]=u.y,++C,s[C]=s[C+a]=u.z,++C,s[C]=s[C+a]=f.x,++C,s[C]=s[C+a]=f.y,++C,s[C]=s[C+a]=f.z,++C,b&&(d=T[c],p=T[(c+1)%x],g[A]=g[A+m]=d.x,++A,g[A]=g[A+m]=d.y,++A,g[A]=g[A+m]=p.x,++A,g[A]=g[A+m]=p.y,++A);else{let O=M.chordLength(i,n.maximumRadius),B=0;if(o===Kt.GEODESIC)for(c=0;c<x;c++)B+=co.subdivideLineCount(e[c],e[(c+1)%x],O);else if(o===Kt.RHUMB)for(c=0;c<x;c++)B+=co.subdivideRhumbLineCount(n,e[c],e[(c+1)%x],O);for(a=(B+x)*3,s=new Array(a*2),b&&(m=(B+x)*2,g=new Array(m*2)),c=0;c<x;c++){u=e[c],f=e[(c+1)%x];let L,_;b&&(d=T[c],p=T[(c+1)%x]),o===Kt.GEODESIC?(L=co.subdivideLine(u,f,O,zJ),b&&(_=co.subdivideTexcoordLine(d,p,u,f,O,UJ))):o===Kt.RHUMB&&(L=co.subdivideRhumbLine(n,u,f,O,zJ),b&&(_=co.subdivideTexcoordRhumbLine(d,p,n,u,f,O,UJ)));let E=L.length;for(let v=0;v<E;++v,++C)s[C]=L[v],s[C+a]=L[v];if(s[C]=f.x,s[C+a]=f.x,++C,s[C]=f.y,s[C+a]=f.y,++C,s[C]=f.z,s[C+a]=f.z,++C,b){let v=_.length;for(let P=0;P<v;++P,++A)g[A]=_[P],g[A+m]=_[P];g[A]=p.x,g[A+m]=p.x,++A,g[A]=p.y,g[A+m]=p.y,++A}}}x=s.length;let S=Le.createTypedArray(x/3,x-e.length*6),w=0;for(x/=6,c=0;c<x;c++){let O=c,B=O+1,L=O+x,_=L+1;u=h.fromArray(s,O*3,z1e),f=h.fromArray(s,B*3,H1e),!h.equalsEpsilon(u,f,M.EPSILON10,M.EPSILON10)&&(S[w++]=O,S[w++]=L,S[w++]=B,S[w++]=B,S[w++]=L,S[w++]=_)}let D={attributes:new dn({position:new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:s})}),indices:S,primitiveType:Me.TRIANGLES};return b&&(D.attributes.st=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:g})),new ot(D)};var Hn=co;var G1e=new h,W1e=new je,j1e=new W,q1e=new W,Y1e=new h,X1e=new h,K1e=new h,MS=new h,$1e=new h,Z1e=new h,GJ=new Re,J1e=new Q,Q1e=new Q,ePe=new h;function tPe(e,t,n,i,r,o,s,a,c){let u=e.positions,f=si.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let d=Le.createTypedArray(u.length,f.length);d.set(f);let p=J1e;if(i!==0){let _=Re.fromAxisAngle(s,i,GJ);if(p=Q.fromQuaternion(_,p),t.tangent||t.bitangent){_=Re.fromAxisAngle(s,-i,GJ);let E=Q.fromQuaternion(_,Q1e);a=h.normalize(Q.multiplyByVector(E,a,a),a),t.bitangent&&(c=h.normalize(h.cross(s,a,c),c))}}else p=Q.clone(Q.IDENTITY,p);let g=q1e;t.st&&(g.x=n.x,g.y=n.y);let m=u.length,x=m*3,C=new Float64Array(x),A=t.normal?new Float32Array(x):void 0,b=t.tangent?new Float32Array(x):void 0,T=t.bitangent?new Float32Array(x):void 0,S=t.st?new Float32Array(m*2):void 0,w=0,D=0,I=0,O=0,B=0;for(let _=0;_<m;_++){let E=u[_];if(C[w++]=E.x,C[w++]=E.y,C[w++]=E.z,t.st)if(l(r)&&r.positions.length===m)S[B++]=r.positions[_].x,S[B++]=r.positions[_].y;else{let v=Q.multiplyByVector(p,E,G1e),P=o(v,j1e);W.subtract(P,g,P);let R=M.clamp(P.x/n.width,0,1),F=M.clamp(P.y/n.height,0,1);S[B++]=R,S[B++]=F}t.normal&&(A[D++]=s.x,A[D++]=s.y,A[D++]=s.z),t.tangent&&(b[O++]=a.x,b[O++]=a.y,b[O++]=a.z),t.bitangent&&(T[I++]=c.x,T[I++]=c.y,T[I++]=c.z)}let L=new dn;return t.position&&(L.position=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:C})),t.normal&&(L.normal=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(L.tangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:b})),t.bitangent&&(L.bitangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:T})),t.st&&(L.st=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:S})),new ot({attributes:L,indices:d,primitiveType:Me.TRIANGLES})}function wy(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy,n=e.textureCoordinates,i=y(e.vertexFormat,Pe.DEFAULT);this._vertexFormat=Pe.clone(i),this._polygonHierarchy=t,this._stRotation=y(e.stRotation,0),this._ellipsoid=oe.clone(y(e.ellipsoid,oe.WGS84)),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=Hn.computeHierarchyPackedLength(t,h)+Pe.packedLength+oe.packedLength+(l(n)?Hn.computeHierarchyPackedLength(n,W):1)+2}wy.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new wy(t)};wy.pack=function(e,t,n){return n=y(n,0),n=Hn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=Hn.packPolygonHierarchy(e._textureCoordinates,t,n,W):t[n++]=-1,t[n++]=e.packedLength,t};var nPe=oe.clone(oe.UNIT_SPHERE),iPe=new Pe,rPe={polygonHierarchy:{}};wy.unpack=function(e,t,n){t=y(t,0);let i=Hn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=oe.unpack(e,t,nPe);t+=oe.packedLength;let o=Pe.unpack(e,t,iPe);t+=Pe.packedLength;let s=e[t++],a=e[t]===-1?void 0:Hn.unpackPolygonHierarchy(e,t,W);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t++];return l(n)||(n=new wy(rPe)),n._polygonHierarchy=i,n._ellipsoid=oe.clone(r,n._ellipsoid),n._vertexFormat=Pe.clone(o,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};wy.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,r=e._textureCoordinates,o=l(r),s=n.positions;if(s=vr(s,h.equalsEpsilon,!0),s.length<3)return;let a=Y1e,c=X1e,u=K1e,f=$1e,d=Z1e;if(!M_.computeProjectTo2DArguments(s,MS,f,d))return;if(a=h.cross(f,d,a),a=h.normalize(a,a),!h.equalsEpsilon(MS,h.ZERO,M.EPSILON6)){let B=e._ellipsoid.geodeticSurfaceNormal(MS,ePe);h.dot(a,B)<0&&(a=h.negate(a,a),f=h.negate(f,f))}let g=M_.createProjectPointsTo2DFunction(MS,f,d),m=M_.createProjectPointTo2DFunction(MS,f,d);t.tangent&&(c=h.clone(f,c)),t.bitangent&&(u=h.clone(d,u));let x=Hn.polygonsFromHierarchy(n,o,g,!1),C=x.hierarchy,A=x.polygons,b=function(B){return B},T=o?Hn.polygonsFromHierarchy(r,!0,b,!1).polygons:void 0;if(C.length===0)return;s=C[0].outerRing;let S=re.fromPoints(s),w=Hn.computeBoundingRectangle(a,m,s,i,W1e),D=[];for(let B=0;B<A.length;B++){let L=new pt({geometry:tPe(A[B],t,w,i,o?T[B]:void 0,m,a,c,u)});D.push(L)}let I=Bn.combineInstances(D)[0];I.attributes.position.values=new Float64Array(I.attributes.position.values),I.indices=Le.createTypedArray(I.attributes.position.values.length/3,I.indices);let O=I.attributes;return t.position||delete O.position,new ot({attributes:O,indices:I.indices,primitiveType:I.primitiveType,boundingSphere:S})};var VI=wy;function oPe(e){let t=e.length,n=new Float64Array(t*3),i=Le.createTypedArray(t,t*2),r=0,o=0;for(let a=0;a<t;a++){let c=e[a];n[r++]=c.x,n[r++]=c.y,n[r++]=c.z,i[o++]=a,i[o++]=(a+1)%t}let s=new dn({position:new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:n})});return new ot({attributes:s,indices:i,primitiveType:Me.LINES})}function vy(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=Hn.computeHierarchyPackedLength(t,h)+1}vy.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions}};return new vy(t)};vy.pack=function(e,t,n){return n=y(n,0),n=Hn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var sPe={polygonHierarchy:{}};vy.unpack=function(e,t,n){t=y(t,0);let i=Hn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=e[t];return l(n)||(n=new vy(sPe)),n._polygonHierarchy=i,n.packedLength=r,n};vy.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=vr(n,h.equalsEpsilon,!0),n.length<3||!M_.validOutline(n))return;let r=Hn.polygonOutlinesFromHierarchy(t,!1);if(r.length===0)return;let o=[];for(let c=0;c<r.length;c++){let u=new pt({geometry:oPe(r[c])});o.push(u)}let s=Bn.combineInstances(o)[0],a=re.fromPoints(t.positions);return new ot({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var Qf=vy;var aPe={ROUNDED:0,MITERED:1,BEVELED:2},Li=Object.freeze(aPe);function cPe(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,r=(n-i)/n,o=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-r)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),u=c*a,f=Math.atan2(a,o),d=c*s,p=d*d,g=1-p,m=Math.sqrt(g),x=t/4,C=x*x,A=C*x,b=C*C,T=1+x-3*C/4+5*A/4-175*b/64,S=1-x+15*C/8-35*A/8,w=1-3*x+35*C/4,D=1-5*x,I=T*f-S*Math.sin(2*f)*x/2-w*Math.sin(4*f)*C/16-D*Math.sin(6*f)*A/48-Math.sin(8*f)*5*b/512,O=e._constants;O.a=n,O.b=i,O.f=r,O.cosineHeading=o,O.sineHeading=s,O.tanU=a,O.cosineU=c,O.sineU=u,O.sigma=f,O.sineAlpha=d,O.sineSquaredAlpha=p,O.cosineSquaredAlpha=g,O.cosineAlpha=m,O.u2Over4=x,O.u4Over16=C,O.u6Over64=A,O.u8Over256=b,O.a0=T,O.a1=S,O.a2=w,O.a3=D,O.distanceRatio=I}function lPe(e,t){return e*t*(4+e*(4-3*t))/16}function WJ(e,t,n,i,r,o,s){let a=lPe(e,n);return(1-a)*e*t*(i+a*r*(s+a*o*(2*s*s-1)))}function uPe(e,t,n,i,r,o,s){let a=(t-n)/t,c=o-i,u=Math.atan((1-a)*Math.tan(r)),f=Math.atan((1-a)*Math.tan(s)),d=Math.cos(u),p=Math.sin(u),g=Math.cos(f),m=Math.sin(f),x=d*g,C=d*m,A=p*m,b=p*g,T=c,S=M.TWO_PI,w=Math.cos(T),D=Math.sin(T),I,O,B,L,_;do{w=Math.cos(T),D=Math.sin(T);let V=C-b*w;B=Math.sqrt(g*g*D*D+V*V),O=A+x*w,I=Math.atan2(B,O);let q;B===0?(q=0,L=1):(q=x*D/B,L=1-q*q),S=T,_=O-2*A/L,isFinite(_)||(_=0),T=c+WJ(a,q,L,I,B,O,_)}while(Math.abs(T-S)>M.EPSILON12);let E=L*(t*t-n*n)/(n*n),v=1+E*(4096+E*(E*(320-175*E)-768))/16384,P=E*(256+E*(E*(74-47*E)-128))/1024,R=_*_,F=P*B*(_+P*(O*(2*R-1)-P*_*(4*B*B-3)*(4*R-3)/6)/4),U=n*v*(I-F),k=Math.atan2(g*D,C-b*w),H=Math.atan2(d*D,C*w-b);e._distance=U,e._startHeading=k,e._endHeading=H,e._uSquared=E}var fPe=new h,N5=new h;function jJ(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,N5),fPe),o=h.normalize(i.cartographicToCartesian(n,N5),N5);uPe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=me.clone(t,e._start),e._end=me.clone(n,e._end),e._start.height=0,e._end.height=0,cPe(e)}function BS(e,t,n){let i=y(n,oe.WGS84);this._ellipsoid=i,this._start=new me,this._end=new me,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&jJ(this,e,t,i)}Object.defineProperties(BS.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});BS.prototype.setEndPoints=function(e,t){jJ(this,e,t,this._ellipsoid)};BS.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};BS.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,r=Math.cos(2*i),o=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),d=i*i,p=i*d,g=n.u8Over256,m=n.u2Over4,x=n.u6Over64,C=n.u4Over16,A=2*p*g*r/3+i*(1-m+7*C/4-15*x/4+579*g/64-(C-15*x/4+187*g/16)*r-(5*x/4-115*g/16)*o-29*g*s/16)+(m/2-C+71*x/32-85*g/16)*a+(5*C/16-5*x/4+383*g/96)*c-d*((x-11*g/2)*a+5*g*c/2)+(29*x/96-29*g/16)*u+539*g*f/1536,b=Math.asin(Math.sin(A)*n.cosineAlpha),T=Math.atan(n.a/n.b*Math.tan(b));A=A-n.sigma;let S=Math.cos(2*n.sigma+A),w=Math.sin(A),D=Math.cos(A),I=n.cosineU*D,O=n.sineU*w,L=Math.atan2(w*n.sineHeading,I-O*n.cosineHeading)-WJ(n.f,n.sineAlpha,n.cosineSquaredAlpha,A,w,D,S);return l(t)?(t.longitude=this._start.longitude+L,t.latitude=T,t.height=0,t):new me(this._start.longitude+L,T,0)};var ed=BS;var yc={};yc.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};yc.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var dPe=new me;yc.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let r=0;r<n;r++){let o=e[r];i[r]=t.cartesianToCartographic(o,dPe).height}return i};var hPe=new N,mPe=new h,qJ=new h,pPe=new an(h.UNIT_X,0),YJ=new h,_Pe=new an(h.UNIT_X,0),gPe=new h,yPe=new h,V5=[];function KJ(e,t,n){let i=V5;i.length=e;let r;if(t===n){for(r=0;r<e;r++)i[r]=t;return i}let s=(n-t)/e;for(r=0;r<e;r++){let a=t+r*s;i[r]=a}return i}var UI=new me,kI=new me,F_=new h,k5=new h,xPe=new h,F5=new ed,LS=new ka;function CPe(e,t,n,i,r,o,s,a){let c=i.scaleToGeodeticSurface(e,k5),u=i.scaleToGeodeticSurface(t,xPe),f=yc.numberOfPoints(e,t,n),d=i.cartesianToCartographic(c,UI),p=i.cartesianToCartographic(u,kI),g=KJ(f,r,o);F5.setEndPoints(d,p);let m=F5.surfaceDistance/f,x=a;d.height=r;let C=i.cartographicToCartesian(d,F_);h.pack(C,s,x),x+=3;for(let A=1;A<f;A++){let b=F5.interpolateUsingSurfaceDistance(A*m,kI);b.height=g[A],C=i.cartographicToCartesian(b,F_),h.pack(C,s,x),x+=3}return x}function APe(e,t,n,i,r,o,s,a){let c=i.cartesianToCartographic(e,UI),u=i.cartesianToCartographic(t,kI),f=yc.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let d=KJ(f,r,o);LS.ellipsoid.equals(i)||(LS=new ka(void 0,void 0,i)),LS.setEndPoints(c,u);let p=LS.surfaceDistance/f,g=a;c.height=r;let m=i.cartographicToCartesian(c,F_);h.pack(m,s,g),g+=3;for(let x=1;x<f;x++){let C=LS.interpolateUsingSurfaceDistance(x*p,kI);C.height=d[x],m=i.cartographicToCartesian(C,F_),h.pack(m,s,g),g+=3}return g}yc.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=y(t,N.IDENTITY);let r=N.inverseTransformation(t,hPe),o=N.multiplyByPoint(r,h.ZERO,mPe),s=h.normalize(N.multiplyByPointAsVector(r,h.UNIT_Y,qJ),qJ),a=an.fromPointNormal(o,s,pPe),c=h.normalize(N.multiplyByPointAsVector(r,h.UNIT_X,YJ),YJ),u=an.fromPointNormal(o,c,_Pe),f=1;n.push(h.clone(e[0]));let d=n[0],p=e.length;for(let g=1;g<p;++g){let m=e[g];if(an.getPointDistance(u,d)<0||an.getPointDistance(u,m)<0){let x=er.lineSegmentPlane(d,m,a,gPe);if(l(x)){let C=h.multiplyByScalar(s,5e-9,yPe);an.getPointDistance(a,d)<0&&h.negate(C,C),n.push(h.add(x,C,new h)),i.push(f+1),h.negate(C,C),n.push(h.add(x,C,new h)),f=1}}n.push(h.clone(e[g])),f++,d=m}i.push(f)}return{positions:n,lengths:i}};yc.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,oe.WGS84),r=y(e.height,0),o=Array.isArray(r);if(n<1)return[];if(n===1){let x=i.scaleToGeodeticSurface(t[0],k5);if(r=o?r[0]:r,r!==0){let C=i.geodeticSurfaceNormal(x,F_);h.multiplyByScalar(C,r,C),h.add(x,C,x)}return[x.x,x.y,x.z]}let s=e.minDistance;if(!l(s)){let x=y(e.granularity,M.RADIANS_PER_DEGREE);s=M.chordLength(x,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=yc.numberOfPoints(t[c],t[c+1],s);let u=(a+1)*3,f=new Array(u),d=0;for(c=0;c<n-1;c++){let x=t[c],C=t[c+1],A=o?r[c]:r,b=o?r[c+1]:r;d=CPe(x,C,s,i,A,b,f,d)}V5.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,UI);g.height=o?r[n-1]:r;let m=i.cartographicToCartesian(g,F_);return h.pack(m,f,u-3),f};var XJ=new me,TPe=new me;yc.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,oe.WGS84),r=y(e.height,0),o=Array.isArray(r);if(n<1)return[];if(n===1){let A=i.scaleToGeodeticSurface(t[0],k5);if(r=o?r[0]:r,r!==0){let b=i.geodeticSurfaceNormal(A,F_);h.multiplyByScalar(b,r,b),h.add(A,b,A)}return[A.x,A.y,A.z]}let s=y(e.granularity,M.RADIANS_PER_DEGREE),a=0,c,u=i.cartesianToCartographic(t[0],XJ),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],TPe),a+=yc.numberOfPointsRhumbLine(u,f,s),u=me.clone(f,XJ);let d=(a+1)*3,p=new Array(d),g=0;for(c=0;c<n-1;c++){let A=t[c],b=t[c+1],T=o?r[c]:r,S=o?r[c+1]:r;g=APe(A,b,s,i,T,S,p,g)}V5.length=0;let m=t[n-1],x=i.cartesianToCartographic(m,UI);x.height=o?r[n-1]:r;let C=i.cartographicToCartesian(x,F_);return h.pack(C,p,d-3),p};yc.generateCartesianArc=function(e){let t=yc.generateArc(e),n=t.length/3,i=new Array(n);for(let r=0;r<n;r++)i[r]=h.unpack(t,r*3);return i};yc.generateCartesianRhumbArc=function(e){let t=yc.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let r=0;r<n;r++)i[r]=h.unpack(t,r*3);return i};var Ni=yc;var ks=[new h,new h],bPe=new h,EPe=new h,SPe=new h,wPe=new h,vPe=new h,DPe=new h,PPe=new h,IPe=new h,OPe=new h,OA=new h,zI=new h,NS={},U5=new me;function RPe(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let r=e[i];U5=t.cartesianToCartographic(r,U5),n[i]=U5.height,e[i]=t.scaleToGeodeticSurface(r,r)}return n}function z5(e,t,n,i){let r=e[0],o=e[1],s=h.angleBetween(r,o),a=Math.ceil(s/i),c=new Array(a),u;if(t===n){for(u=0;u<a;u++)c[u]=t;return c.push(n),c}let d=(n-t)/a;for(u=1;u<a;u++){let p=t+u*d;c[u]=p}return c[0]=t,c.push(n),c}var HI=new h,GI=new h;function MPe(e,t,n,i){let r=new La(n,i),o=r.projectPointOntoPlane(h.add(n,e,HI),HI),s=r.projectPointOntoPlane(h.add(n,t,GI),GI),a=W.angleBetween(o,s);return s.x*o.y-s.y*o.x>=0?-a:a}var BPe=new h(-1,0,0),Dy=new N,LPe=new N,H5=new Q,NPe=Q.IDENTITY.clone(),FPe=new h,VPe=new se,$J=new h;function Jm(e,t,n,i,r,o,s,a){let c=FPe,u=VPe;Dy=yt.eastNorthUpToFixedFrame(e,r,Dy),c=N.multiplyByPointAsVector(Dy,BPe,c),c=h.normalize(c,c);let f=MPe(c,t,e,r);H5=Q.fromRotationZ(f,H5),$J.z=o,Dy=N.multiplyTransformation(Dy,N.fromRotationTranslation(H5,$J,LPe),Dy);let d=NPe;d[0]=s;for(let p=0;p<a;p++)for(let g=0;g<n.length;g+=3)u=h.fromArray(n,g,u),u=Q.multiplyByVector(d,u,u),u=N.multiplyByPoint(Dy,u,u),i.push(u.x,u.y,u.z);return i}var kPe=new h;function G5(e,t,n,i,r,o,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,kPe);i=Jm(c,t,n,i,r,o[a/3],s,1)}return i}function UPe(e,t){let n=e.length,i=new Array(n*6),r=0,o=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[r++]=a.x-o,i[r++]=0,i[r++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let u=a.x-o,f=a.y-s;i[r++]=u,i[r++]=0,i[r++]=f,i[r++]=u,i[r++]=0,i[r++]=f}return a=e[0],i[r++]=a.x-o,i[r++]=0,i[r++]=a.y-s,i}function ZJ(e,t){let n=e.length,i=new Array(n*3),r=0,o=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[r++]=e[a].x-o,i[r++]=0,i[r++]=e[a].y-s;return i}var JJ=new Re,QJ=new h,eQ=new Q;function tQ(e,t,n,i,r,o,s,a,c,u){let f=h.angleBetween(h.subtract(t,e,OA),h.subtract(n,e,zI)),d=i===Li.BEVELED?0:Math.ceil(f/M.toRadians(5)),p;r?p=Q.fromQuaternion(Re.fromAxisAngle(h.negate(e,OA),f/(d+1),JJ),eQ):p=Q.fromQuaternion(Re.fromAxisAngle(e,f/(d+1),JJ),eQ);let g,m;if(t=h.clone(t,QJ),d>0){let x=u?2:1;for(let C=0;C<d;C++)t=Q.multiplyByVector(p,t,t),g=h.subtract(t,e,OA),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,zI),s=Jm(m,g,a,s,o,c,1,x)}else g=h.subtract(t,e,OA),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,zI),s=Jm(m,g,a,s,o,c,1,1),n=h.clone(n,QJ),g=h.subtract(n,e,OA),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(n,zI),s=Jm(m,g,a,s,o,c,1,1);return s}NS.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,r=0;r<t;i=r++){let o=e[i],s=e[r];W.equals(o,s)||n.push(s)}return n};NS.angleIsGreaterThanPi=function(e,t,n,i){let r=new La(n,i),o=r.projectPointOntoPlane(h.add(n,e,HI),HI),s=r.projectPointOntoPlane(h.add(n,t,GI),GI);return s.x*o.y-s.y*o.x>=0};var zPe=new h,HPe=new h;NS.computePositions=function(e,t,n,i,r){let o=i._ellipsoid,s=RPe(e,o),a=i._granularity,c=i._cornerType,u=r?UPe(t,n):ZJ(t,n),f=r?ZJ(t,n):void 0,d=n.height/2,p=n.width/2,g=e.length,m=[],x=r?[]:void 0,C=bPe,A=EPe,b=SPe,T=wPe,S=vPe,w=DPe,D=PPe,I=IPe,O=OPe,B=e[0],L=e[1];T=o.geodeticSurfaceNormal(B,T),C=h.subtract(L,B,C),C=h.normalize(C,C),I=h.cross(T,C,I),I=h.normalize(I,I);let _=s[0],E=s[1];r&&(x=Jm(B,I,f,x,o,_+d,1,1)),O=h.clone(B,O),B=L,A=h.negate(C,A);let v,P;for(let U=1;U<g-1;U++){let k=r?2:1;if(L=e[U+1],B.equals(L)){Lt("Positions are too close and are considered equivalent with rounding error.");continue}C=h.subtract(L,B,C),C=h.normalize(C,C),b=h.add(C,A,b),b=h.normalize(b,b),T=o.geodeticSurfaceNormal(B,T);let H=h.multiplyByScalar(T,h.dot(C,T),zPe);h.subtract(C,H,H),h.normalize(H,H);let V=h.multiplyByScalar(T,h.dot(A,T),HPe);if(h.subtract(A,V,V),h.normalize(V,V),!M.equalsEpsilon(Math.abs(h.dot(H,V)),1,M.EPSILON7)){b=h.cross(b,T,b),b=h.cross(T,b,b),b=h.normalize(b,b);let j=1/Math.max(.25,h.magnitude(h.cross(b,A,OA))),X=NS.angleIsGreaterThanPi(C,A,B,o);X?(S=h.add(B,h.multiplyByScalar(b,j*p,b),S),w=h.add(S,h.multiplyByScalar(I,p,w),w),ks[0]=h.clone(O,ks[0]),ks[1]=h.clone(w,ks[1]),v=z5(ks,_+d,E+d,a),P=Ni.generateArc({positions:ks,granularity:a,ellipsoid:o}),m=G5(P,I,u,m,o,v,1),I=h.cross(T,C,I),I=h.normalize(I,I),D=h.add(S,h.multiplyByScalar(I,p,D),D),c===Li.ROUNDED||c===Li.BEVELED?tQ(S,w,D,c,X,o,m,u,E+d,r):(b=h.negate(b,b),m=Jm(B,b,u,m,o,E+d,j,k)),O=h.clone(D,O)):(S=h.add(B,h.multiplyByScalar(b,j*p,b),S),w=h.add(S,h.multiplyByScalar(I,-p,w),w),ks[0]=h.clone(O,ks[0]),ks[1]=h.clone(w,ks[1]),v=z5(ks,_+d,E+d,a),P=Ni.generateArc({positions:ks,granularity:a,ellipsoid:o}),m=G5(P,I,u,m,o,v,1),I=h.cross(T,C,I),I=h.normalize(I,I),D=h.add(S,h.multiplyByScalar(I,-p,D),D),c===Li.ROUNDED||c===Li.BEVELED?tQ(S,w,D,c,X,o,m,u,E+d,r):m=Jm(B,b,u,m,o,E+d,j,k),O=h.clone(D,O)),A=h.negate(C,A)}else m=Jm(O,I,u,m,o,_+d,1,1),O=B;_=E,E=s[U+1],B=L}ks[0]=h.clone(O,ks[0]),ks[1]=h.clone(B,ks[1]),v=z5(ks,_+d,E+d,a),P=Ni.generateArc({positions:ks,granularity:a,ellipsoid:o}),m=G5(P,I,u,m,o,v,1),r&&(x=Jm(B,I,f,x,o,E+d,1,1)),g=m.length;let R=r?g+x.length:g,F=new Float64Array(R);return F.set(m),r&&F.set(x,g),F};var wh=NS;var j5={},RA=new h,sQ=new h,GPe=new h,nQ=new h,xc=[new h,new h],aQ=new h,cQ=new h,lQ=new h,WPe=new h,jPe=new h,qPe=new h,YPe=new h,XPe=new h,KPe=new h,$Pe=new h,iQ=new Re,rQ=new Q;function WI(e,t,n,i,r){let o=h.angleBetween(h.subtract(t,e,RA),h.subtract(n,e,sQ)),s=i===Li.BEVELED?1:Math.ceil(o/M.toRadians(5))+1,a=s*3,c=new Array(a);c[a-3]=n.x,c[a-2]=n.y,c[a-1]=n.z;let u;r?u=Q.fromQuaternion(Re.fromAxisAngle(h.negate(e,RA),o/s,iQ),rQ):u=Q.fromQuaternion(Re.fromAxisAngle(e,o/s,iQ),rQ);let f=0;t=h.clone(t,RA);for(let d=0;d<s;d++)t=Q.multiplyByVector(u,t,t),c[f++]=t.x,c[f++]=t.y,c[f++]=t.z;return c}function ZPe(e){let t=aQ,n=cQ,i=lQ,r=e[1];n=h.fromArray(e[1],r.length-3,n),i=h.fromArray(e[0],0,i),t=h.midpoint(n,i,t);let o=WI(t,n,i,Li.ROUNDED,!1),s=e.length-1,a=e[s-1];r=e[s],n=h.fromArray(a,a.length-3,n),i=h.fromArray(r,0,i),t=h.midpoint(n,i,t);let c=WI(t,n,i,Li.ROUNDED,!1);return[o,c]}function oQ(e,t,n,i){let r=RA;return i?r=h.add(e,t,r):(t=h.negate(t,t),r=h.add(e,t,r)),[r.x,r.y,r.z,n.x,n.y,n.z]}function W5(e,t,n,i){let r=new Array(e.length),o=new Array(e.length),s=h.multiplyByScalar(t,n,RA),a=h.negate(s,sQ),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let d=h.fromArray(e,f,GPe),p=h.add(d,a,nQ);r[c++]=p.x,r[c++]=p.y,r[c++]=p.z;let g=h.add(d,s,nQ);o[u--]=g.z,o[u--]=g.y,o[u--]=g.x}return i.push(r,o),i}j5.addAttribute=function(e,t,n,i){let r=t.x,o=t.y,s=t.z;l(n)&&(e[n]=r,e[n+1]=o,e[n+2]=s),l(i)&&(e[i]=s,e[i-1]=o,e[i-2]=r)};var JPe=new h,QPe=new h;j5.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,r=e.width/2,o=e.cornerType,s=e.saveAttributes,a=aQ,c=cQ,u=lQ,f=WPe,d=jPe,p=qPe,g=YPe,m=XPe,x=KPe,C=$Pe,A=[],b=s?[]:void 0,T=s?[]:void 0,S=n[0],w=n[1];c=h.normalize(h.subtract(w,S,c),c),a=i.geodeticSurfaceNormal(S,a),f=h.normalize(h.cross(a,c,f),f),s&&(b.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),g=h.clone(S,g),S=w,u=h.negate(c,u);let D,I=[],O,B=n.length;for(O=1;O<B-1;O++){a=i.geodeticSurfaceNormal(S,a),w=n[O+1],c=h.normalize(h.subtract(w,S,c),c),d=h.normalize(h.add(c,u,d),d);let _=h.multiplyByScalar(a,h.dot(c,a),JPe);h.subtract(c,_,_),h.normalize(_,_);let E=h.multiplyByScalar(a,h.dot(u,a),QPe);if(h.subtract(u,E,E),h.normalize(E,E),!M.equalsEpsilon(Math.abs(h.dot(_,E)),1,M.EPSILON7)){d=h.cross(d,a,d),d=h.cross(a,d,d),d=h.normalize(d,d);let P=r/Math.max(.25,h.magnitude(h.cross(d,u,RA))),R=wh.angleIsGreaterThanPi(c,u,S,i);d=h.multiplyByScalar(d,P,d),R?(m=h.add(S,d,m),C=h.add(m,h.multiplyByScalar(f,r,C),C),x=h.add(m,h.multiplyByScalar(f,r*2,x),x),xc[0]=h.clone(g,xc[0]),xc[1]=h.clone(C,xc[1]),D=Ni.generateArc({positions:xc,granularity:t,ellipsoid:i}),A=W5(D,f,r,A),s&&(b.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),p=h.clone(x,p),f=h.normalize(h.cross(a,c,f),f),x=h.add(m,h.multiplyByScalar(f,r*2,x),x),g=h.add(m,h.multiplyByScalar(f,r,g),g),o===Li.ROUNDED||o===Li.BEVELED?I.push({leftPositions:WI(m,p,x,o,R)}):I.push({leftPositions:oQ(S,h.negate(d,d),x,R)})):(x=h.add(S,d,x),C=h.add(x,h.negate(h.multiplyByScalar(f,r,C),C),C),m=h.add(x,h.negate(h.multiplyByScalar(f,r*2,m),m),m),xc[0]=h.clone(g,xc[0]),xc[1]=h.clone(C,xc[1]),D=Ni.generateArc({positions:xc,granularity:t,ellipsoid:i}),A=W5(D,f,r,A),s&&(b.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),p=h.clone(m,p),f=h.normalize(h.cross(a,c,f),f),m=h.add(x,h.negate(h.multiplyByScalar(f,r*2,m),m),m),g=h.add(x,h.negate(h.multiplyByScalar(f,r,g),g),g),o===Li.ROUNDED||o===Li.BEVELED?I.push({rightPositions:WI(x,p,m,o,R)}):I.push({rightPositions:oQ(S,d,m,R)})),u=h.negate(c,u)}S=w}a=i.geodeticSurfaceNormal(S,a),xc[0]=h.clone(g,xc[0]),xc[1]=h.clone(S,xc[1]),D=Ni.generateArc({positions:xc,granularity:t,ellipsoid:i}),A=W5(D,f,r,A),s&&(b.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z));let L;return o===Li.ROUNDED&&(L=ZPe(A)),{positions:A,corners:I,lefts:b,normals:T,endPositions:L}};var zi=j5;var dQ=new h,hQ=new h,jI=new h,qI=new h,eIe=new h,mQ=new h,V_=new h,MA=new h;function pQ(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function td(e,t,n,i,r,o){let s=e.normals,a=e.tangents,c=e.bitangents,u=h.normalize(h.cross(n,t,V_),V_);o.normal&&zi.addAttribute(s,t,i,r),o.tangent&&zi.addAttribute(a,u,i,r),o.bitangent&&zi.addAttribute(c,n,i,r)}function _Q(e,t,n){let i=e.positions,r=e.corners,o=e.endPositions,s=e.lefts,a=e.normals,c=new dn,u,f=0,d=0,p,g=0,m;for(p=0;p<i.length;p+=2)m=i[p].length-3,f+=m,g+=m*2,d+=i[p+1].length-3;for(f+=3,d+=3,p=0;p<r.length;p++){u=r[p];let J=r[p].leftPositions;l(J)?(m=J.length,f+=m,g+=m):(m=r[p].rightPositions.length,d+=m,g+=m)}let x=l(o),C;x&&(C=o[0].length-3,f+=C,d+=C,C/=3,g+=C*6);let A=f+d,b=new Float64Array(A),T=t.normal?new Float32Array(A):void 0,S=t.tangent?new Float32Array(A):void 0,w=t.bitangent?new Float32Array(A):void 0,D={normals:T,tangents:S,bitangents:w},I=0,O=A-1,B,L,_,E,v=dQ,P=hQ,R,F,U=C/2,k=Le.createTypedArray(A/3,g),H=0;if(x){F=jI,R=qI;let J=o[0];for(v=h.fromArray(a,0,v),P=h.fromArray(s,0,P),p=0;p<U;p++)F=h.fromArray(J,(U-1-p)*3,F),R=h.fromArray(J,(U+p)*3,R),zi.addAttribute(b,R,I),zi.addAttribute(b,F,void 0,O),td(D,v,P,I,O,t),L=I/3,E=L+1,B=(O-2)/3,_=B-1,k[H++]=B,k[H++]=L,k[H++]=_,k[H++]=_,k[H++]=L,k[H++]=E,I+=3,O-=3}let V=0,q=0,j=i[V++],X=i[V++];b.set(j,I),b.set(X,O-X.length+1),P=h.fromArray(s,q,P);let G,$;for(m=X.length-3,p=0;p<m;p+=3)G=n.geodeticSurfaceNormal(h.fromArray(j,p,V_),V_),$=n.geodeticSurfaceNormal(h.fromArray(X,m-p,MA),MA),v=h.normalize(h.add(G,$,v),v),td(D,v,P,I,O,t),L=I/3,E=L+1,B=(O-2)/3,_=B-1,k[H++]=B,k[H++]=L,k[H++]=_,k[H++]=_,k[H++]=L,k[H++]=E,I+=3,O-=3;for(G=n.geodeticSurfaceNormal(h.fromArray(j,m,V_),V_),$=n.geodeticSurfaceNormal(h.fromArray(X,m,MA),MA),v=h.normalize(h.add(G,$,v),v),q+=3,p=0;p<r.length;p++){let J;u=r[p];let ce=u.leftPositions,de=u.rightPositions,ie,ae,_e=mQ,be=jI,Te=qI;if(v=h.fromArray(a,q,v),l(ce)){for(td(D,v,P,void 0,O,t),O-=3,ie=E,ae=_,J=0;J<ce.length/3;J++)_e=h.fromArray(ce,J*3,_e),k[H++]=ie,k[H++]=ae-J-1,k[H++]=ae-J,zi.addAttribute(b,_e,void 0,O),be=h.fromArray(b,(ae-J-1)*3,be),Te=h.fromArray(b,ie*3,Te),P=h.normalize(h.subtract(be,Te,P),P),td(D,v,P,void 0,O,t),O-=3;_e=h.fromArray(b,ie*3,_e),be=h.subtract(h.fromArray(b,ae*3,be),_e,be),Te=h.subtract(h.fromArray(b,(ae-J)*3,Te),_e,Te),P=h.normalize(h.add(be,Te,P),P),td(D,v,P,I,void 0,t),I+=3}else{for(td(D,v,P,I,void 0,t),I+=3,ie=_,ae=E,J=0;J<de.length/3;J++)_e=h.fromArray(de,J*3,_e),k[H++]=ie,k[H++]=ae+J,k[H++]=ae+J+1,zi.addAttribute(b,_e,I),be=h.fromArray(b,ie*3,be),Te=h.fromArray(b,(ae+J)*3,Te),P=h.normalize(h.subtract(be,Te,P),P),td(D,v,P,I,void 0,t),I+=3;_e=h.fromArray(b,ie*3,_e),be=h.subtract(h.fromArray(b,(ae+J)*3,be),_e,be),Te=h.subtract(h.fromArray(b,ae*3,Te),_e,Te),P=h.normalize(h.negate(h.add(Te,be,P),P),P),td(D,v,P,void 0,O,t),O-=3}for(j=i[V++],X=i[V++],j.splice(0,3),X.splice(X.length-3,3),b.set(j,I),b.set(X,O-X.length+1),m=X.length-3,q+=3,P=h.fromArray(s,q,P),J=0;J<X.length;J+=3)G=n.geodeticSurfaceNormal(h.fromArray(j,J,V_),V_),$=n.geodeticSurfaceNormal(h.fromArray(X,m-J,MA),MA),v=h.normalize(h.add(G,$,v),v),td(D,v,P,I,O,t),E=I/3,L=E-1,_=(O-2)/3,B=_+1,k[H++]=B,k[H++]=L,k[H++]=_,k[H++]=_,k[H++]=L,k[H++]=E,I+=3,O-=3;I-=3,O+=3}if(v=h.fromArray(a,a.length-3,v),td(D,v,P,I,O,t),x){I+=3,O-=3,F=jI,R=qI;let J=o[1];for(p=0;p<U;p++)F=h.fromArray(J,(C-p-1)*3,F),R=h.fromArray(J,p*3,R),zi.addAttribute(b,F,void 0,O),zi.addAttribute(b,R,I),td(D,v,P,I,O,t),E=I/3,L=E-1,_=(O-2)/3,B=_+1,k[H++]=B,k[H++]=L,k[H++]=_,k[H++]=_,k[H++]=L,k[H++]=E,I+=3,O-=3}if(c.position=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:b}),t.st){let J=new Float32Array(A/3*2),ce,de,ie=0;if(x){f/=3,d/=3;let ae=Math.PI/(C+1);de=1/(f-C+1),ce=1/(d-C+1);let _e,be=C/2;for(p=be+1;p<C+1;p++)_e=M.PI_OVER_TWO+ae*p,J[ie++]=ce*(1+Math.cos(_e)),J[ie++]=.5*(1+Math.sin(_e));for(p=1;p<d-C+1;p++)J[ie++]=p*ce,J[ie++]=0;for(p=C;p>be;p--)_e=M.PI_OVER_TWO-p*ae,J[ie++]=1-ce*(1+Math.cos(_e)),J[ie++]=.5*(1+Math.sin(_e));for(p=be;p>0;p--)_e=M.PI_OVER_TWO-ae*p,J[ie++]=1-de*(1+Math.cos(_e)),J[ie++]=.5*(1+Math.sin(_e));for(p=f-C;p>0;p--)J[ie++]=p*de,J[ie++]=1;for(p=1;p<be+1;p++)_e=M.PI_OVER_TWO+ae*p,J[ie++]=de*(1+Math.cos(_e)),J[ie++]=.5*(1+Math.sin(_e))}else{for(f/=3,d/=3,de=1/(f-1),ce=1/(d-1),p=0;p<d;p++)J[ie++]=p*ce,J[ie++]=0;for(p=f;p>0;p--)J[ie++]=(p-1)*de,J[ie++]=1}c.st=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:J})}return t.normal&&(c.normal=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:D.normals})),t.tangent&&(c.tangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:D.tangents})),t.bitangent&&(c.bitangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:D.bitangents})),{attributes:c,indices:k}}function tIe(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,r;(t.normal||t.bitangent)&&(i=e.normal.values,r=e.bitangent.values);let o=e.position.values.length/18,s=o*3,a=o*2,c=s*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(s*6):void 0,d=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=dQ,m=hQ,x=jI,C=qI,A=eIe,b=mQ,T=c;for(u=0;u<s;u+=3){let S=T+c;g=h.fromArray(n,u,g),m=h.fromArray(n,u+s,m),x=h.fromArray(n,(u+3)%s,x),m=h.subtract(m,g,m),x=h.subtract(x,g,x),C=h.normalize(h.cross(m,x,C),C),t.normal&&(zi.addAttribute(f,C,S),zi.addAttribute(f,C,S+3),zi.addAttribute(f,C,T),zi.addAttribute(f,C,T+3)),(t.tangent||t.bitangent)&&(b=h.fromArray(i,u,b),t.bitangent&&(zi.addAttribute(p,b,S),zi.addAttribute(p,b,S+3),zi.addAttribute(p,b,T),zi.addAttribute(p,b,T+3)),t.tangent&&(A=h.normalize(h.cross(b,C,A),A),zi.addAttribute(d,A,S),zi.addAttribute(d,A,S+3),zi.addAttribute(d,A,T),zi.addAttribute(d,A,T+3))),T+=6}if(t.normal){for(f.set(i),u=0;u<s;u+=3)f[u+s]=-i[u],f[u+s+1]=-i[u+1],f[u+s+2]=-i[u+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(p.set(r),p.set(r,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let S=e.tangent.values;d.set(S),d.set(S,s),e.tangent.values=d}}if(t.st){let f=e.st.values,d=new Float32Array(a*6);d.set(f),d.set(f,a);let p=a*2;for(let g=0;g<2;g++){for(d[p++]=f[0],d[p++]=f[1],u=2;u<a;u+=2){let m=f[u],x=f[u+1];d[p++]=m,d[p++]=x,d[p++]=m,d[p++]=x}d[p++]=f[0],d[p++]=f[1]}e.st.values=d}return e}function q5(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){let r=e[i],o=e[i+1],s=e[i+2];n[t++]=r,n[t++]=o,n[t++]=s,n[t++]=r,n[t++]=o,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function nIe(e,t){let n=new Pe({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,r=zi.computePositions(e),o=_Q(r,n,i),s=e.height,a=e.extrudedHeight,c=o.attributes,u=o.indices,f=c.position.values,d=f.length,p=new Float64Array(d*6),g=new Float64Array(d);g.set(f);let m=new Float64Array(d*4);f=si.scaleToGeodeticHeight(f,s,i),m=q5(f,0,m),g=si.scaleToGeodeticHeight(g,a,i),m=q5(g,d*2,m),p.set(f),p.set(g,d),p.set(m,d*2),c.position.values=p,c=tIe(c,t);let x,C=d/3;if(e.shadowVolume){let B=c.normal.values;d=B.length;let L=new Float32Array(d*6);for(x=0;x<d;x++)B[x]=-B[x];L.set(B,d),L=q5(B,d*4,L),c.extrudeDirection=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:L}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let B=new Uint8Array(C*6);if(e.offsetAttribute===nn.TOP)B=B.fill(1,0,C).fill(1,C*2,C*4);else{let L=e.offsetAttribute===nn.NONE?0:1;B=B.fill(L)}c.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}let A=u.length,b=C+C,T=Le.createTypedArray(p.length/3,A*2+b*3);T.set(u);let S=A;for(x=0;x<A;x+=3){let B=u[x],L=u[x+1],_=u[x+2];T[S++]=_+C,T[S++]=L+C,T[S++]=B+C}let w,D,I,O;for(x=0;x<b;x+=2)w=x+b,D=w+b,I=w+1,O=D+1,T[S++]=w,T[S++]=D,T[S++]=I,T[S++]=I,T[S++]=D,T[S++]=O;return{attributes:c,indices:T}}var uQ=new h,FS=new h,ku=new me;function fQ(e,t,n,i,r,o){let s=h.subtract(t,e,uQ);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,FS),c=h.cross(s,a,uQ);h.multiplyByScalar(c,i,c);let u=r.latitude,f=r.longitude,d=o.latitude,p=o.longitude;h.add(e,c,FS),n.cartesianToCartographic(FS,ku);let g=ku.latitude,m=ku.longitude;u=Math.min(u,g),f=Math.min(f,m),d=Math.max(d,g),p=Math.max(p,m),h.subtract(e,c,FS),n.cartesianToCartographic(FS,ku),g=ku.latitude,m=ku.longitude,u=Math.min(u,g),f=Math.min(f,m),d=Math.max(d,g),p=Math.max(p,m),r.latitude=u,r.longitude=f,o.latitude=d,o.longitude=p}var Vu=new h,VS=new h,ol=new me,sl=new me;function gQ(e,t,n,i,r){e=pQ(e,t);let o=vr(e,h.equalsEpsilon),s=o.length;if(s<2||n<=0)return new he;let a=n*.5;ol.latitude=Number.POSITIVE_INFINITY,ol.longitude=Number.POSITIVE_INFINITY,sl.latitude=Number.NEGATIVE_INFINITY,sl.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===Li.ROUNDED){let p=o[0];h.subtract(p,o[1],Vu),h.normalize(Vu,Vu),h.multiplyByScalar(Vu,a,Vu),h.add(p,Vu,VS),t.cartesianToCartographic(VS,ku),c=ku.latitude,u=ku.longitude,ol.latitude=Math.min(ol.latitude,c),ol.longitude=Math.min(ol.longitude,u),sl.latitude=Math.max(sl.latitude,c),sl.longitude=Math.max(sl.longitude,u)}for(let p=0;p<s-1;++p)fQ(o[p],o[p+1],t,a,ol,sl);let f=o[s-1];h.subtract(f,o[s-2],Vu),h.normalize(Vu,Vu),h.multiplyByScalar(Vu,a,Vu),h.add(f,Vu,VS),fQ(f,VS,t,a,ol,sl),i===Li.ROUNDED&&(t.cartesianToCartographic(VS,ku),c=ku.latitude,u=ku.longitude,ol.latitude=Math.min(ol.latitude,c),ol.longitude=Math.min(ol.longitude,u),sl.latitude=Math.max(sl.latitude,c),sl.longitude=Math.max(sl.longitude,u));let d=l(r)?r:new he;return d.north=sl.latitude,d.south=ol.latitude,d.east=sl.longitude,d.west=ol.longitude,d}function ep(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),r=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=oe.clone(y(e.ellipsoid,oe.WGS84)),this._vertexFormat=Pe.clone(y(e.vertexFormat,Pe.DEFAULT)),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=y(e.cornerType,Li.ROUNDED),this._granularity=y(e.granularity,M.RADIANS_PER_DEGREE),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*h.packedLength+oe.packedLength+Pe.packedLength+7}ep.pack=function(e,t,n){n=y(n,0);let i=e._positions,r=i.length;t[n++]=r;for(let o=0;o<r;++o,n+=h.packedLength)h.pack(i[o],t,n);return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var yQ=oe.clone(oe.UNIT_SPHERE),xQ=new Pe,Qm={positions:void 0,ellipsoid:yQ,vertexFormat:xQ,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};ep.unpack=function(e,t,n){t=y(t,0);let i=e[t++],r=new Array(i);for(let m=0;m<i;++m,t+=h.packedLength)r[m]=h.unpack(e,t);let o=oe.unpack(e,t,yQ);t+=oe.packedLength;let s=Pe.unpack(e,t,xQ);t+=Pe.packedLength;let a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++]===1,g=e[t];return l(n)?(n._positions=r,n._ellipsoid=oe.clone(o,n._ellipsoid),n._vertexFormat=Pe.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=u,n._cornerType=f,n._granularity=d,n._shadowVolume=p,n._offsetAttribute=g===-1?void 0:g,n):(Qm.positions=r,Qm.width=a,Qm.height=c,Qm.extrudedHeight=u,Qm.cornerType=f,Qm.granularity=d,Qm.shadowVolume=p,Qm.offsetAttribute=g===-1?void 0:g,new ep(Qm))};ep.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.positions,i=e.width,r=y(e.ellipsoid,oe.WGS84),o=y(e.cornerType,Li.ROUNDED);return gQ(n,r,i,o,t)};ep.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=pQ(t,i);let r=vr(t,h.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,s=e._extrudedHeight,a=!M.equalsEpsilon(o,s,0,M.EPSILON2),c=e._vertexFormat,u={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(a)u.height=o,u.extrudedHeight=s,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=nIe(u,c);else{let g=zi.computePositions(u);if(f=_Q(g,c,i),f.attributes.position.values=si.scaleToGeodeticHeight(f.attributes.position.values,o,i),l(e._offsetAttribute)){let m=e._offsetAttribute===nn.NONE?0:1,x=f.attributes.position.values.length,C=new Uint8Array(x/3).fill(m);f.attributes.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:C})}}let d=f.attributes,p=re.fromVertices(d.position.values,void 0,3);return c.position||(f.attributes.position.values=void 0),new ot({attributes:d,indices:f.indices,primitiveType:Me.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};ep.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new ep({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:r,granularity:i,extrudedHeight:o,height:s,vertexFormat:Pe.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(ep.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=gQ(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var BA=ep;var CQ=new h,AQ=new h,iIe=new h;function rIe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function TQ(e,t){let n=[],i=e.positions,r=e.corners,o=e.endPositions,s=new dn,a,c=0,u=0,f,d=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,c+=p,d+=p/3*4,u+=i[f+1].length-3;for(c+=3,u+=3,f=0;f<r.length;f++){a=r[f];let R=r[f].leftPositions;l(R)?(p=R.length,c+=p,d+=p/3*2):(p=r[f].rightPositions.length,u+=p,d+=p/3*2)}let g=l(o),m;g&&(m=o[0].length-3,c+=m,u+=m,m/=3,d+=m*4);let x=c+u,C=new Float64Array(x),A=0,b=x-1,T,S,w,D,I,O,B=m/2,L=Le.createTypedArray(x/3,d+4),_=0;if(L[_++]=A/3,L[_++]=(b-2)/3,g){n.push(A/3),O=CQ,I=AQ;let R=o[0];for(f=0;f<B;f++)O=h.fromArray(R,(B-1-f)*3,O),I=h.fromArray(R,(B+f)*3,I),zi.addAttribute(C,I,A),zi.addAttribute(C,O,void 0,b),S=A/3,D=S+1,T=(b-2)/3,w=T-1,L[_++]=T,L[_++]=w,L[_++]=S,L[_++]=D,A+=3,b-=3}let E=0,v=i[E++],P=i[E++];for(C.set(v,A),C.set(P,b-P.length+1),p=P.length-3,n.push(A/3,(b-2)/3),f=0;f<p;f+=3)S=A/3,D=S+1,T=(b-2)/3,w=T-1,L[_++]=T,L[_++]=w,L[_++]=S,L[_++]=D,A+=3,b-=3;for(f=0;f<r.length;f++){let R;a=r[f];let F=a.leftPositions,U=a.rightPositions,k,H=iIe;if(l(F)){for(b-=3,k=w,n.push(D),R=0;R<F.length/3;R++)H=h.fromArray(F,R*3,H),L[_++]=k-R-1,L[_++]=k-R,zi.addAttribute(C,H,void 0,b),b-=3;n.push(k-Math.floor(F.length/6)),t===Li.BEVELED&&n.push((b-2)/3+1),A+=3}else{for(A+=3,k=D,n.push(w),R=0;R<U.length/3;R++)H=h.fromArray(U,R*3,H),L[_++]=k+R,L[_++]=k+R+1,zi.addAttribute(C,H,A),A+=3;n.push(k+Math.floor(U.length/6)),t===Li.BEVELED&&n.push(A/3-1),b-=3}for(v=i[E++],P=i[E++],v.splice(0,3),P.splice(P.length-3,3),C.set(v,A),C.set(P,b-P.length+1),p=P.length-3,R=0;R<P.length;R+=3)D=A/3,S=D-1,w=(b-2)/3,T=w+1,L[_++]=T,L[_++]=w,L[_++]=S,L[_++]=D,A+=3,b-=3;A-=3,b+=3,n.push(A/3,(b-2)/3)}if(g){A+=3,b-=3,O=CQ,I=AQ;let R=o[1];for(f=0;f<B;f++)O=h.fromArray(R,(m-f-1)*3,O),I=h.fromArray(R,f*3,I),zi.addAttribute(C,O,void 0,b),zi.addAttribute(C,I,A),D=A/3,S=D-1,w=(b-2)/3,T=w+1,L[_++]=T,L[_++]=w,L[_++]=S,L[_++]=D,A+=3,b-=3;n.push(A/3)}else n.push(A/3,(b-2)/3);return L[_++]=A/3,L[_++]=(b-2)/3,s.position=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:C}),{attributes:s,indices:L,wallIndices:n}}function oIe(e){let t=e.ellipsoid,n=zi.computePositions(e),i=TQ(n,e.cornerType),r=i.wallIndices,o=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,u=a.position.values,f=u.length,d=new Float64Array(f);d.set(u);let p=new Float64Array(f*2);if(u=si.scaleToGeodeticHeight(u,o,t),d=si.scaleToGeodeticHeight(d,s,t),p.set(u),p.set(d,f),a.position.values=p,f/=3,l(e.offsetAttribute)){let T=new Uint8Array(f*2);if(e.offsetAttribute===nn.TOP)T=T.fill(1,0,f);else{let S=e.offsetAttribute===nn.NONE?0:1;T=T.fill(S)}a.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}let g,m=c.length,x=Le.createTypedArray(p.length/3,(m+r.length)*2);x.set(c);let C=m;for(g=0;g<m;g+=2){let T=c[g],S=c[g+1];x[C++]=T+f,x[C++]=S+f}let A,b;for(g=0;g<r.length;g++)A=r[g],b=A+f,x[C++]=A,x[C++]=b;return{attributes:a,indices:x}}function kS(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),r=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=oe.clone(y(e.ellipsoid,oe.WGS84)),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=y(e.cornerType,Li.ROUNDED),this._granularity=y(e.granularity,M.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*h.packedLength+oe.packedLength+6}kS.pack=function(e,t,n){n=y(n,0);let i=e._positions,r=i.length;t[n++]=r;for(let o=0;o<r;++o,n+=h.packedLength)h.pack(i[o],t,n);return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=y(e._offsetAttribute,-1),t};var bQ=oe.clone(oe.UNIT_SPHERE),k_={positions:void 0,ellipsoid:bQ,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};kS.unpack=function(e,t,n){t=y(t,0);let i=e[t++],r=new Array(i);for(let p=0;p<i;++p,t+=h.packedLength)r[p]=h.unpack(e,t);let o=oe.unpack(e,t,bQ);t+=oe.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t];return l(n)?(n._positions=r,n._ellipsoid=oe.clone(o,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=u,n._granularity=f,n._offsetAttribute=d===-1?void 0:d,n):(k_.positions=r,k_.width=s,k_.height=a,k_.extrudedHeight=c,k_.cornerType=u,k_.granularity=f,k_.offsetAttribute=d===-1?void 0:d,new kS(k_))};kS.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=rIe(t,i);let r=vr(t,h.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,s=e._extrudedHeight,a=!M.equalsEpsilon(o,s,0,M.EPSILON2),c={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(a)c.height=o,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,u=oIe(c);else{let p=zi.computePositions(c);if(u=TQ(p,c.cornerType),u.attributes.position.values=si.scaleToGeodeticHeight(u.attributes.position.values,o,i),l(e._offsetAttribute)){let g=u.attributes.position.values.length,m=e._offsetAttribute===nn.NONE?0:1,x=new Uint8Array(g/3).fill(m);u.attributes.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}}let f=u.attributes,d=re.fromVertices(f.position.values,void 0,3);return new ot({attributes:f,indices:u.indices,primitiveType:Me.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})};var YI=kS;function sIe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Ln=sIe;var Y5,EQ="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIyNDBiMjBhOS1jZWE5LTRmYWYtOGI3Yy05ZDg3ODBiZDZiZjUiLCJpZCI6MjU5LCJpYXQiOjE2NTkzNjE0MTJ9.tXPPvw93XpCGHG71h7s_mMLlWGCuAL55o8LC309hLAg",XI={};XI.defaultAccessToken=EQ;XI.defaultServer=new De({url:"https://api.cesium.com/"});XI.getDefaultTokenCredit=function(e){if(e===EQ){if(!l(Y5)){let t=`<b> This application is using Cesium's default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>`;Y5=new Gt(t,!0)}return Y5}};var vh=XI;function Cc(e,t){let n,i=e.externalType,r=l(i);if(!r)n={url:e.url,retryAttempts:1,retryCallback:aIe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new fe("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");De.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=r?void 0:new oi.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=r}l(Object.create)&&(Cc.prototype=Object.create(De.prototype),Cc.prototype.constructor=Cc);Cc.fromAssetId=function(e,t){let n=Cc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Cc(i,n)})};Object.defineProperties(Cc.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Cc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Cc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(Gt.getIonCredit),i=vh.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(Gt.clone(i)),n};Cc.prototype.clone=function(e){let t=y(this._ionRoot,this);return l(e)||(e=new Cc(t._ionEndpoint,t._ionEndpointResource)),e=De.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Cc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return De.prototype.fetchImage.call(this,e)};Cc.prototype._makeRequest=function(e){return this._isExternal||new oi.default(this.url).authority()!==this._ionEndpointDomain?De.prototype._makeRequest.call(this,e):(l(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,De.prototype._makeRequest.call(this,e))};Cc._createEndpointResource=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.server,vh.defaultServer),i=y(t.accessToken,vh.defaultAccessToken);n=De.createIfNeeded(n);let r={url:`v1/assets/${e}/endpoint`};return l(i)&&(r.queryParameters={access_token:i}),n.getDerivedResource(r)};function aIe(e,t){let n=y(e._ionRoot,e),i=n._ionEndpointResource,r=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(r&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(o){return n._ionEndpoint=o,o}).finally(function(o){return n._pendingPromise=void 0,o})),n._pendingPromise.then(function(o){return e._ionEndpoint=o,!0}))}var Dh=Cc;function cIe(e){return e=y(e,y.EMPTY_OBJECT),new gI({url:Dh.fromAssetId(1),requestVertexNormals:y(e.requestVertexNormals,!1),requestWaterMask:y(e.requestWaterMask,!1)})}var KI=cIe;function Uu(e){this.planes=y(e,[])}var US=[new h,new h,new h];h.clone(h.UNIT_X,US[0]);h.clone(h.UNIT_Y,US[1]);h.clone(h.UNIT_Z,US[2]);var U_=new h,lIe=new h,SQ=new an(new h(1,0,0),0);Uu.fromBoundingSphere=function(e,t){l(t)||(t=new Uu);let n=US.length,i=t.planes;i.length=2*n;let r=e.center,o=e.radius,s=0;for(let a=0;a<n;++a){let c=US[a],u=i[s],f=i[s+1];l(u)||(u=i[s]=new se),l(f)||(f=i[s+1]=new se),h.multiplyByScalar(c,-o,U_),h.add(r,U_,U_),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-h.dot(c,U_),h.multiplyByScalar(c,o,U_),h.add(r,U_,U_),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-h.dot(h.negate(c,lIe),U_),s+=2}return t};Uu.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,r=t.length;i<r;++i){let o=e.intersectPlane(an.fromCartesian4(t[i],SQ));if(o===Jt.OUTSIDE)return Jt.OUTSIDE;o===Jt.INTERSECTING&&(n=!0)}return n?Jt.INTERSECTING:Jt.INSIDE};Uu.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===Uu.MASK_OUTSIDE||t===Uu.MASK_INSIDE)return t;let n=Uu.MASK_INSIDE,i=this.planes;for(let r=0,o=i.length;r<o;++r){let s=r<31?1<<r:0;if(r<31&&(t&s)===0)continue;let a=e.intersectPlane(an.fromCartesian4(i[r],SQ));if(a===Jt.OUTSIDE)return Uu.MASK_OUTSIDE;a===Jt.INTERSECTING&&(n|=s)}return n};Uu.MASK_OUTSIDE=4294967295;Uu.MASK_INSIDE=0;Uu.MASK_INDETERMINATE=2147483647;var da=Uu;function LA(e){e=y(e,y.EMPTY_OBJECT),this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Qi({ellipsoid:y(e.ellipsoid,oe.WGS84)})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=ns.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new ge;let n=e.credit;typeof n=="string"&&(n=new Gt(n)),this._credit=n,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(LA.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});LA.prototype.requestTileGeometry=function(e,t,n,i){let r=this._callback(e,t,n);if(!l(r))return;let o=this._width,s=this._height;return Promise.resolve(r).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new Fa({buffer:c,width:o,height:s})})};LA.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};LA.prototype.getTileDataAvailable=function(e,t,n){};LA.prototype.loadTileDataAvailability=function(e,t,n){};var wQ=LA;var vQ={};vQ.computePositions=function(e,t,n,i,r){let o=e*.5,s=-o,a=i+i,c=r?2*a:a,u=new Float64Array(c*3),f,d=0,p=0,g=r?a*3:0,m=r?(a+i)*3:i*3;for(f=0;f<i;f++){let x=f/i*M.TWO_PI,C=Math.cos(x),A=Math.sin(x),b=C*n,T=A*n,S=C*t,w=A*t;u[p+g]=b,u[p+g+1]=T,u[p+g+2]=s,u[p+m]=S,u[p+m+1]=w,u[p+m+2]=o,p+=3,r&&(u[d++]=b,u[d++]=T,u[d++]=s,u[d++]=S,u[d++]=w,u[d++]=o)}return u};var NA=vQ;var X5=new W,uIe=new h,fIe=new h,dIe=new h,hIe=new h;function tp(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,r=y(e.vertexFormat,Pe.DEFAULT),o=y(e.slices,128);this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Pe.clone(r),this._slices=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}tp.packedLength=Pe.packedLength+5;tp.pack=function(e,t,n){return n=y(n,0),Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=y(e._offsetAttribute,-1),t};var DQ=new Pe,FA={vertexFormat:DQ,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};tp.unpack=function(e,t,n){t=y(t,0);let i=Pe.unpack(e,t,DQ);t+=Pe.packedLength;let r=e[t++],o=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=Pe.clone(i,n._vertexFormat),n._length=r,n._topRadius=o,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(FA.length=r,FA.topRadius=o,FA.bottomRadius=s,FA.slices=a,FA.offsetAttribute=c===-1?void 0:c,new tp(FA))};tp.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,r=e._vertexFormat,o=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o+o,a=o+s,c=s+s,u=NA.computePositions(t,n,i,o,!0),f=r.st?new Float32Array(c*2):void 0,d=r.normal?new Float32Array(c*3):void 0,p=r.tangent?new Float32Array(c*3):void 0,g=r.bitangent?new Float32Array(c*3):void 0,m,x=r.normal||r.tangent||r.bitangent;if(x){let I=r.tangent||r.bitangent,O=0,B=0,L=0,_=Math.atan2(i-n,t),E=uIe;E.z=Math.sin(_);let v=Math.cos(_),P=dIe,R=fIe;for(m=0;m<o;m++){let F=m/o*M.TWO_PI,U=v*Math.cos(F),k=v*Math.sin(F);x&&(E.x=U,E.y=k,I&&(P=h.normalize(h.cross(h.UNIT_Z,E,P),P)),r.normal&&(d[O++]=E.x,d[O++]=E.y,d[O++]=E.z,d[O++]=E.x,d[O++]=E.y,d[O++]=E.z),r.tangent&&(p[B++]=P.x,p[B++]=P.y,p[B++]=P.z,p[B++]=P.x,p[B++]=P.y,p[B++]=P.z),r.bitangent&&(R=h.normalize(h.cross(E,P,R),R),g[L++]=R.x,g[L++]=R.y,g[L++]=R.z,g[L++]=R.x,g[L++]=R.y,g[L++]=R.z))}for(m=0;m<o;m++)r.normal&&(d[O++]=0,d[O++]=0,d[O++]=-1),r.tangent&&(p[B++]=1,p[B++]=0,p[B++]=0),r.bitangent&&(g[L++]=0,g[L++]=-1,g[L++]=0);for(m=0;m<o;m++)r.normal&&(d[O++]=0,d[O++]=0,d[O++]=1),r.tangent&&(p[B++]=1,p[B++]=0,p[B++]=0),r.bitangent&&(g[L++]=0,g[L++]=1,g[L++]=0)}let C=12*o-12,A=Le.createTypedArray(c,C),b=0,T=0;for(m=0;m<o-1;m++)A[b++]=T,A[b++]=T+2,A[b++]=T+3,A[b++]=T,A[b++]=T+3,A[b++]=T+1,T+=2;for(A[b++]=s-2,A[b++]=0,A[b++]=1,A[b++]=s-2,A[b++]=1,A[b++]=s-1,m=1;m<o-1;m++)A[b++]=s+m+1,A[b++]=s+m,A[b++]=s;for(m=1;m<o-1;m++)A[b++]=a,A[b++]=a+m,A[b++]=a+m+1;let S=0;if(r.st){let I=Math.max(n,i);for(m=0;m<c;m++){let O=h.fromArray(u,m*3,hIe);f[S++]=(O.x+I)/(2*I),f[S++]=(O.y+I)/(2*I)}}let w=new dn;r.position&&(w.position=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:u})),r.normal&&(w.normal=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:d})),r.tangent&&(w.tangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:p})),r.bitangent&&(w.bitangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:g})),r.st&&(w.st=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:f})),X5.x=t*.5,X5.y=Math.max(i,n);let D=new re(h.ZERO,W.magnitude(X5));if(l(e._offsetAttribute)){t=u.length;let I=e._offsetAttribute===nn.NONE?0:1,O=new Uint8Array(t/3).fill(I);w.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})}return new ot({attributes:w,indices:A,primitiveType:Me.TRIANGLES,boundingSphere:D,offsetAttribute:e._offsetAttribute})};var K5;tp.getUnitCylinder=function(){return l(K5)||(K5=tp.createGeometry(new tp({topRadius:1,bottomRadius:1,length:1,vertexFormat:Pe.POSITION_ONLY}))),K5};var $I=tp;var $5=new W;function VA(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,r=y(e.slices,128),o=Math.max(y(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=r,this._numberOfVerticalLines=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}VA.packedLength=6;VA.pack=function(e,t,n){return n=y(n,0),t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var Py={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};VA.unpack=function(e,t,n){t=y(t,0);let i=e[t++],r=e[t++],o=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=r,n._bottomRadius=o,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=c===-1?void 0:c,n):(Py.length=i,Py.topRadius=r,Py.bottomRadius=o,Py.slices=s,Py.numberOfVerticalLines=a,Py.offsetAttribute=c===-1?void 0:c,new VA(Py))};VA.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,r=e._slices,o=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r*2,a=NA.computePositions(t,n,i,r,!1),c=r*2,u;if(o>0){let x=Math.min(o,r);u=Math.round(r/x),c+=x}let f=Le.createTypedArray(s,c*2),d=0,p;for(p=0;p<r-1;p++)f[d++]=p,f[d++]=p+1,f[d++]=p+r,f[d++]=p+1+r;if(f[d++]=r-1,f[d++]=0,f[d++]=r+r-1,f[d++]=r,o>0)for(p=0;p<r;p+=u)f[d++]=p,f[d++]=p+r;let g=new dn;g.position=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:a}),$5.x=t*.5,$5.y=Math.max(i,n);let m=new re(h.ZERO,W.magnitude($5));if(l(e._offsetAttribute)){t=a.length;let x=e._offsetAttribute===nn.NONE?0:1,C=new Uint8Array(t/3).fill(x);g.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:C})}return new ot({attributes:g,indices:f,primitiveType:Me.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var ZI=VA;var mIe=1953029805,pIe=2917034100;function Z5(e,t){if(Z5.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new fe("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),r=i.getUint32(0,!0);if(r===mIe||r===pIe)return t;let o=new DataView(e),s=0,a=t.byteLength,c=a-a%8,u=n,f,d=8;for(;s<c;)for(d=(d+8)%24,f=d;s<c&&f<u;)i.setUint32(s,i.getUint32(s,!0)^o.getUint32(f,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^o.getUint32(f+4,!0),!0),s+=8,f+=24;if(s<a)for(f>=u&&(d=(d+8)%24,f=d);s<a;)i.setUint8(s,i.getUint8(s)^o.getUint8(f)),s++,f++}Z5.passThroughDataForTesting=!1;var JI=Z5;var J5=32767,_Ie=new me,gIe=new h;function yIe(e,t,n,i,r){let o=e.length/3,s=e.subarray(0,o),a=e.subarray(o,2*o),c=e.subarray(2*o,3*o);In.zigZagDeltaDecode(s,a,c);let u=new Float64Array(e.length);for(let f=0;f<o;++f){let d=s[f],p=a[f],g=c[f],m=M.lerp(t.west,t.east,d/J5),x=M.lerp(t.south,t.north,p/J5),C=M.lerp(n,i,g/J5),A=me.fromRadians(m,x,C,_Ie),b=r.cartographicToCartesian(A,gIe);h.pack(b,u,f*3)}return u}var QI=yIe;function PQ(e){this.proxy=e}PQ.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var IQ=PQ;function zl(e,t){e=y(e,0),this._near=e,t=y(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(zl.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});zl.packedLength=2;zl.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n]=e.far,t};zl.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new zl),n.near=e[t++],n.far=e[t],n};zl.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};zl.clone=function(e,t){if(!!l(e))return l(t)||(t=new zl),t.near=e.near,t.far=e.far,t};zl.prototype.clone=function(e){return zl.clone(this,e)};zl.prototype.equals=function(e){return zl.equals(this,e)};var Tt=zl;function zS(e,t){e=y(e,0),t=y(t,Number.MAX_VALUE),this.value=new Float32Array([e,t])}Object.defineProperties(zS.prototype,{componentDatatype:{get:function(){return K.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});zS.fromDistanceDisplayCondition=function(e){return new zS(e.near,e.far)};zS.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var kn=zS;function nd(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(nd.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(l(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});nd.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,r=new nd({comparator:t,maximumLength:e});r._length=i;for(let o=0;o<i;o++)r._array[o]=n[o];return r};nd.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(l(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};nd.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)OQ(this,t)};nd.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let r=this._array[0];if(this._comparator(e,r)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,OQ(this,i),t};nd.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],RQ(this,0)),this._array[e-1]=void 0,t};nd.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=Q5(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&RQ(this,n)}return this._array[e-1]=void 0,t};nd.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};nd.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[Q5(this,1,2)?1:2]};function eO(e,t,n){let i=e._array,r=i[t];i[t]=i[n],i[n]=r}function HS(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function Q5(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function OQ(e,t){if(t===0)return;let n=Math.floor(M.log2(t+1))%2===0,i=Math.floor((t-1)/2),r=HS(e,t,i);for(r!==n&&(eO(e,t,i),t=i);t>=3;){let o=Math.floor((t-3)/4);if(HS(e,t,o)!==r)break;eO(e,t,o),t=o}}function RQ(e,t){let n=e._length,i=Math.floor(M.log2(t+1))%2===0,r;for(;(r=2*t+1)<n;){let o=r,s=r+1;if(s<n){HS(e,s,o)===i&&(o=s);let a=2*r+1,c=Math.max(Math.min(n-a,4),0);for(let u=0;u<c;u++){let f=a+u;HS(e,f,o)===i&&(o=f)}}if(HS(e,o,t)===i&&(eO(e,o,t),o!==r&&o!==s)){let a=Math.floor((o-1)/2);Q5(e,o,a)===i&&eO(e,o,a)}t=o}}var MQ=nd;function GS(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(GS.prototype,{length:{get:function(){return this._length}}});function xIe(e,t,n){this.item=e,this.previous=t,this.next=n}GS.prototype.add=function(e){let t=new xIe(e,this.tail,void 0);return l(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function BQ(e,t){l(t.previous)&&l(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):l(t.previous)?(t.previous.next=void 0,e.tail=t.previous):l(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}GS.prototype.remove=function(e){!l(e)||(BQ(this,e),--this._length)};GS.prototype.splice=function(e,t){if(e===t)return;BQ(this,t);let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var tO=GS;var Ti=Ns(LQ(),1);var CIe={LINEAR_NONE:Ti.default.Easing.Linear.None,QUADRATIC_IN:Ti.default.Easing.Quadratic.In,QUADRATIC_OUT:Ti.default.Easing.Quadratic.Out,QUADRATIC_IN_OUT:Ti.default.Easing.Quadratic.InOut,CUBIC_IN:Ti.default.Easing.Cubic.In,CUBIC_OUT:Ti.default.Easing.Cubic.Out,CUBIC_IN_OUT:Ti.default.Easing.Cubic.InOut,QUARTIC_IN:Ti.default.Easing.Quartic.In,QUARTIC_OUT:Ti.default.Easing.Quartic.Out,QUARTIC_IN_OUT:Ti.default.Easing.Quartic.InOut,QUINTIC_IN:Ti.default.Easing.Quintic.In,QUINTIC_OUT:Ti.default.Easing.Quintic.Out,QUINTIC_IN_OUT:Ti.default.Easing.Quintic.InOut,SINUSOIDAL_IN:Ti.default.Easing.Sinusoidal.In,SINUSOIDAL_OUT:Ti.default.Easing.Sinusoidal.Out,SINUSOIDAL_IN_OUT:Ti.default.Easing.Sinusoidal.InOut,EXPONENTIAL_IN:Ti.default.Easing.Exponential.In,EXPONENTIAL_OUT:Ti.default.Easing.Exponential.Out,EXPONENTIAL_IN_OUT:Ti.default.Easing.Exponential.InOut,CIRCULAR_IN:Ti.default.Easing.Circular.In,CIRCULAR_OUT:Ti.default.Easing.Circular.Out,CIRCULAR_IN_OUT:Ti.default.Easing.Circular.InOut,ELASTIC_IN:Ti.default.Easing.Elastic.In,ELASTIC_OUT:Ti.default.Easing.Elastic.Out,ELASTIC_IN_OUT:Ti.default.Easing.Elastic.InOut,BACK_IN:Ti.default.Easing.Back.In,BACK_OUT:Ti.default.Easing.Back.Out,BACK_IN_OUT:Ti.default.Easing.Back.InOut,BOUNCE_IN:Ti.default.Easing.Bounce.In,BOUNCE_OUT:Ti.default.Easing.Bounce.Out,BOUNCE_IN_OUT:Ti.default.Easing.Bounce.InOut},qo=Object.freeze(CIe);var AIe=new h,TIe=new h,bIe=new h,EIe=new h,SIe=new h,wIe=new h(1,1,1),NQ=Math.cos,FQ=Math.sin;function np(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,wIe),n=y(e.innerRadii,t),i=y(e.minimumClock,0),r=y(e.maximumClock,M.TWO_PI),o=y(e.minimumCone,0),s=y(e.maximumCone,M.PI),a=Math.round(y(e.stackPartitions,64)),c=Math.round(y(e.slicePartitions,64)),u=y(e.vertexFormat,Pe.DEFAULT);this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=Pe.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}np.packedLength=2*h.packedLength+Pe.packedLength+7;np.pack=function(e,t,n){return n=y(n,0),h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=y(e._offsetAttribute,-1),t};var VQ=new h,kQ=new h,UQ=new Pe,z_={radii:VQ,innerRadii:kQ,vertexFormat:UQ,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};np.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,VQ);t+=h.packedLength;let r=h.unpack(e,t,kQ);t+=h.packedLength;let o=Pe.unpack(e,t,UQ);t+=Pe.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(r,n._innerRadii),n._vertexFormat=Pe.clone(o,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=d,n._offsetAttribute=p===-1?void 0:p,n):(z_.minimumClock=s,z_.maximumClock=a,z_.minimumCone=c,z_.maximumCone=u,z_.stackPartitions=f,z_.slicePartitions=d,z_.offsetAttribute=p===-1?void 0:p,new np(z_))};np.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,r=e._maximumClock,o=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,u=e._stackPartitions+1;c=Math.round(c*Math.abs(r-i)/M.TWO_PI),u=Math.round(u*Math.abs(s-o)/M.PI),c<2&&(c=2),u<2&&(u=2);let f,d,p=0,g=[o],m=[i];for(f=0;f<u;f++)g.push(o+f*(s-o)/(u-1));for(g.push(s),d=0;d<c;d++)m.push(i+d*(r-i)/(c-1));m.push(r);let x=g.length,C=m.length,A=0,b=1,T=n.x!==t.x||n.y!==t.y||n.z!==t.z,S=!1,w=!1,D=!1;T&&(b=2,o>0&&(S=!0,A+=c-1),s<Math.PI&&(w=!0,A+=c-1),(r-i)%M.TWO_PI?(D=!0,A+=(u-1)*2+1):A+=1);let I=C*x*b,O=new Float64Array(I*3),B=new Array(I).fill(!1),L=new Array(I).fill(!1),_=c*u*b,E=6*(_+A+1-(c+u)*b),v=Le.createTypedArray(_,E),P=a.normal?new Float32Array(I*3):void 0,R=a.tangent?new Float32Array(I*3):void 0,F=a.bitangent?new Float32Array(I*3):void 0,U=a.st?new Float32Array(I*2):void 0,k=new Array(x),H=new Array(x);for(f=0;f<x;f++)k[f]=FQ(g[f]),H[f]=NQ(g[f]);let V=new Array(C),q=new Array(C);for(d=0;d<C;d++)q[d]=NQ(m[d]),V[d]=FQ(m[d]);for(f=0;f<x;f++)for(d=0;d<C;d++)O[p++]=t.x*k[f]*q[d],O[p++]=t.y*k[f]*V[d],O[p++]=t.z*H[f];let j=I/2;if(T)for(f=0;f<x;f++)for(d=0;d<C;d++)O[p++]=n.x*k[f]*q[d],O[p++]=n.y*k[f]*V[d],O[p++]=n.z*H[f],B[j]=!0,f>0&&f!==x-1&&d!==0&&d!==C-1&&(L[j]=!0),j++;p=0;let X,G;for(f=1;f<x-2;f++)for(X=f*C,G=(f+1)*C,d=1;d<C-2;d++)v[p++]=G+d,v[p++]=G+d+1,v[p++]=X+d+1,v[p++]=G+d,v[p++]=X+d+1,v[p++]=X+d;if(T){let tt=x*C;for(f=1;f<x-2;f++)for(X=tt+f*C,G=tt+(f+1)*C,d=1;d<C-2;d++)v[p++]=G+d,v[p++]=X+d,v[p++]=X+d+1,v[p++]=G+d,v[p++]=X+d+1,v[p++]=G+d+1}let $,J;if(T){if(S)for(J=x*C,f=1;f<C-2;f++)v[p++]=f,v[p++]=f+1,v[p++]=J+f+1,v[p++]=f,v[p++]=J+f+1,v[p++]=J+f;if(w)for($=x*C-C,J=x*C*b-C,f=1;f<C-2;f++)v[p++]=$+f+1,v[p++]=$+f,v[p++]=J+f,v[p++]=$+f+1,v[p++]=J+f,v[p++]=J+f+1}if(D){for(f=1;f<x-2;f++)J=C*x+C*f,$=C*f,v[p++]=J,v[p++]=$+C,v[p++]=$,v[p++]=J,v[p++]=J+C,v[p++]=$+C;for(f=1;f<x-2;f++)J=C*x+C*(f+1)-1,$=C*(f+1)-1,v[p++]=$+C,v[p++]=J,v[p++]=$,v[p++]=$+C,v[p++]=J+C,v[p++]=J}let ce=new dn;a.position&&(ce.position=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:O}));let de=0,ie=0,ae=0,_e=0,be=I/2,Te,Oe=oe.fromCartesian3(t),Be=oe.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(f=0;f<I;f++){Te=B[f]?Be:Oe;let tt=h.fromArray(O,f*3,AIe),lt=Te.geodeticSurfaceNormal(tt,TIe);if(L[f]&&h.negate(lt,lt),a.st){let Pt=W.negate(lt,SIe);U[de++]=Math.atan2(Pt.y,Pt.x)/M.TWO_PI+.5,U[de++]=Math.asin(lt.z)/Math.PI+.5}if(a.normal&&(P[ie++]=lt.x,P[ie++]=lt.y,P[ie++]=lt.z),a.tangent||a.bitangent){let Pt=bIe,ht=0,wn;if(B[f]&&(ht=be),!S&&f>=ht&&f<ht+C*2?wn=h.UNIT_X:wn=h.UNIT_Z,h.cross(wn,lt,Pt),h.normalize(Pt,Pt),a.tangent&&(R[ae++]=Pt.x,R[ae++]=Pt.y,R[ae++]=Pt.z),a.bitangent){let ii=h.cross(lt,Pt,EIe);h.normalize(ii,ii),F[_e++]=ii.x,F[_e++]=ii.y,F[_e++]=ii.z}}}a.st&&(ce.st=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:U})),a.normal&&(ce.normal=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:P})),a.tangent&&(ce.tangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:R})),a.bitangent&&(ce.bitangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:F}))}if(l(e._offsetAttribute)){let tt=O.length,lt=e._offsetAttribute===nn.NONE?0:1,Pt=new Uint8Array(tt/3).fill(lt);ce.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:Pt})}return new ot({attributes:ce,indices:v,primitiveType:Me.TRIANGLES,boundingSphere:re.fromEllipsoid(Oe),offsetAttribute:e._offsetAttribute})};var nG;np.getUnitEllipsoid=function(){return l(nG)||(nG=np.createGeometry(new np({radii:new h(1,1,1),vertexFormat:Pe.POSITION_ONLY}))),nG};var Us=np;var vIe=new h(1,1,1),nO=Math.cos,iO=Math.sin;function kA(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,vIe),n=y(e.innerRadii,t),i=y(e.minimumClock,0),r=y(e.maximumClock,M.TWO_PI),o=y(e.minimumCone,0),s=y(e.maximumCone,M.PI),a=Math.round(y(e.stackPartitions,10)),c=Math.round(y(e.slicePartitions,8)),u=Math.round(y(e.subdivisions,128));this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}kA.packedLength=2*h.packedLength+8;kA.pack=function(e,t,n){return n=y(n,0),h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=y(e._offsetAttribute,-1),t};var zQ=new h,HQ=new h,ip={radii:zQ,innerRadii:HQ,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};kA.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,zQ);t+=h.packedLength;let r=h.unpack(e,t,HQ);t+=h.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(r,n._innerRadii),n._minimumClock=o,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=d,n._offsetAttribute=p===-1?void 0:p,n):(ip.minimumClock=o,ip.maximumClock=s,ip.minimumCone=a,ip.maximumCone=c,ip.stackPartitions=u,ip.slicePartitions=f,ip.subdivisions=d,ip.offsetAttribute=p===-1?void 0:p,new kA(ip))};kA.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,r=e._maximumClock,o=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=oe.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(r-i)/M.TWO_PI),f=Math.round(f*Math.abs(s-o)/M.PI),u<2&&(u=2),f<2&&(f=2);let d=0,p=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,m=!1,x=!1;g&&(p=2,o>0&&(m=!0,d+=u),s<Math.PI&&(x=!0,d+=u));let C=a*p*(f+u),A=new Float64Array(C*3),b=2*(C+d-(u+f)*p),T=Le.createTypedArray(C,b),S,w,D,I,O=0,B=new Array(f),L=new Array(f);for(S=0;S<f;S++)I=o+S*(s-o)/(f-1),B[S]=iO(I),L[S]=nO(I);let _=new Array(a),E=new Array(a);for(S=0;S<a;S++)D=i+S*(r-i)/(a-1),_[S]=iO(D),E[S]=nO(D);for(S=0;S<f;S++)for(w=0;w<a;w++)A[O++]=t.x*B[S]*E[w],A[O++]=t.y*B[S]*_[w],A[O++]=t.z*L[S];if(g)for(S=0;S<f;S++)for(w=0;w<a;w++)A[O++]=n.x*B[S]*E[w],A[O++]=n.y*B[S]*_[w],A[O++]=n.z*L[S];for(B.length=a,L.length=a,S=0;S<a;S++)I=o+S*(s-o)/(a-1),B[S]=iO(I),L[S]=nO(I);for(_.length=u,E.length=u,S=0;S<u;S++)D=i+S*(r-i)/(u-1),_[S]=iO(D),E[S]=nO(D);for(S=0;S<a;S++)for(w=0;w<u;w++)A[O++]=t.x*B[S]*E[w],A[O++]=t.y*B[S]*_[w],A[O++]=t.z*L[S];if(g)for(S=0;S<a;S++)for(w=0;w<u;w++)A[O++]=n.x*B[S]*E[w],A[O++]=n.y*B[S]*_[w],A[O++]=n.z*L[S];for(O=0,S=0;S<f*p;S++){let R=S*a;for(w=0;w<a-1;w++)T[O++]=R+w,T[O++]=R+w+1}let v=f*a*p;for(S=0;S<u;S++)for(w=0;w<a-1;w++)T[O++]=v+S+w*u,T[O++]=v+S+(w+1)*u;if(g)for(v=f*a*p+u*a,S=0;S<u;S++)for(w=0;w<a-1;w++)T[O++]=v+S+w*u,T[O++]=v+S+(w+1)*u;if(g){let R=f*a*p,F=R+a*u;if(m)for(S=0;S<u;S++)T[O++]=R+S,T[O++]=F+S;if(x)for(R+=a*u-u,F+=a*u-u,S=0;S<u;S++)T[O++]=R+S,T[O++]=F+S}let P=new dn({position:new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:A})});if(l(e._offsetAttribute)){let R=A.length,F=e._offsetAttribute===nn.NONE?0:1,U=new Uint8Array(R/3).fill(F);P.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:U})}return new ot({attributes:P,indices:T,primitiveType:Me.LINES,boundingSphere:re.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var zu=kA;function UA(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Qi({ellipsoid:y(e.ellipsoid,oe.WGS84)})),this._levelZeroMaximumGeometricError=ns.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new ge,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(UA.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});UA.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Fa({buffer:new Uint8Array(16*16),width:16,height:16}))};UA.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};UA.prototype.getTileDataAvailable=function(e,t,n){};UA.prototype.loadTileDataAvailability=function(e,t,n){};var H_=UA;function iG(){this._removalFunctions=[]}iG.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let r=this;return function(){i();let o=r._removalFunctions;o.splice(o.indexOf(i),1)}};iG.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Yo=iG;var DIe={enableModelExperimental:!1},zA=DIe;var PIe={NONE:0,HOLD:1,EXTRAPOLATE:2},Hu=Object.freeze(PIe);function Ph(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new da,this._orthographicMatrix=new N}function GQ(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=N.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(Ph.prototype,{projectionMatrix:{get:function(){return GQ(this),this._orthographicMatrix}}});var IIe=new h,OIe=new h,RIe=new h,rG=new h;Ph.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,r=this.top,o=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=h.cross(t,n,IIe);h.normalize(f,f);let d=OIe;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=RIe;h.multiplyByScalar(f,a,p),h.add(d,p,p);let g=i[0];return l(g)||(g=i[0]=new se),g.x=f.x,g.y=f.y,g.z=f.z,g.w=-h.dot(f,p),h.multiplyByScalar(f,s,p),h.add(d,p,p),g=i[1],l(g)||(g=i[1]=new se),g.x=-f.x,g.y=-f.y,g.z=-f.z,g.w=-h.dot(h.negate(f,rG),p),h.multiplyByScalar(n,o,p),h.add(d,p,p),g=i[2],l(g)||(g=i[2]=new se),g.x=n.x,g.y=n.y,g.z=n.z,g.w=-h.dot(n,p),h.multiplyByScalar(n,r,p),h.add(d,p,p),g=i[3],l(g)||(g=i[3]=new se),g.x=-n.x,g.y=-n.y,g.z=-n.z,g.w=-h.dot(h.negate(n,rG),p),g=i[4],l(g)||(g=i[4]=new se),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-h.dot(t,d),h.multiplyByScalar(t,u,p),h.add(e,p,p),g=i[5],l(g)||(g=i[5]=new se),g.x=-t.x,g.y=-t.y,g.z=-t.z,g.w=-h.dot(h.negate(t,rG),p),this._cullingVolume};Ph.prototype.getPixelDimensions=function(e,t,n,i,r){GQ(this);let o=this.right-this.left,s=this.top-this.bottom,a=i*o/e,c=i*s/t;return r.x=a,r.y=c,r};Ph.prototype.clone=function(e){return l(e)||(e=new Ph),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};Ph.prototype.equals=function(e){return l(e)&&e instanceof Ph&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Ph.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Ph&&M.equalsEpsilon(this.right,e.right,t,n)&&M.equalsEpsilon(this.left,e.left,t,n)&&M.equalsEpsilon(this.top,e.top,t,n)&&M.equalsEpsilon(this.bottom,e.bottom,t,n)&&M.equalsEpsilon(this.near,e.near,t,n)&&M.equalsEpsilon(this.far,e.far,t,n)};var Xo=Ph;function al(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new Xo,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far}al.packedLength=4;al.pack=function(e,t,n){return n=y(n,0),t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};al.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new al),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function Iy(e){let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(al.prototype,{projectionMatrix:{get:function(){return Iy(this),this._offCenterFrustum.projectionMatrix}}});al.prototype.computeCullingVolume=function(e,t,n){return Iy(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};al.prototype.getPixelDimensions=function(e,t,n,i,r){return Iy(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};al.prototype.clone=function(e){return l(e)||(e=new al),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};al.prototype.equals=function(e){return!l(e)||!(e instanceof al)?!1:(Iy(this),Iy(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};al.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof al)?!1:(Iy(this),Iy(e),M.equalsEpsilon(this.width,e.width,t,n)&&M.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var en=al;function Ih(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new da,this._perspectiveMatrix=new N,this._infinitePerspective=new N}function oG(e){let t=e.top,n=e.bottom,i=e.right,r=e.left,o=e.near,s=e.far;(t!==e._top||n!==e._bottom||r!==e._left||i!==e._right||o!==e._near||s!==e._far)&&(e._left=r,e._right=i,e._top=t,e._bottom=n,e._near=o,e._far=s,e._perspectiveMatrix=N.computePerspectiveOffCenter(r,i,n,t,o,s,e._perspectiveMatrix),e._infinitePerspective=N.computeInfinitePerspectiveOffCenter(r,i,n,t,o,e._infinitePerspective))}Object.defineProperties(Ih.prototype,{projectionMatrix:{get:function(){return oG(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return oG(this),this._infinitePerspective}}});var MIe=new h,BIe=new h,LIe=new h,NIe=new h;Ih.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,r=this.top,o=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=h.cross(t,n,MIe),d=BIe;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=LIe;h.multiplyByScalar(t,u,p),h.add(e,p,p);let g=NIe;h.multiplyByScalar(f,a,g),h.add(d,g,g),h.subtract(g,e,g),h.normalize(g,g),h.cross(g,n,g),h.normalize(g,g);let m=i[0];return l(m)||(m=i[0]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(f,s,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(n,g,g),h.normalize(g,g),m=i[1],l(m)||(m=i[1]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(n,o,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(f,g,g),h.normalize(g,g),m=i[2],l(m)||(m=i[2]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(n,r,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(g,f,g),h.normalize(g,g),m=i[3],l(m)||(m=i[3]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),m=i[4],l(m)||(m=i[4]=new se),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-h.dot(t,d),h.negate(t,g),m=i[5],l(m)||(m=i[5]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,p),this._cullingVolume};Ih.prototype.getPixelDimensions=function(e,t,n,i,r){oG(this);let o=1/this.near,s=this.top*o,a=2*i*n*s/t;s=this.right*o;let c=2*i*n*s/e;return r.x=c,r.y=a,r};Ih.prototype.clone=function(e){return l(e)||(e=new Ih),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};Ih.prototype.equals=function(e){return l(e)&&e instanceof Ih&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Ih.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Ih&&M.equalsEpsilon(this.right,e.right,t,n)&&M.equalsEpsilon(this.left,e.left,t,n)&&M.equalsEpsilon(this.top,e.top,t,n)&&M.equalsEpsilon(this.bottom,e.bottom,t,n)&&M.equalsEpsilon(this.near,e.near,t,n)&&M.equalsEpsilon(this.far,e.far,t,n)};var cl=Ih;function ll(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new cl,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this.xOffset=y(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=y(e.yOffset,0),this._yOffset=this.yOffset}ll.packedLength=6;ll.pack=function(e,t,n){return n=y(n,0),t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};ll.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ll),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function Oh(e){let t=e._offCenterFrustum;(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset)&&(e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset,t.top=e.near*Math.tan(.5*e._fovy),t.bottom=-t.top,t.right=e.aspectRatio*t.top,t.left=-t.right,t.near=e.near,t.far=e.far,t.right+=e.xOffset,t.left+=e.xOffset,t.top+=e.yOffset,t.bottom+=e.yOffset)}Object.defineProperties(ll.prototype,{projectionMatrix:{get:function(){return Oh(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Oh(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Oh(this),this._fovy}},sseDenominator:{get:function(){return Oh(this),this._sseDenominator}}});ll.prototype.computeCullingVolume=function(e,t,n){return Oh(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};ll.prototype.getPixelDimensions=function(e,t,n,i,r){return Oh(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};ll.prototype.clone=function(e){return l(e)||(e=new ll),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};ll.prototype.equals=function(e){return!l(e)||!(e instanceof ll)?!1:(Oh(this),Oh(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};ll.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof ll)?!1:(Oh(this),Oh(e),M.equalsEpsilon(this.fov,e.fov,t,n)&&M.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var bi=ll;var rO=0,FIe=1;function Oy(e){let t=e.frustum,n=e.orientation,i=e.origin,r=y(e.vertexFormat,Pe.DEFAULT),o=y(e._drawNearPlane,!0),s,a;t instanceof bi?(s=rO,a=bi.packedLength):t instanceof en&&(s=FIe,a=en.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Re.clone(n),this._drawNearPlane=o,this._vertexFormat=r,this._workerName="createFrustumGeometry",this.packedLength=2+a+h.packedLength+Re.packedLength+Pe.packedLength}Oy.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,r=e._frustum;return t[n++]=i,i===rO?(bi.pack(r,t,n),n+=bi.packedLength):(en.pack(r,t,n),n+=en.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Re.pack(e._orientation,t,n),n+=Re.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n]=e._drawNearPlane?1:0,t};var VIe=new bi,kIe=new en,UIe=new Re,zIe=new h,HIe=new Pe;Oy.unpack=function(e,t,n){t=y(t,0);let i=e[t++],r;i===rO?(r=bi.unpack(e,t,VIe),t+=bi.packedLength):(r=en.unpack(e,t,kIe),t+=en.packedLength);let o=h.unpack(e,t,zIe);t+=h.packedLength;let s=Re.unpack(e,t,UIe);t+=Re.packedLength;let a=Pe.unpack(e,t,HIe);t+=Pe.packedLength;let c=e[t]===1;if(!l(n))return new Oy({frustum:r,origin:o,orientation:s,vertexFormat:a,_drawNearPlane:c});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(u),n._frustumType=i,n._origin=h.clone(o,n._origin),n._orientation=Re.clone(s,n._orientation),n._vertexFormat=Pe.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function HA(e,t,n,i,r,o,s,a){let c=e/3*2;for(let u=0;u<4;++u)l(t)&&(t[e]=o.x,t[e+1]=o.y,t[e+2]=o.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;r[c]=0,r[c+1]=0,r[c+2]=1,r[c+3]=0,r[c+4]=1,r[c+5]=1,r[c+6]=0,r[c+7]=1}var GIe=new Q,WIe=new N,sG=new N,WQ=new h,jQ=new h,qQ=new h,jIe=new h,qIe=new h,YIe=new h,G_=new Array(3),WS=new Array(4);WS[0]=new se(-1,-1,1,1);WS[1]=new se(1,-1,1,1);WS[2]=new se(1,1,1,1);WS[3]=new se(-1,1,1,1);var YQ=new Array(4);for(let e=0;e<4;++e)YQ[e]=new se;Oy._computeNearFarPlanes=function(e,t,n,i,r,o,s,a){let c=Q.fromQuaternion(t,GIe),u=y(o,WQ),f=y(s,jQ),d=y(a,qQ);u=Q.getColumn(c,0,u),f=Q.getColumn(c,1,f),d=Q.getColumn(c,2,d),h.normalize(u,u),h.normalize(f,f),h.normalize(d,d),h.negate(u,u);let p=N.computeView(e,d,f,u,WIe),g,m;if(n===rO){let x=i.projectionMatrix,C=N.multiply(x,p,sG);m=N.inverse(C,sG)}else g=N.inverseTransformation(p,sG);l(m)?(G_[0]=i.near,G_[1]=i.far):(G_[0]=0,G_[1]=i.near,G_[2]=i.far);for(let x=0;x<2;++x)for(let C=0;C<4;++C){let A=se.clone(WS[C],YQ[C]);if(l(m)){A=N.multiplyByVector(m,A,A);let b=1/A.w;h.multiplyByScalar(A,b,A),h.subtract(A,e,A),h.normalize(A,A);let T=h.dot(d,A);h.multiplyByScalar(A,G_[x]/T,A),h.add(A,e,A)}else{l(i._offCenterFrustum)&&(i=i._offCenterFrustum);let b=G_[x],T=G_[x+1];A.x=(A.x*(i.right-i.left)+i.left+i.right)*.5,A.y=(A.y*(i.top-i.bottom)+i.bottom+i.top)*.5,A.z=(A.z*(b-T)-b-T)*.5,A.w=1,N.multiplyByVector(g,A,A)}r[12*x+C*3]=A.x,r[12*x+C*3+1]=A.y,r[12*x+C*3+2]=A.z}};Oy.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=e._vertexFormat,a=o?6:5,c=new Float64Array(3*4*6);Oy._computeNearFarPlanes(i,r,t,n,c);let u=3*4*2;c[u]=c[3*4],c[u+1]=c[3*4+1],c[u+2]=c[3*4+2],c[u+3]=c[0],c[u+4]=c[1],c[u+5]=c[2],c[u+6]=c[3*3],c[u+7]=c[3*3+1],c[u+8]=c[3*3+2],c[u+9]=c[3*7],c[u+10]=c[3*7+1],c[u+11]=c[3*7+2],u+=3*4,c[u]=c[3*5],c[u+1]=c[3*5+1],c[u+2]=c[3*5+2],c[u+3]=c[3],c[u+4]=c[3+1],c[u+5]=c[3+2],c[u+6]=c[0],c[u+7]=c[1],c[u+8]=c[2],c[u+9]=c[3*4],c[u+10]=c[3*4+1],c[u+11]=c[3*4+2],u+=3*4,c[u]=c[3],c[u+1]=c[3+1],c[u+2]=c[3+2],c[u+3]=c[3*5],c[u+4]=c[3*5+1],c[u+5]=c[3*5+2],c[u+6]=c[3*6],c[u+7]=c[3*6+1],c[u+8]=c[3*6+2],c[u+9]=c[3*2],c[u+10]=c[3*2+1],c[u+11]=c[3*2+2],u+=3*4,c[u]=c[3*2],c[u+1]=c[3*2+1],c[u+2]=c[3*2+2],c[u+3]=c[3*6],c[u+4]=c[3*6+1],c[u+5]=c[3*6+2],c[u+6]=c[3*7],c[u+7]=c[3*7+1],c[u+8]=c[3*7+2],c[u+9]=c[3*3],c[u+10]=c[3*3+1],c[u+11]=c[3*3+2],o||(c=c.subarray(3*4));let f=new dn({position:new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:c})});if(l(s.normal)||l(s.tangent)||l(s.bitangent)||l(s.st)){let p=l(s.normal)?new Float32Array(12*a):void 0,g=l(s.tangent)?new Float32Array(3*4*a):void 0,m=l(s.bitangent)?new Float32Array(3*4*a):void 0,x=l(s.st)?new Float32Array(2*4*a):void 0,C=WQ,A=jQ,b=qQ,T=h.negate(C,jIe),S=h.negate(A,qIe),w=h.negate(b,YIe);u=0,o&&(HA(u,p,g,m,x,w,C,A),u+=3*4),HA(u,p,g,m,x,b,T,A),u+=3*4,HA(u,p,g,m,x,T,w,A),u+=3*4,HA(u,p,g,m,x,S,w,T),u+=3*4,HA(u,p,g,m,x,C,b,A),u+=3*4,HA(u,p,g,m,x,A,b,T),l(p)&&(f.normal=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:p})),l(g)&&(f.tangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:g})),l(m)&&(f.bitangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:m})),l(x)&&(f.st=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:x}))}let d=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,m=p*4;d[g]=m,d[g+1]=m+1,d[g+2]=m+2,d[g+3]=m,d[g+4]=m+2,d[g+5]=m+3}return new ot({attributes:f,indices:d,primitiveType:Me.TRIANGLES,boundingSphere:re.fromVertices(c)})};var GA=Oy;var aG=0,XIe=1;function jS(e){let t=e.frustum,n=e.orientation,i=e.origin,r=y(e._drawNearPlane,!0),o,s;t instanceof bi?(o=aG,s=bi.packedLength):t instanceof en&&(o=XIe,s=en.packedLength),this._frustumType=o,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Re.clone(n),this._drawNearPlane=r,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+h.packedLength+Re.packedLength}jS.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,r=e._frustum;return t[n++]=i,i===aG?(bi.pack(r,t,n),n+=bi.packedLength):(en.pack(r,t,n),n+=en.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Re.pack(e._orientation,t,n),n+=Re.packedLength,t[n]=e._drawNearPlane?1:0,t};var KIe=new bi,$Ie=new en,ZIe=new Re,JIe=new h;jS.unpack=function(e,t,n){t=y(t,0);let i=e[t++],r;i===aG?(r=bi.unpack(e,t,KIe),t+=bi.packedLength):(r=en.unpack(e,t,$Ie),t+=en.packedLength);let o=h.unpack(e,t,JIe);t+=h.packedLength;let s=Re.unpack(e,t,ZIe);t+=Re.packedLength;let a=e[t]===1;if(!l(n))return new jS({frustum:r,origin:o,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(c),n._frustumType=i,n._origin=h.clone(o,n._origin),n._orientation=Re.clone(s,n._orientation),n._drawNearPlane=a,n};jS.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=new Float64Array(3*4*2);GA._computeNearFarPlanes(i,r,t,n,s);let a=new dn({position:new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:s})}),c,u,f=o?2:1,d=new Uint16Array(8*(f+1)),p=o?0:1;for(;p<2;++p)c=o?p*8:0,u=p*4,d[c]=u,d[c+1]=u+1,d[c+2]=u+1,d[c+3]=u+2,d[c+4]=u+2,d[c+5]=u+3,d[c+6]=u+3,d[c+7]=u;for(p=0;p<2;++p)c=(f+p)*8,u=p*4,d[c]=u,d[c+1]=u+4,d[c+2]=u+1,d[c+3]=u+5,d[c+4]=u+2,d[c+5]=u+6,d[c+6]=u+3,d[c+7]=u+7;return new ot({attributes:a,indices:d,primitiveType:Me.LINES,boundingSphere:re.fromVertices(s)})};var oO=jS;function XQ(){}XQ.prototype.geocode=ye.throwInstantiationError;var KQ=XQ;var QIe={SEARCH:0,AUTOCOMPLETE:1},Ry=Object.freeze(QIe);function $Q(){ye.throwInstantiationError()}$Q.createGeometry=function(e){ye.throwInstantiationError()};var ZQ=$Q;function eOe(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.value=e.value}var Ac=eOe;function tOe(e){let t=new oi.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var W_=tOe;function nOe(e,t,n){let i=new Uint8ClampedArray(e.buffer),r=new ImageData(i,t,n),o=document.createElement("canvas");return o.width=t,o.height=n,o.getContext("2d").putImageData(r,0,0),o}var sO=nOe;function iOe(e,t){return t=y(t,0),fa(e,t,Math.min(4,e.length))}var Gu=iOe;var WA=Ns(JQ(),1);function rOe(e,t){return(e&t)!==0}var Tc=rOe;var oOe=[1,2,4,8],QQ=15,sOe=16,aOe=64,cOe=128;function Rh(e,t,n,i,r,o){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=r,this.terrainProvider=o,this.ancestorHasTerrain=!1,this.terrainState=void 0}Rh.clone=function(e,t){return l(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new Rh(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};Rh.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};Rh.prototype.hasSubtree=function(){return Tc(this._bits,sOe)};Rh.prototype.hasImagery=function(){return Tc(this._bits,aOe)};Rh.prototype.hasTerrain=function(){return Tc(this._bits,cOe)};Rh.prototype.hasChildren=function(){return Tc(this._bits,QQ)};Rh.prototype.hasChild=function(e){return Tc(this._bits,oOe[e])};Rh.prototype.getChildBitmask=function(){return this._bits&QQ};var aO=Rh;function lOe(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let r=0;r<t;++r)i[r]=e.charCodeAt(r);return n}var uOe=lOe(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y
- wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0<VqH\x82'UfYNe\x98u\xA3aF}a?A\0\x9F\xD7\xB44M\xCE\x87F\xB0\xD5\xB8\x8A'{\x8B\xDC+\xBBMg0\xC8\xD1\xF6\\\x8FP\xFA[/F\x9Bn5/'C.\xEB
- \f^\xA5s\x1Be4\xE5l.jC'c#U\xA9?q{gC}:\xAF\xCD\xE2TU\x9C\xFDK\xC6\xE2\x9F/(\xED\xCB\\\xC6-f\x07\x88\xA7;/*"N\xB0k.\xDD\r\x95}}G\xBAC\xB2\xB2+>M\xAA>}\xE6\xCEI\x89\xC6\xE6x\fa1-\xA4O\xA5~q \x88\xEC\r1\xE8N\v\0nPh}=\b\r\x95\xA6n\xA3h\x97$[k\xF3#\xF3\xB6s\xB3\r\v@\xC0\x9F\xD8Q]\xFA".j\xDFI\0\xB9\xA0wU\xC6\xEFj\xBF{GL\x7F\x83\xEE\xDC\xDCF\x85\xA9\xADS\x07+S4\x07\xFF\x94Y\xE48\xE81\x83N\xB9XFk\xCB-#\x86\x92p\x005\x88"\xCF1\xB2&/\xE7\xC3u-6,rt\xB0#G\xB7\xD3\xD1&\x857r\xE2\0\x8CD\xCF\xDA3-\xDE\`\x86i#i*|\xCDKQ\r\x95T9w.)\xEA\x1B\xA6P\xA2j\x8FoP\x99\\>T\xFB\xEFP[\v\x07E\x89m(w7\xDB\x8EJfJo\x99 \xE5p\xE2\xB9q~\fmI-z\xFEr\xC7\xF2Y0\x8F\xBB]s\xE5\xC9 \xEAx\xEC \x90\xF0\x8A\x7FB|G\`\xB0\xBD&\xB7q\xB6\xC7\x9F\xD13\x82=\xD3\xAB\xEEc\x99\xC8+S\xA0D\\q\xC6\xCCD2O<\xCA\xC0)=R\xD3aX\xA9}e\xB4\xDC\xCF\r\xF4=\xF1\b\xA9B\xDA# \xD8\xBF^PI\xF8M\xC0\xCBGLO\xF7{+\xD8\xC51\x92;\xB5o\xDCl\r\x92\x88\xD1\x9E\xDB?\xE2\xE9\xDA_\xD4\x84\xE2FaZ\xDEU\xCF\xA4\0\xBE\xFD\xCEg\xF1Ji\x97\xE6 H\xD8]\x7F~\xAEq N\xAE\xC0V\xA9\x91<\x82r\xE7v\xEC)I\xD6]-\x83\xE3\xDB6\xA9;f\x97\x87j\xD5\xB6=P^R\xB9K\xC7sWx\xC9\xF4.Y\x07\x95\x93o\xD0KW>''\xC7\`\xDB;\xED\x9ASD>?\x8D\x92mw\xA2
- \xEB?R\xA8\xC6U^1I7\x85\xF4\xC5&-\xA9\xBF\x8B'T\xDA\xC3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1
- ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS
- >\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88
- \x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function id(e){let t=e;typeof t!="string"&&!(t instanceof De)&&(t=e.url);let n=De.createIfNeeded(t);n.appendForwardSlash(),this._resource=n,this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=M.EPSILON12,this.providers={},this.key=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={};let i=this;this._readyPromise=fOe(this).then(function(){return i.getQuadTreePacket("",i._quadPacketVersion)}).then(function(){return!0}).catch(function(r){let o=`An error occurred while accessing ${tee(i,"",1).url}.`;return Promise.reject(new fe(o))})}Object.defineProperties(id.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}},readyPromise:{get:function(){return this._readyPromise}}});id.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;Tc(t,o)?Tc(e,o)&&(s|=1):(s|=2,Tc(e,o)||(s|=1)),i+=s}return i};id.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let r=i;r>=0;--r){let o=1<<r,s=+e[i-r];Tc(s,2)?Tc(s,1)||(t|=o):(n|=o,Tc(s,1)&&(t|=o))}return{x:t,y:n,level:i}};id.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,r;for(;i.length>1;)if(r=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(r))&&(n=!1);break}else if(t===null){n=!1;break}return n};var eee=new Mi("decodeGoogleEarthEnterprisePacket");id.prototype.getQuadTreePacket=function(e,t,n){t=y(t,1),e=y(e,"");let r=tee(this,e,t,n).fetchArrayBuffer();if(!l(r))return;let o=this._tileInfo,s=this.key;return r.then(function(a){return eee.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let f,d=-1;if(e!==""){d=e.length+1;let m=u[e];f=o[e],f._bits|=m._bits,delete u[e]}let p=Object.keys(u);p.sort(function(m,x){return m.length-x.length});let g=p.length;for(let m=0;m<g;++m){let x=p[m];if(u[x]!==null){let A=aO.clone(u[x]),b=x.length;if(b===d)A.setParent(f);else if(b>1){let T=o[x.substring(0,x.length-1)];A.setParent(T)}o[x]=A}else o[x]=null}})})};id.prototype.populateSubtree=function(e,t,n,i){let r=id.tileXYToQuadKey(e,t,n);return uG(this,r,i)};function uG(e,t,n){let i=e._tileInfo,r=t,o=i[r];if(l(o)&&(!o.hasSubtree()||o.hasChildren()))return o;for(;o===void 0&&r.length>1;)r=r.substring(0,r.length-1),o=i[r];let s,a=e._subtreePromises,c=a[r];if(l(c))return c.then(function(){return s=new oo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),uG(e,t,s)});if(!l(o)||!o.hasSubtree())return Promise.reject(new fe(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(r,o.cnodeVersion,n),!!l(c))return a[r]=c,c.then(function(){return s=new oo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),uG(e,t,s)}).finally(function(){delete a[r]})}id.prototype.getTileInformation=function(e,t,n){let i=id.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};id.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function tee(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var cG,lG;function fOe(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(lG)){let n=Qt("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;lG=XC(n).then(function(){cG=window.cesiumGoogleEarthDbRootParser(WA),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return lG.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=cG.EncryptedDbRootProto.decode(new Uint8Array(n)),r=i.encryptionData,o=r.byteOffset,s=o+r.byteLength,a=e.key=r.buffer.slice(o,s);r=i.dbrootData,o=r.byteOffset,s=o+r.byteLength;let c=r.buffer.slice(o,s);return eee.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=cG.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=y(i.imageryPresent,e.imageryPresent),e.protoImagery=i.protoImagery,e.terrainPresent=y(i.terrainPresent,e.terrainPresent),l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=y(a.negativeAltitudeExponentBias,e.negativeAltitudeExponentBias),e.negativeAltitudeThreshold=y(a.compressedNegativeAltitudeThreshold,e.negativeAltitudeThreshold)}l(i.databaseVersion)&&(e._quadPacketVersion=y(i.databaseVersion.quadtreeVersion,e._quadPacketVersion));let r=e.providers,o=y(i.providerInfo,[]),s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.copyrightString;l(u)&&(r[c.providerId]=new Gt(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=uOe})}var Mh=id;function My(e){e=y(e,y.EMPTY_OBJECT),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=y(e.childTileMask,15),n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(My.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var ree="createVerticesFromGoogleEarthEnterpriseBuffer",dOe=new Mi(ree),hOe=new Mi(ree,gh.maximumAsynchronousTasks),nee=new he,fG=new he;My.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,r,nee),t.tileXYToRectangle(n,i,r,fG);let u=c.cartographicToCartesian(he.center(fG)),d=40075.16/(1<<r);this._skirtHeight=Math.min(d*8,1e3);let g=(a?hOe:dOe).scheduleTask({buffer:this._buffer,nativeRectangle:nee,rectangle:fG,relativeToCenter:u,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:o,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(g))return;let m=this;return g.then(function(x){return m._mesh=new Kf(u,new Float32Array(x.vertices),new Uint16Array(x.indices),x.indexCountWithoutSkirts,x.vertexCountWithoutSkirts,x.minimumHeight,x.maximumHeight,re.clone(x.boundingSphere3D),h.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,Ai.clone(x.orientedBoundingBox),mc.clone(x.encoding),x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),m._minimumHeight=x.minimumHeight,m._maximumHeight=x.maximumHeight,m._buffer=void 0,m._mesh})};My.prototype.interpolateHeight=function(e,t,n){let i=M.clamp((t-e.west)/e.width,0,1),r=M.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?yOe(this,i,r):AOe(this,i,r,e)};var mOe=new Mi("upsampleQuantizedTerrainMesh",gh.maximumAsynchronousTasks);My.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==r,u=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,s),p=mOe.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=this;return p.then(function(m){let x=new Uint16Array(m.vertices),C=Le.createTypedArray(x.length/3,m.indices),A=g._skirtHeight;return new pA({quantizedVertices:x,indices:C,minimumHeight:m.minimumHeight,maximumHeight:m.maximumHeight,boundingSphere:re.clone(m.boundingSphere),orientedBoundingBox:Ai.clone(m.orientedBoundingBox),horizonOcclusionPoint:h.clone(m.horizonOcclusionPoint),westIndices:m.westIndices,southIndices:m.southIndices,eastIndices:m.eastIndices,northIndices:m.northIndices,westSkirtHeight:A,southSkirtHeight:A,eastSkirtHeight:A,northSkirtHeight:A,childTileMask:0,createdByUpsampling:!0,credits:g._credits})})};My.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};My.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var pOe=new W,_Oe=new W,gOe=new W,oee=new h;function yOe(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=o.decodeTextureCoordinates(r,u,pOe),g=o.decodeTextureCoordinates(r,f,_Oe),m=o.decodeTextureCoordinates(r,d,gOe),x=I_.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,oee);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let C=o.decodeHeight(r,u),A=o.decodeHeight(r,f),b=o.decodeHeight(r,d);return x.x*C+x.y*A+x.z*b}}}var xOe=Uint16Array.BYTES_PER_ELEMENT,iee=Uint32Array.BYTES_PER_ELEMENT,dG=Int32Array.BYTES_PER_ELEMENT,COe=Float32Array.BYTES_PER_ELEMENT,hG=Float64Array.BYTES_PER_ELEMENT;function AOe(e,t,n,i){let r=e._buffer,o=0,s=0,a=0;n>.5?(t>.5?(o=2,s=.5):o=3,a=.5):t>.5&&(o=1,s=.5);let c=new DataView(r),u=0;for(let w=0;w<o;++w)u+=c.getUint32(u,!0),u+=iee;u+=iee,u+=2*hG;let f=M.toRadians(c.getFloat64(u,!0)*180);u+=hG;let d=M.toRadians(c.getFloat64(u,!0)*180);u+=hG;let p=i.width/f/2,g=i.height/d/2,m=c.getInt32(u,!0);u+=dG;let x=c.getInt32(u,!0)*3;u+=dG,u+=dG;let C=new Array(m),A=new Array(m),b=new Array(m),T;for(T=0;T<m;++T)C[T]=s+c.getUint8(u++)*p,A[T]=a+c.getUint8(u++)*g,b[T]=c.getFloat32(u,!0)*6371010,u+=COe;let S=new Array(x);for(T=0;T<x;++T)S[T]=c.getUint16(u,!0),u+=xOe;for(T=0;T<x;T+=3){let w=S[T],D=S[T+1],I=S[T+2],O=C[w],B=C[D],L=C[I],_=A[w],E=A[D],v=A[I],P=I_.computeBarycentricCoordinates(t,n,O,_,B,E,L,v,oee);if(P.x>=-1e-15&&P.y>=-1e-15&&P.z>=-1e-15)return P.x*b[w]+P.y*b[D]+P.z*b[I]}}var qS=My;var Wu={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},cO=new ee;function lO(){this._terrainCache={},this._lastTidy=ee.now()}lO.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:ee.now()}};lO.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};lO.prototype.tidy=function(){if(ee.now(cO),ee.secondsDifference(cO,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let r=t[i],o=e[r];ee.secondsDifference(cO,o.timestamp)>10&&delete e[r]}ee.clone(cO,this._lastTidy)}};function jA(e){e=y(e,y.EMPTY_OBJECT);let t;if(l(e.metadata))t=e.metadata;else{let o=De.createIfNeeded(e.url);t=new Mh(o)}this._metadata=t,this._tilingScheme=new Qi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new he(-M.PI,-M.PI,M.PI,M.PI),ellipsoid:e.ellipsoid});let n=e.credit;typeof n=="string"&&(n=new Gt(n)),this._credit=n,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new lO,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new ge,this._ready=!1;let i=this,r;this._readyPromise=t.readyPromise.then(function(o){if(!t.terrainPresent){let s=new fe(`The server ${t.url} doesn't have terrain`);return r=jn.reportError(r,i,i._errorEvent,s.message,void 0,void 0,void 0,s),Promise.reject(s)}return jn.reportSuccess(r),i._ready=o,o}).catch(function(o){return r=jn.reportError(r,i,i._errorEvent,o.message,void 0,void 0,void 0,o),Promise.reject(o)})}Object.defineProperties(jA.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});var TOe=new Mi("decodeGoogleEarthEnterprisePacket");function see(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Wu.PARENT){i=0;for(let r=0;r<4;++r){let o=n.getTileInformationFromQuadKey(e+r.toString());l(o)&&o.hasTerrain()&&(i|=1<<r)}}return i}jA.prototype.requestTileGeometry=function(e,t,n,i){let r=Mh.tileXYToQuadKey(e,t,n),o=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(r);if(!l(a))return Promise.reject(new fe("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=Wu.UNKNOWN);let u=o.get(r);if(l(u)){let A=s.providers[a.terrainProvider];return Promise.resolve(new qS({buffer:u,childTileMask:see(r,a,s),credits:l(A)?[A]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(o.tidy(),a.ancestorHasTerrain){if(c===Wu.NONE)return Promise.reject(new fe("Terrain tile doesn't exist"))}else return Promise.resolve(new Fa({buffer:new Uint8Array(16*16),width:16,height:16}));let f,d=r,p=-1;switch(c){case Wu.SELF:p=a.terrainVersion;break;case Wu.PARENT:d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),p=f.terrainVersion;break;case Wu.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),l(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new fe("Terrain tile doesn't exist"));let g=this._terrainPromises,m=this._terrainRequests,x,C;if(l(g[d]))x=g[d],C=m[d];else{C=i;let A=bOe(this,d,p,C).fetchArrayBuffer();if(!l(A))return;x=A.then(function(b){return l(b)?TOe.scheduleTask({buffer:b,type:"Terrain",key:s.key},[b]).then(function(T){let S=s.getTileInformationFromQuadKey(d);S.terrainState=Wu.SELF,o.add(d,T[0]);let w=S.terrainProvider,D=T.length-1;for(let I=0;I<D;++I){let O=d+I.toString(),B=s.getTileInformationFromQuadKey(O);l(B)&&(o.add(O,T[I+1]),B.terrainState=Wu.PARENT,B.terrainProvider===0&&(B.terrainProvider=w))}}):Promise.reject(new fe("Failed to load terrain."))}),g[d]=x,m[d]=C,x=x.finally(function(){delete g[d],delete m[d]})}return x.then(function(){let A=o.get(r);if(l(A)){let b=s.providers[a.terrainProvider];return new qS({buffer:A,childTileMask:see(r,a,s),credits:l(b)?[b]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new fe("Failed to load terrain."))}).catch(function(A){return C.state===mi.CANCELLED?(i.state=C.state,Promise.reject(A)):(a.terrainState=Wu.NONE,Promise.reject(A))})};jA.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};jA.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,r=Mh.tileXYToQuadKey(e,t,n),o=i.getTileInformation(e,t,n);if(o===null)return!1;if(l(o)){if(!o.ancestorHasTerrain)return!0;let s=o.terrainState;if(s===Wu.NONE)return!1;if((!l(s)||s===Wu.UNKNOWN)&&(o.terrainState=Wu.UNKNOWN,!o.hasTerrain())){r=r.substring(0,r.length-1);let a=i.getTileInformationFromQuadKey(r);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(r)){let s=new oo({throttle:!1,throttleByServer:!0,type:ro.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};jA.prototype.loadTileDataAvailability=function(e,t,n){};function bOe(e,t,n,i){return n=l(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var aee=jA;var AG=[Ii,ji],EOe=AG.length,vee=Math.cos(M.toRadians(30)),cee=Math.cos(M.toRadians(150)),Dee=0,Pee=1e3;function q_(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions;this.width=y(e.width,1),this._positions=t,this.granularity=y(e.granularity,9999),this.loop=y(e.loop,!1),this.arcType=y(e.arcType,Kt.GEODESIC),this._ellipsoid=oe.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(q_.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+oe.packedLength+1+1}}});q_.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<EOe;i++)if(t instanceof AG[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var SOe=new h,lee=new h,uee=new h;function CG(e,t,n,i,r){let o=bc(i,e,0,SOe),s=bc(i,e,n,lee),a=bc(i,t,0,uee),c=rp(s,o,lee),u=rp(a,o,uee);return h.cross(u,c,r),h.normalize(r,r)}var wOe=new me,vOe=new h,DOe=new h,POe=new h;function mG(e,t,n,i,r,o,s,a,c,u,f){if(r===0)return;let d;o===Kt.GEODESIC?d=new ed(e,t,s):o===Kt.RHUMB&&(d=new ka(e,t,s));let p=d.surfaceDistance;if(p<r)return;let g=CG(e,t,i,s,POe),m=Math.ceil(p/r),x=p/m,C=x,A=m-1,b=a.length;for(let T=0;T<A;T++){let S=d.interpolateUsingSurfaceDistance(C,wOe),w=bc(s,S,n,vOe),D=bc(s,S,i,DOe);h.pack(g,a,b),h.pack(w,c,b),h.pack(D,u,b),f.push(S.latitude),f.push(S.longitude),b+=3,C+=x}}var pG=new me;function bc(e,t,n,i){return me.clone(t,pG),pG.height=n,me.toCartesian(pG,e,i)}q_.pack=function(e,t,n){let i=y(n,0),r=e._positions,o=r.length;t[i++]=o;for(let s=0;s<o;++s){let a=r[s];h.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,oe.pack(e._ellipsoid,t,i),i+=oe.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};q_.unpack=function(e,t,n){let i=y(t,0),r=e[i++],o=new Array(r);for(let p=0;p<r;p++)o[p]=h.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],u=oe.unpack(e,i);i+=oe.packedLength;let f=e[i++],d=e[i++]===1;return l(n)||(n=new q_({positions:o})),n._positions=o,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=d,n};function rp(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function fee(e,t,n,i){return i=rp(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var IOe=new h,OOe=new h,ROe=new h,Iee=new h,MOe=0,BOe=-1;function _G(e,t,n,i,r){let o=rp(n,t,Iee),s=fee(e,t,o,IOe),a=fee(i,t,o,OOe);if(M.equalsEpsilon(h.dot(s,a),BOe,M.EPSILON5))return r=h.cross(o,s,r),r=h.normalize(r,r),r;r=h.add(a,s,r),r=h.normalize(r,r);let c=h.cross(o,r,ROe);return h.dot(a,c)<MOe&&(r=h.negate(r,r)),r}var hO=an.fromPointNormal(h.ZERO,h.UNIT_Y),LOe=new h,NOe=new h,FOe=new h,VOe=new h,kOe=new h,uO=new h,fO=new me,dee=new me,hee=new me;q_.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,r=e.granularity,o=e.arcType,s=new AG[e._projectionIndex](i),a=Dee,c=Pee,u,f,d=e._positions,p=d.length;p===2&&(n=!1);let g,m,x,C,A=new ka(void 0,void 0,i),b,T,S,w=[d[0]];for(f=0;f<p-1;f++)g=d[f],m=d[f+1],b=er.lineSegmentPlane(g,m,hO,uO),l(b)&&!h.equalsEpsilon(b,g,M.EPSILON7)&&!h.equalsEpsilon(b,m,M.EPSILON7)&&(e.arcType===Kt.GEODESIC?w.push(h.clone(b)):e.arcType===Kt.RHUMB&&(S=i.cartesianToCartographic(b,fO).longitude,x=i.cartesianToCartographic(g,fO),C=i.cartesianToCartographic(m,dee),A.setEndPoints(x,C),T=A.findIntersectionWithLongitude(S,hee),b=i.cartographicToCartesian(T,uO),l(b)&&!h.equalsEpsilon(b,g,M.EPSILON7)&&!h.equalsEpsilon(b,m,M.EPSILON7)&&w.push(h.clone(b)))),w.push(m);n&&(g=d[p-1],m=d[0],b=er.lineSegmentPlane(g,m,hO,uO),l(b)&&!h.equalsEpsilon(b,g,M.EPSILON7)&&!h.equalsEpsilon(b,m,M.EPSILON7)&&(e.arcType===Kt.GEODESIC?w.push(h.clone(b)):e.arcType===Kt.RHUMB&&(S=i.cartesianToCartographic(b,fO).longitude,x=i.cartesianToCartographic(g,fO),C=i.cartesianToCartographic(m,dee),A.setEndPoints(x,C),T=A.findIntersectionWithLongitude(S,hee),b=i.cartographicToCartesian(T,uO),l(b)&&!h.equalsEpsilon(b,g,M.EPSILON7)&&!h.equalsEpsilon(b,m,M.EPSILON7)&&w.push(h.clone(b)))));let D=w.length,I=new Array(D);for(f=0;f<D;f++){let j=me.fromCartesian(w[f],i);j.height=0,I[f]=j}if(I=vr(I,me.equalsEpsilon),D=I.length,D<2)return;let O=[],B=[],L=[],_=[],E=LOe,v=NOe,P=FOe,R=VOe,F=kOe,U=I[0],k=I[1],H=I[D-1];for(E=bc(i,H,a,E),R=bc(i,k,a,R),v=bc(i,U,a,v),P=bc(i,U,c,P),n?F=_G(E,v,P,R,F):F=CG(U,k,c,i,F),h.pack(F,B,0),h.pack(v,L,0),h.pack(P,_,0),O.push(U.latitude),O.push(U.longitude),mG(U,k,a,c,r,o,i,B,L,_,O),f=1;f<D-1;++f){E=h.clone(v,E),v=h.clone(R,v);let j=I[f];bc(i,j,c,P),bc(i,I[f+1],a,R),_G(E,v,P,R,F),u=B.length,h.pack(F,B,u),h.pack(v,L,u),h.pack(P,_,u),O.push(j.latitude),O.push(j.longitude),mG(I[f],I[f+1],a,c,r,o,i,B,L,_,O)}let V=I[D-1],q=I[D-2];if(v=bc(i,V,a,v),P=bc(i,V,c,P),n){let j=I[0];E=bc(i,q,a,E),R=bc(i,j,a,R),F=_G(E,v,P,R,F)}else F=CG(q,V,c,i,F);if(u=B.length,h.pack(F,B,u),h.pack(v,L,u),h.pack(P,_,u),O.push(V.latitude),O.push(V.longitude),n){for(mG(V,U,a,c,r,o,i,B,L,_,O),u=B.length,f=0;f<3;++f)B[u+f]=B[f],L[u+f]=L[f],_[u+f]=_[f];O.push(U.latitude),O.push(U.longitude)}return fRe(n,s,L,_,B,O,t)};var UOe=new h,zOe=new Q,HOe=new Re;function mee(e,t,n,i){let r=rp(n,t,UOe),o=h.dot(r,e);if(o>vee||o<cee){let s=rp(i,n,Iee),a=o<cee?M.PI_OVER_TWO:-M.PI_OVER_TWO,c=Re.fromAxisAngle(s,a,HOe),u=Q.fromQuaternion(c,zOe);return Q.multiplyByVector(u,e,e),!0}return!1}var pee=new me,GOe=new h,_ee=new h;function YS(e,t,n,i,r){let o=me.toCartesian(t,e._ellipsoid,GOe),s=h.add(o,n,_ee),a=!1,c=e._ellipsoid,u=c.cartesianToCartographic(s,pee);Math.abs(t.longitude-u.longitude)>M.PI_OVER_TWO&&(a=!0,s=h.subtract(o,n,_ee),u=c.cartesianToCartographic(s,pee)),u.height=0;let f=e.project(u,r);return r=h.subtract(f,i,r),r.z=0,r=h.normalize(r,r),a&&h.negate(r,r),r}var WOe=new h,gee=new h;function yee(e,t,n,i,r,o){let s=h.subtract(t,e,WOe);h.normalize(s,s);let a=n-Dee,c=h.multiplyByScalar(s,a,gee);h.add(e,c,r);let u=i-Pee;c=h.multiplyByScalar(s,u,gee),h.add(t,c,o)}var jOe=new h;function dO(e,t){let n=an.getPointDistance(hO,e),i=an.getPointDistance(hO,t),r=jOe;M.equalsEpsilon(n,0,M.EPSILON2)?(r=rp(t,e,r),h.multiplyByScalar(r,M.EPSILON2,r),h.add(e,r,e)):M.equalsEpsilon(i,0,M.EPSILON2)&&(r=rp(e,t,r),h.multiplyByScalar(r,M.EPSILON2,r),h.add(t,r,t))}function qOe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(M.equalsEpsilon(n,M.PI,M.EPSILON11)){let r=M.sign(t.longitude);return e.longitude=r*(n-M.EPSILON11),1}else if(M.equalsEpsilon(i,M.PI,M.EPSILON11)){let r=M.sign(e.longitude);return t.longitude=r*(i-M.EPSILON11),2}return 0}var Oee=new me,Ree=new me,xee=new h,gG=new h,Cee=new h,Aee=new h,YOe=new h,Tee=new h,XOe=[Oee,Ree],KOe=new he,$Oe=new h,ZOe=new h,JOe=new h,QOe=new h,eRe=new h,tRe=new h,yG=new h,xG=new h,nRe=new h,iRe=new h,rRe=new h,bee=new h,oRe=new h,sRe=new h,aRe=new zn,cRe=new zn,Eee=new h,lRe=new h,See=new h,uRe=[new re,new re],Mee=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],wee=Mee.length;function fRe(e,t,n,i,r,o,s){let a,c,u=t._ellipsoid,f=n.length/3-1,d=f*8,p=d*4,g=f*36,m=d>65535?new Uint32Array(g):new Uint16Array(g),x=new Float64Array(d*3),C=new Float32Array(p),A=new Float32Array(p),b=new Float32Array(p),T=new Float32Array(p),S=new Float32Array(p),w,D,I,O;s&&(w=new Float32Array(p),D=new Float32Array(p),I=new Float32Array(p),O=new Float32Array(d*2));let B=o.length/2,L=0,_=Oee;_.height=0;let E=Ree;E.height=0;let v=xee,P=gG;if(s)for(c=0,a=1;a<B;a++)_.latitude=o[c],_.longitude=o[c+1],E.latitude=o[c+2],E.longitude=o[c+3],v=t.project(_,v),P=t.project(E,P),L+=h.distance(v,P),c+=2;let R=i.length/3;P=h.unpack(i,0,P);let F=0;for(c=3,a=1;a<R;a++)v=h.clone(P,v),P=h.unpack(i,c,P),F+=h.distance(v,P),c+=3;let U;c=3;let k=0,H=0,V=0,q=0,j=!1,X=h.unpack(n,0,Aee),G=h.unpack(i,0,gG),$=h.unpack(r,0,Tee);if(e){let Te=h.unpack(n,n.length-6,Cee);mee($,Te,X,G)&&($=h.negate($,$))}let J=0,ce=0,de=0;for(a=0;a<f;a++){let Te=h.clone(X,Cee),Oe=h.clone(G,xee),Be=h.clone($,YOe);j&&(Be=h.negate(Be,Be)),X=h.unpack(n,c,Aee),G=h.unpack(i,c,gG),$=h.unpack(r,c,Tee),j=mee($,Te,X,G),_.latitude=o[k],_.longitude=o[k+1],E.latitude=o[k+2],E.longitude=o[k+3];let tt,lt,Pt,ht;if(s){let $n=qOe(_,E);tt=t.project(_,eRe),lt=t.project(E,tRe);let Ho=rp(lt,tt,Eee);Ho.y=Math.abs(Ho.y),Pt=yG,ht=xG,$n===0||h.dot(Ho,h.UNIT_Y)>vee?(Pt=YS(t,_,Be,tt,yG),ht=YS(t,E,$,lt,xG)):$n===1?(ht=YS(t,E,$,lt,xG),Pt.x=0,Pt.y=M.sign(_.longitude-Math.abs(E.longitude)),Pt.z=0):(Pt=YS(t,_,Be,tt,yG),ht.x=0,ht.y=M.sign(_.longitude-E.longitude),ht.z=0)}let wn=h.distance(Oe,G),ii=zn.fromCartesian(Te,aRe),nt=h.subtract(X,Te,nRe),Mt=h.normalize(nt,bee),ri=h.subtract(Oe,Te,iRe);ri=h.normalize(ri,ri);let we=h.cross(Mt,ri,bee);we=h.normalize(we,we);let _t=h.cross(ri,Be,oRe);_t=h.normalize(_t,_t);let Yt=h.subtract(G,X,rRe);Yt=h.normalize(Yt,Yt);let Gi=h.cross($,Yt,sRe);Gi=h.normalize(Gi,Gi);let ti=wn/F,Br=J/F,or=0,Lr,Pi,gr,Ia=0,He=0;if(s){or=h.distance(tt,lt),Lr=zn.fromCartesian(tt,cRe),Pi=h.subtract(lt,tt,Eee),gr=h.normalize(Pi,lRe);let $n=gr.x;gr.x=gr.y,gr.y=-$n,Ia=or/L,He=ce/L}for(U=0;U<8;U++){let $n=q+U*4,Ho=H+U*2,Go=$n+3,lc=U<4?1:-1,jr=U===2||U===3||U===6||U===7?1:-1;h.pack(ii.high,C,$n),C[Go]=nt.x,h.pack(ii.low,A,$n),A[Go]=nt.y,h.pack(_t,b,$n),b[Go]=nt.z,h.pack(Gi,T,$n),T[Go]=ti*lc,h.pack(we,S,$n);let Fr=Br*jr;Fr===0&&jr<0&&(Fr=9),S[Go]=Fr,s&&(w[$n]=Lr.high.x,w[$n+1]=Lr.high.y,w[$n+2]=Lr.low.x,w[$n+3]=Lr.low.y,I[$n]=-Pt.y,I[$n+1]=Pt.x,I[$n+2]=ht.y,I[$n+3]=-ht.x,D[$n]=Pi.x,D[$n+1]=Pi.y,D[$n+2]=gr.x,D[$n+3]=gr.y,O[Ho]=Ia*lc,Fr=He*jr,Fr===0&&jr<0&&(Fr=9),O[Ho+1]=Fr)}let We=JOe,Ue=QOe,Je=$Oe,gt=ZOe,cn=he.fromCartographicArray(XOe,KOe),Rn=fi.getMinimumMaximumHeights(cn,u),$i=Rn.minimumTerrainHeight,Nr=Rn.maximumTerrainHeight;de+=$i,de+=Nr,yee(Te,Oe,$i,Nr,We,Je),yee(X,G,$i,Nr,Ue,gt);let zo=h.multiplyByScalar(we,M.EPSILON5,See);h.add(We,zo,We),h.add(Ue,zo,Ue),h.add(Je,zo,Je),h.add(gt,zo,gt),dO(We,Ue),dO(Je,gt),h.pack(We,x,V),h.pack(Ue,x,V+3),h.pack(gt,x,V+6),h.pack(Je,x,V+9),zo=h.multiplyByScalar(we,-2*M.EPSILON5,See),h.add(We,zo,We),h.add(Ue,zo,Ue),h.add(Je,zo,Je),h.add(gt,zo,gt),dO(We,Ue),dO(Je,gt),h.pack(We,x,V+12),h.pack(Ue,x,V+15),h.pack(gt,x,V+18),h.pack(Je,x,V+21),k+=2,c+=3,H+=16,V+=24,q+=32,J+=wn,ce+=or}c=0;let ie=0;for(a=0;a<f;a++){for(U=0;U<wee;U++)m[c+U]=Mee[U]+ie;ie+=8,c+=wee}let ae=uRe;re.fromVertices(n,h.ZERO,3,ae[0]),re.fromVertices(i,h.ZERO,3,ae[1]);let _e=re.fromBoundingSpheres(ae);_e.radius+=de/(f*2);let be={position:new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,normalize:!1,values:x}),startHiAndForwardOffsetX:j_(C),startLoAndForwardOffsetY:j_(A),startNormalAndForwardOffsetZ:j_(b),endNormalAndTextureCoordinateNormalizationX:j_(T),rightNormalAndTextureCoordinateNormalizationY:j_(S)};return s&&(be.startHiLo2D=j_(w),be.offsetAndRight2D=j_(D),be.startEndNormals2D=j_(I),be.texcoordNormalization2D=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,normalize:!1,values:O})),new ot({attributes:be,indices:m,boundingSphere:_e})}function j_(e){return new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}q_._projectNormal=YS;var qA=q_;function TG(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.range=y(n,0)}TG.clone=function(e,t){if(!!l(e))return l(t)||(t=new TG),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var ju=TG;var dRe=M.factorial;function bG(e,t,n,i,r,o){let s=0,a,c,u;if(i>0){for(c=0;c<r;c++){for(a=!1,u=0;u<o.length&&!a;u++)c===o[u]&&(a=!0);a||(o.push(c),s+=bG(e,t,n,i-1,r,o),o.splice(o.length-1,1))}return s}for(s=1,c=0;c<r;c++){for(a=!1,u=0;u<o.length&&!a;u++)c===o[u]&&(a=!0);a||(s*=e-n[t[c]])}return s}var mO={type:"Hermite"};mO.getRequiredDataPoints=function(e,t){return t=y(t,0),Math.max(Math.floor((e+1)/(t+1)),2)};mO.interpolateOrderZero=function(e,t,n,i,r){l(r)||(r=new Array(i));let o,s,a,c,u,f,d=t.length,p=new Array(i);for(o=0;o<i;o++){r[o]=0;let C=new Array(d);for(p[o]=C,s=0;s<d;s++)C[s]=[]}let g=d,m=new Array(g);for(o=0;o<g;o++)m[o]=o;let x=d-1;for(c=0;c<i;c++){for(s=0;s<g;s++)f=m[s]*i+c,p[c][0].push(n[f]);for(o=1;o<g;o++){let C=!1;for(s=0;s<g-o;s++){let A=t[m[s]],b=t[m[s+o]],T;b-A<=0?(f=m[s]*i+i*o+c,T=n[f],p[c][o].push(T/dRe(o))):(T=p[c][o-1][s+1]-p[c][o-1][s],p[c][o].push(T/(b-A))),C=C||T!==0}C||(x=o-1)}}for(a=0,u=0;a<=u;a++)for(o=a;o<=x;o++){let C=bG(e,m,t,a,o,[]);for(c=0;c<i;c++){let A=p[c][o][0];r[c+a*i]+=A*C}}return r};var hRe=[];mO.interpolate=function(e,t,n,i,r,o,s){let a=i*(o+1);l(s)||(s=new Array(a));for(let A=0;A<a;A++)s[A]=0;let c=t.length,u=new Array(c*(r+1)),f;for(f=0;f<c;f++)for(let A=0;A<r+1;A++)u[f*(r+1)+A]=f;let d=u.length,p=hRe,g=mRe(p,u,t,n,i,r),m=[],x=d*(d+1)/2,C=Math.min(g,o);for(let A=0;A<=C;A++)for(f=A;f<=g;f++){m.length=0;let b=bG(e,u,t,A,f,m),T=Math.floor(f*(1-f)/2)+d*f;for(let S=0;S<i;S++){let w=Math.floor(S*x),D=p[w+T];s[S+A*i]+=D*b}}return s};function mRe(e,t,n,i,r,o){let s,a,c=-1,u=t.length,f=u*(u+1)/2;for(let d=0;d<r;d++){let p=Math.floor(d*f);for(s=0;s<u;s++)a=t[s]*r*(o+1)+d,e[p+s]=i[a];for(let g=1;g<u;g++){let m=0,x=Math.floor(g*(1-g)/2)+u*g,C=!1;for(s=0;s<u-g;s++){let A=n[t[s]],b=n[t[s+g]],T,S;if(b-A<=0)a=t[s]*r*(o+1)+r*g+d,T=i[a],S=T/M.factorial(g),e[p+x+m]=S,m++;else{let w=Math.floor((g-1)*(2-g)/2)+u*(g-1);T=e[p+w+s+1]-e[p+w+s],S=T/(b-A),e[p+x+m]=S,m++}C=C||T!==0}C&&(c=Math.max(c,g))}}return c}var pO=mO;var EG={};EG.encode2D=function(e,t,n){let i=Math.pow(2,e),r={x:t,y:n},o,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)o=(r.x&a)>0?1:0,s=(r.y&a)>0?1:0,c+=BigInt((3*o^s)*a*a),Bee(i,r,o,s);return c};EG.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},r,o,s,a;for(s=1,a=t;s<n;s*=2)r=1&Number(a/BigInt(2)),o=1&Number(a^BigInt(r)),Bee(s,i,r,o),i.x+=s*r,i.y+=s*o,a/=BigInt(4);return[i.x,i.y]};function Bee(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let r=t.x;t.x=t.y,t.y=r}var XS=EG;function pRe(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var _O=pRe;var Xee={},_Re=32.184,gRe=2451545,Lee=-.0529921,Nee=-.1059842,Fee=13.0120009,Vee=13.3407154,kee=.9856003,Uee=26.4057084,zee=13.064993,Hee=.3287146,Gee=1.7484877,Wee=-.1589763,jee=.0036096,qee=.1643573,Yee=12.9590088,SG=new ee;Xee.ComputeMoon=function(e,t){l(e)||(e=ee.now()),SG=ee.addSeconds(e,_Re,SG);let n=ee.totalDays(SG)-gRe,i=n/Yn.DAYS_PER_JULIAN_CENTURY,r=(125.045+Lee*n)*M.RADIANS_PER_DEGREE,o=(250.089+Nee*n)*M.RADIANS_PER_DEGREE,s=(260.008+Fee*n)*M.RADIANS_PER_DEGREE,a=(176.625+Vee*n)*M.RADIANS_PER_DEGREE,c=(357.529+kee*n)*M.RADIANS_PER_DEGREE,u=(311.589+Uee*n)*M.RADIANS_PER_DEGREE,f=(134.963+zee*n)*M.RADIANS_PER_DEGREE,d=(276.617+Hee*n)*M.RADIANS_PER_DEGREE,p=(34.226+Gee*n)*M.RADIANS_PER_DEGREE,g=(15.134+Wee*n)*M.RADIANS_PER_DEGREE,m=(119.743+jee*n)*M.RADIANS_PER_DEGREE,x=(239.961+qee*n)*M.RADIANS_PER_DEGREE,C=(25.053+Yee*n)*M.RADIANS_PER_DEGREE,A=Math.sin(r),b=Math.sin(o),T=Math.sin(s),S=Math.sin(a),w=Math.sin(c),D=Math.sin(u),I=Math.sin(f),O=Math.sin(d),B=Math.sin(p),L=Math.sin(g),_=Math.sin(m),E=Math.sin(x),v=Math.sin(C),P=Math.cos(r),R=Math.cos(o),F=Math.cos(s),U=Math.cos(a),k=Math.cos(c),H=Math.cos(u),V=Math.cos(f),q=Math.cos(d),j=Math.cos(p),X=Math.cos(g),G=Math.cos(m),$=Math.cos(x),J=Math.cos(C),ce=(269.9949+.0031*i-3.8787*A-.1204*b+.07*T-.0172*S+.0072*D-.0052*L+.0043*v)*M.RADIANS_PER_DEGREE,de=(66.5392+.013*i+1.5419*P+.0239*R-.0278*F+.0068*U-.0029*H+9e-4*V+8e-4*X-9e-4*J)*M.RADIANS_PER_DEGREE,ie=(38.3213+13.17635815*n-14e-13*n*n+3.561*A+.1208*b-.0642*T+.0158*S+.0252*w-.0066*D-.0047*I-.0046*O+.0028*B+.0052*L+.004*_+.0019*E-.0044*v)*M.RADIANS_PER_DEGREE,ae=(13.17635815-14e-13*(2*n)+3.561*P*Lee+.1208*R*Nee-.0642*F*Fee+.0158*U*Vee+.0252*k*kee-.0066*H*Uee-.0047*V*zee-.0046*q*Hee+.0028*j*Gee+.0052*X*Wee+.004*G*jee+.0019*$*qee-.0044*J*Yee)/86400*M.RADIANS_PER_DEGREE;return l(t)||(t=new _O),t.rightAscension=ce,t.declination=de,t.rotation=ie,t.rotationRate=ae,t};var gO=Xee;function Kee(e){(!l(e)||typeof e!="function")&&(e=gO.ComputeMoon),this._computeFunction=e}var yRe=new h,xRe=new h,CRe=new h;function ARe(e,t,n){let i=yRe;i.x=Math.cos(e+M.PI_OVER_TWO),i.y=Math.sin(e+M.PI_OVER_TWO),i.z=0;let r=Math.cos(t),o=CRe;o.x=r*Math.cos(e),o.y=r*Math.sin(e),o.z=Math.sin(t);let s=h.cross(o,i,xRe);return l(n)||(n=new Q),n[0]=i.x,n[1]=s.x,n[2]=o.x,n[3]=i.y,n[4]=s.y,n[5]=o.y,n[6]=i.z,n[7]=s.z,n[8]=o.z,n}var TRe=new Q,bRe=new Re;Kee.prototype.evaluate=function(e,t){l(e)||(e=ee.now());let n=this._computeFunction(e),i=ARe(n.rightAscension,n.declination,t),r=M.zeroToTwoPi(n.rotation),o=Re.fromAxisAngle(h.UNIT_Z,r,bRe),s=Q.fromQuaternion(Re.conjugate(o,o),TRe);return Q.multiply(s,i,i)};var yO=Kee;var KS={};KS.type=void 0;KS.getRequiredDataPoints=ye.throwInstantiationError;KS.interpolateOrderZero=ye.throwInstantiationError;KS.interpolate=ye.throwInstantiationError;var $ee=KS;var ERe={STEP:0,LINEAR:1,CUBICSPLINE:2},Bh=Object.freeze(ERe);function wG(e){this._url=De.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(wG.prototype,{url:{get:function(){return this._url}}});wG.prototype.geocode=function(e,t){return this._url.getDerivedResource({url:t===Ry.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(r){let o,s=r.bbox;if(l(s))o=he.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=r.geometry.coordinates[0],c=r.geometry.coordinates[1];o=h.fromDegrees(a,c)}return{displayName:r.properties.label,destination:o}})})};var xO=wG;function Zee(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.accessToken,vh.defaultAccessToken),n=De.createIfNeeded(y(e.server,vh.defaultServer));n.appendForwardSlash();let i=vh.getDefaultTokenCredit(t);l(i)&&e.scene.frameState.creditDisplay.addDefaultCredit(Gt.clone(i));let r=n.getDerivedResource({url:"v1/geocode"});l(t)&&r.appendQueryParameters({access_token:t}),this._accessToken=t,this._server=n,this._pelias=new xO(r)}Zee.prototype.geocode=function(e,t){return this._pelias.geocode(e,t)};var CO=Zee;function Yr(e){e=y(e,y.EMPTY_OBJECT),this.start=l(e.start)?ee.clone(e.start):new ee,this.stop=l(e.stop)?ee.clone(e.stop):new ee,this.data=e.data,this.isStartIncluded=y(e.isStartIncluded,!0),this.isStopIncluded=y(e.isStopIncluded,!0)}Object.defineProperties(Yr.prototype,{isEmpty:{get:function(){let e=ee.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var YA={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Yr.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new ye("options.iso8601 is an invalid ISO 8601 interval.");let i=ee.fromIso8601(n[0]),r=ee.fromIso8601(n[1]),o=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=e.data;return l(t)?(t.start=i,t.stop=r,t.isStartIncluded=o,t.isStopIncluded=s,t.data=a,t):(YA.start=i,YA.stop=r,YA.isStartIncluded=o,YA.isStopIncluded=s,YA.data=a,new Yr(YA))};Yr.toIso8601=function(e,t){return`${ee.toIso8601(e.start,t)}/${ee.toIso8601(e.stop,t)}`};Yr.clone=function(e,t){if(!!l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new Yr(e)};Yr.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&ee.equals(e.start,t.start)&&ee.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};Yr.equalsEpsilon=function(e,t,n,i){return n=y(n,0),e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&ee.equalsEpsilon(e.start,t.start,n)&&ee.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};Yr.intersect=function(e,t,n,i){if(!l(t))return Yr.clone(Yr.EMPTY,n);let r=e.start,o=e.stop,s=t.start,a=t.stop,c=ee.greaterThanOrEquals(s,r)&&ee.greaterThanOrEquals(o,s),u=!c&&ee.lessThanOrEquals(s,r)&&ee.lessThanOrEquals(r,a);if(!c&&!u)return Yr.clone(Yr.EMPTY,n);let f=e.isStartIncluded,d=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,m=ee.lessThan(o,a);return l(n)||(n=new Yr),n.start=c?s:r,n.isStartIncluded=f&&p||!ee.equals(s,r)&&(c&&p||u&&f),n.stop=m?o:a,n.isStopIncluded=m?d:d&&g||!ee.equals(a,o)&&g,n.data=l(i)?i(e.data,t.data):e.data,n};Yr.contains=function(e,t){if(e.isEmpty)return!1;let n=ee.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=ee.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};Yr.prototype.clone=function(e){return Yr.clone(this,e)};Yr.prototype.equals=function(e,t){return Yr.equals(this,e,t)};Yr.prototype.equalsEpsilon=function(e,t,n){return Yr.equalsEpsilon(this,e,t,n)};Yr.prototype.toString=function(){return Yr.toIso8601(this)};Yr.EMPTY=Object.freeze(new Yr({start:new ee,stop:new ee,isStartIncluded:!1,isStopIncluded:!1}));var Cn=Yr;var Jee=Object.freeze(ee.fromIso8601("0000-01-01T00:00:00Z")),Qee=Object.freeze(ee.fromIso8601("9999-12-31T24:00:00Z")),SRe=Object.freeze(new Cn({start:Jee,stop:Qee})),wRe={MINIMUM_VALUE:Jee,MAXIMUM_VALUE:Qee,MAXIMUM_INTERVAL:SRe},ke=wRe;var vRe={SHIFT:0,CTRL:1,ALT:2},ha=Object.freeze(vRe);function op(){}op._transcodeTaskProcessor=new Mi("transcodeKTX2",Number.POSITIVE_INFINITY);op._readyPromise=void 0;function DRe(){let e=op._transcodeTaskProcessor.initWebAssemblyModule({modulePath:"ThirdParty/Workers/basis_transcoder.js",wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(){return op._transcodeTaskProcessor});op._readyPromise=e}op.transcode=function(e,t){return l(op._readyPromise)||DRe(),op._readyPromise.then(function(n){let i;if(e instanceof ArrayBuffer){let r=new Uint8Array(e);return i={supportedTargetFormats:t,ktx2Buffer:r},n.scheduleTask(i,[e])}return i={supportedTargetFormats:t,ktx2Buffer:e},n.scheduleTask(i,[e.buffer])}).then(function(n){let i=n.length,r=Object.keys(n[0]),o=r.length,s;for(s=0;s<i;s++){let a=n[s];for(let c=0;c<o;c++){let u=a[r[c]];a[r[c]]=new RI(u.internalFormat,u.datatype,u.width,u.height,u.levelBuffer)}}if(o===1){for(s=0;s<i;++s)n[s]=n[s][r[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var AO=op;var vG={type:"Lagrange"};vG.getRequiredDataPoints=function(e){return Math.max(e+1,2)};vG.interpolateOrderZero=function(e,t,n,i,r){l(r)||(r=new Array(i));let o,s,a=t.length;for(o=0;o<i;o++)r[o]=0;for(o=0;o<a;o++){let c=1;for(s=0;s<a;s++)if(s!==o){let u=t[o]-t[s];c*=(e-t[s])/u}for(s=0;s<i;s++)r[s]+=c*n[o*i+s]}return r};var TO=vG;var DG={type:"Linear"};DG.getRequiredDataPoints=function(e){return 2};DG.interpolateOrderZero=function(e,t,n,i,r){l(r)||(r=new Array(i));let o,s,a,c=t[0],u=t[1];for(o=0;o<i;o++)s=n[o],a=n[o+i],r[o]=((a-s)*e+u*s-c*a)/(u-c);return r};var XA=DG;function PRe(e){let t=e.uint8Array,n=e.format,i=e.request,r=y(e.flipY,!1),o=y(e.skipColorSpaceConversion,!1),s=new Blob([t],{type:n}),a;return De.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(De.createImageBitmapFromBlob(s,{flipY:r,premultiplyAlpha:!1,skipColorSpaceConversion:o})):(a=window.URL.createObjectURL(s),new De({url:a,request:i}).fetchImage({flipY:r,skipColorSpaceConversion:o}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var Y_=PRe;var ete;tte.setKTX2SupportedFormats=function(e,t,n,i,r,o){ete={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:r,bc7:o}};function tte(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=De.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return AO.transcode(n,ete)})}var Ua=tte;function Lh(e){e=y(e,0),this._array=new Array(e),this._length=e}Object.defineProperties(Lh.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});Lh.prototype.get=function(e){return this._array[e]};Lh.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};Lh.prototype.peek=function(){return this._array[this._length-1]};Lh.prototype.push=function(e){let t=this.length++;this._array[t]=e};Lh.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};Lh.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};Lh.prototype.resize=function(e){this.length=e};Lh.prototype.trim=function(e){e=y(e,this._length),this._array.length=e};var qu=Lh;function bO(){ye.throwInstantiationError()}Object.defineProperties(bO.prototype,{ellipsoid:{get:ye.throwInstantiationError}});bO.prototype.project=ye.throwInstantiationError;bO.prototype.unproject=ye.throwInstantiationError;var nte=bO;var PG=[],IG=[];function IRe(e,t,n,i,r,o){let s=r-i+1,a=o-r,c=PG,u=IG,f,d;for(f=0;f<s;++f)c[f]=e[i+f];for(d=0;d<a;++d)u[d]=e[r+d+1];f=0,d=0;for(let p=i;p<=o;++p){let g=c[f],m=u[d];f<s&&(d>=a||t(g,m,n)<=0)?(e[p]=g,++f):d<a&&(e[p]=m,++d)}}function OG(e,t,n,i,r){if(i>=r)return;let o=Math.floor((i+r)*.5);OG(e,t,n,i,o),OG(e,t,n,o+1,r),IRe(e,t,n,i,o,r)}function ORe(e,t,n){let i=e.length,r=Math.ceil(i*.5);PG.length=r,IG.length=r,OG(e,t,n,0,i-1),PG.length=0,IG.length=0}var By=ORe;function KA(e){e=y(e,y.EMPTY_OBJECT);let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(KA.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});KA.prototype.findTimeInterval=qi.prototype.findTimeInterval;KA.prototype.wrapTime=qi.prototype.wrapTime;KA.prototype.clampTime=qi.prototype.clampTime;KA.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=r*this._count+s;t[s]=n[a]*(1-o)+n[a+this._count]*o}return t};var EO=KA;var $S={};function ite(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function RG(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function rte(e){return e&=1431655765,e=(e^e>>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function MG(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}$S.encode2D=function(e,t){return(ite(e)|ite(t)<<1)>>>0};$S.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=rte(e),t[1]=rte(e>>1),t};$S.encode3D=function(e,t,n){return RG(e)|RG(t)<<1|RG(n)<<2};$S.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=MG(e),t[1]=MG(e>>1),t[2]=MG(e>>2),t};var Ly=$S;function Yu(e,t,n,i){this.near=y(e,0),this.nearValue=y(t,0),this.far=y(n,1),this.farValue=y(i,0)}Yu.clone=function(e,t){if(!!l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new Yu(e.near,e.nearValue,e.far,e.farValue)};Yu.packedLength=4;Yu.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};Yu.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Yu),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Yu.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};Yu.prototype.clone=function(e){return Yu.clone(this,e)};Yu.prototype.equals=function(e){return Yu.equals(this,e)};var St=Yu;var RRe={NONE:-1,PARTIAL:0,FULL:1},xo=Object.freeze(RRe);function za(e,t){this._occluderPosition=h.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var SO=new h;Object.defineProperties(za.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=h.clone(e,this._cameraPosition);let t=h.subtract(this._occluderPosition,e,SO),n=h.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,r,o,s;if(n>i){r=Math.sqrt(n-i),n=1/Math.sqrt(n),o=h.multiplyByScalar(t,n,SO);let a=r*r*n;s=h.add(e,h.multiplyByScalar(o,a,SO),SO)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=o,this._horizonPlanePosition=s,this._cameraPosition=e}}});za.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new za(e,t)};var ste=new h;za.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,ste),n=this._occluderRadius;if(n=h.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=h.subtract(e,this._cameraPosition,t),n*n>h.magnitudeSquared(t)}return!1};var MRe=new h;za.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,MRe),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,ste),r=this._occluderRadius-n;if(r=h.magnitudeSquared(i)-r*r,n<this._occluderRadius)return r>0?(r=Math.sqrt(r)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i),r*r+n*n>h.magnitudeSquared(i)):!1;if(r>0){i=h.subtract(t,this._cameraPosition,i);let o=h.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>o*s?!0:(r=Math.sqrt(r)+this._horizonDistance,r*r+a>o)}return!0}return!1};var BRe=new h;za.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return xo.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,BRe),r=this._occluderRadius-n,o=h.magnitudeSquared(i);if(r=o-r*r,r>0){r=Math.sqrt(r)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i);let s=h.magnitudeSquared(i);return r*r+n*n<s?xo.NONE:(r=this._occluderRadius+n,r=o-r*r,r>0?(r=Math.sqrt(r)+this._horizonDistance,s<r*r+n*n?xo.FULL:xo.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?xo.PARTIAL:xo.FULL))}}return xo.NONE};var wO=new h;za.computeOccludeePoint=function(e,t,n){let i=h.clone(t),r=h.clone(e.center),o=e.radius,s=n.length,a=h.normalize(h.subtract(i,r,wO),wO),c=-h.dot(a,r),u=za._anyRotationVector(r,a,c),f=za._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let d;for(let g=1;g<s;++g){if(d=za._horizonToPlaneNormalDotProduct(e,a,c,u,n[g]),!d)return;d<f&&(f=d)}if(f<.0017453283658983088)return;let p=o/f;return h.add(r,h.multiplyByScalar(a,p,wO),wO)};var LRe=[];za.computeOccludeePointFromRectangle=function(e,t){t=y(t,oe.WGS84);let n=he.subsample(e,t,0,LRe),i=re.fromPoints(n),r=h.ZERO;if(!h.equals(r,i.center))return za.computeOccludeePoint(new re(r,t.minimumRadius),i.center,n)};var NRe=new h;za._anyRotationVector=function(e,t,n){let i=h.abs(t,NRe),r=i.x>i.y?0:1;(r===0&&i.z>i.x||r===1&&i.z>i.y)&&(r=2);let o=new h,s;r===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=h.UNIT_X):r===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=h.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=h.UNIT_Z);let a=(h.dot(t,i)+n)/-h.dot(t,s);return h.normalize(h.subtract(h.add(i,h.multiplyByScalar(s,a,o),i),e,i),i)};var FRe=new h;za._rotationVector=function(e,t,n,i,r){let o=h.subtract(i,e,FRe);if(o=h.normalize(o,o),h.dot(t,o)<.9999999847691291){let s=h.cross(t,o,o);if(h.magnitude(s)>M.EPSILON13)return h.normalize(s,new h)}return r};var BG=new h,VRe=new h,vO=new h,ote=new h;za._horizonToPlaneNormalDotProduct=function(e,t,n,i,r){let o=h.clone(r,BG),s=h.clone(e.center,VRe),a=e.radius,c=h.subtract(s,o,vO),u=h.magnitudeSquared(c),f=a*a;if(u<f)return!1;let d=u-f,p=Math.sqrt(d),g=Math.sqrt(u),m=1/g,C=p*m*p;c=h.normalize(c,c);let A=h.add(o,h.multiplyByScalar(c,C,ote),ote),b=Math.sqrt(d-C*C),T=this._rotationVector(s,t,n,o,i),S=h.fromElements(T.x*T.x*c.x+(T.x*T.y-T.z)*c.y+(T.x*T.z+T.y)*c.z,(T.x*T.y+T.z)*c.x+T.y*T.y*c.y+(T.y*T.z-T.x)*c.z,(T.x*T.z-T.y)*c.x+(T.y*T.z+T.x)*c.y+T.z*T.z*c.z,BG);S=h.normalize(S,S);let w=h.multiplyByScalar(S,b,BG);T=h.normalize(h.subtract(h.add(A,w,vO),s,vO),vO);let D=h.dot(t,T);T=h.normalize(h.subtract(h.subtract(A,w,T),s,T),T);let I=h.dot(t,T);return D<I?D:I};var DO=za;function ZS(e,t,n){e=y(e,0),t=y(t,0),n=y(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(ZS.prototype,{componentDatatype:{get:function(){return K.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});ZS.fromCartesian3=function(e){return new ZS(e.x,e.y,e.z)};ZS.toValue=function(e,t){return l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var nr=ZS;function LG(e,t,n){e=De.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=y(n,{})}Object.defineProperties(LG.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}}});LG.prototype.geocode=function(e){return this._url.getDerivedResource({url:"json",queryParameters:rt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let r,o=i.bounds;if(l(o))r=he.fromDegrees(o.southwest.lng,o.southwest.lat,o.northeast.lng,o.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;r=h.fromDegrees(s,a)}return{displayName:i.formatted,destination:r}})})};var ate=LG;var kRe={packedLength:void 0,pack:ye.throwInstantiationError,unpack:ye.throwInstantiationError},cte=kRe;var URe={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:ye.throwInstantiationError,unpackInterpolationResult:ye.throwInstantiationError},lte=URe;function zRe(e,t,n,i,r){let o=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),u=100,f=o.width+u|0,d=3*a,p=d/2;c.width=f,c.height=d;let g=c.getContext("2d");g.font=n,g.fillStyle="white",g.fillRect(0,0,c.width+1,c.height+1),i&&(g.strokeStyle="black",g.lineWidth=e.lineWidth,g.strokeText(t,u/2,p)),r&&(g.fillStyle="black",g.fillText(t,u/2,p));let m=g.getImageData(0,0,f,d).data,x=m.length,C=f*4,A,b,T,S;for(A=0;A<x;++A)if(m[A]!==255){T=A/C|0;break}for(A=x-1;A>=0;--A)if(m[A]!==255){S=A/C|0;break}let w=-1;for(A=0;A<f&&w===-1;++A)for(b=0;b<d;++b){let D=A*4+b*C;if(m[D]!==255||m[D+1]!==255||m[D+2]!==255||m[D+3]!==255){w=A;break}}return{width:o.width,height:S-T,ascent:p-T,descent:S-p,minx:w-u/2}}return{width:o.width,height:0,ascent:0,descent:0,minx:0}}var Ny;function HRe(e,t){if(e==="")return;t=y(t,y.EMPTY_OBJECT);let n=y(t.font,"10px sans-serif"),i=y(t.stroke,!1),r=y(t.fill,!0),o=y(t.strokeWidth,1),s=y(t.backgroundColor,z.TRANSPARENT),a=y(t.padding,0),c=a*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d");l(Ny)||(l(f.imageSmoothingEnabled)?Ny="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?Ny="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?Ny="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(Ny="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=o,f[Ny]=!1,u.style.visibility="hidden",document.body.appendChild(u);let d=zRe(f,e,n,i,r);u.dimensions=d,document.body.removeChild(u),u.style.visibility="";let p=-d.minx,g=Math.ceil(d.width)+p+c,m=d.height+c,x=m-d.ascent+a,C=m-x+c;if(u.width=g,u.height=m,f.font=n,f.lineJoin="round",f.lineWidth=o,f[Ny]=!1,s!==z.TRANSPARENT&&(f.fillStyle=s.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let A=y(t.strokeColor,z.BLACK);f.strokeStyle=A.toCssColorString(),f.strokeText(e,p+a,C)}if(r){let A=y(t.fillColor,z.WHITE);f.fillStyle=A.toCssColorString(),f.fillText(e,p+a,C)}return u}var $A=HRe;function QS(){this._cache={}}QS.prototype.fromColor=function(e,t){return PO(void 0,void 0,e,t,this._cache)};QS.prototype.fromUrl=function(e,t,n){return PO(e,void 0,t,n,this._cache)};QS.prototype.fromMakiIconId=function(e,t,n){return PO(Qt(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};QS.prototype.fromText=function(e,t,n){return PO(void 0,e,t,n,this._cache)};var GRe=new z;function WRe(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,GRe).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function ute(e,t,n){let i=n/2.5,r=i,o=i;t.width>t.height?o=i*(t.height/t.width):t.width<t.height&&(r=i*(t.width/t.height));let s=Math.round((n-r)/2),a=Math.round(7/24*n-o/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,r,o),e.drawImage(t,s,a-1,r,o),e.drawImage(t,s+1,a,r,o),e.drawImage(t,s,a+1,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=z.BLACK.toCssColorString(),e.fillRect(s-1,a-1,r+2,o+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=z.WHITE.toCssColorString(),e.fillRect(s-1,a-2,r+2,o+2)}var JS=new Array(4);function PO(e,t,n,i,r){JS[0]=e,JS[1]=t,JS[2]=n,JS[3]=i;let o=JSON.stringify(JS),s=r[o];if(l(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if(WRe(c,n,i),l(e)){let f=De.createIfNeeded(e).fetchImage().then(function(d){return ute(c,d,i),r[o]=a,a});return r[o]=f,f}else if(l(t)){let u=$A(t,{font:`bold ${i}px sans-serif`});ute(c,u,i)}return r[o]=a,a}var X_=QS;var Ei={UNSIGNED_BYTE:Z.UNSIGNED_BYTE,UNSIGNED_SHORT:Z.UNSIGNED_SHORT,UNSIGNED_INT:Z.UNSIGNED_INT,FLOAT:Z.FLOAT,HALF_FLOAT:Z.HALF_FLOAT_OES,UNSIGNED_INT_24_8:Z.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:Z.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:Z.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:Z.UNSIGNED_SHORT_5_6_5};Ei.toWebGLConstant=function(e,t){switch(e){case Ei.UNSIGNED_BYTE:return Z.UNSIGNED_BYTE;case Ei.UNSIGNED_SHORT:return Z.UNSIGNED_SHORT;case Ei.UNSIGNED_INT:return Z.UNSIGNED_INT;case Ei.FLOAT:return Z.FLOAT;case Ei.HALF_FLOAT:return t.webgl2?Z.HALF_FLOAT:Z.HALF_FLOAT_OES;case Ei.UNSIGNED_INT_24_8:return Z.UNSIGNED_INT_24_8;case Ei.UNSIGNED_SHORT_4_4_4_4:return Z.UNSIGNED_SHORT_4_4_4_4;case Ei.UNSIGNED_SHORT_5_5_5_1:return Z.UNSIGNED_SHORT_5_5_5_1;case Ei.UNSIGNED_SHORT_5_6_5:return Ei.UNSIGNED_SHORT_5_6_5}};Ei.isPacked=function(e){return e===Ei.UNSIGNED_INT_24_8||e===Ei.UNSIGNED_SHORT_4_4_4_4||e===Ei.UNSIGNED_SHORT_5_5_5_1||e===Ei.UNSIGNED_SHORT_5_6_5};Ei.sizeInBytes=function(e){switch(e){case Ei.UNSIGNED_BYTE:return 1;case Ei.UNSIGNED_SHORT:case Ei.UNSIGNED_SHORT_4_4_4_4:case Ei.UNSIGNED_SHORT_5_5_5_1:case Ei.UNSIGNED_SHORT_5_6_5:case Ei.HALF_FLOAT:return 2;case Ei.UNSIGNED_INT:case Ei.FLOAT:case Ei.UNSIGNED_INT_24_8:return 4}};Ei.validate=function(e){return e===Ei.UNSIGNED_BYTE||e===Ei.UNSIGNED_SHORT||e===Ei.UNSIGNED_INT||e===Ei.FLOAT||e===Ei.HALF_FLOAT||e===Ei.UNSIGNED_INT_24_8||e===Ei.UNSIGNED_SHORT_4_4_4_4||e===Ei.UNSIGNED_SHORT_5_5_5_1||e===Ei.UNSIGNED_SHORT_5_6_5};var qe=Object.freeze(Ei);var it={DEPTH_COMPONENT:Z.DEPTH_COMPONENT,DEPTH_STENCIL:Z.DEPTH_STENCIL,ALPHA:Z.ALPHA,RGB:Z.RGB,RGBA:Z.RGBA,LUMINANCE:Z.LUMINANCE,LUMINANCE_ALPHA:Z.LUMINANCE_ALPHA,RGB_DXT1:Z.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:Z.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:Z.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:Z.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:Z.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:Z.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:Z.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:Z.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:Z.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:Z.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:Z.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:Z.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:Z.COMPRESSED_RGBA_BPTC_UNORM};it.componentsLength=function(e){switch(e){case it.RGB:return 3;case it.RGBA:return 4;case it.LUMINANCE_ALPHA:return 2;case it.ALPHA:case it.LUMINANCE:return 1;default:return 1}};it.validate=function(e){return e===it.DEPTH_COMPONENT||e===it.DEPTH_STENCIL||e===it.ALPHA||e===it.RGB||e===it.RGBA||e===it.LUMINANCE||e===it.LUMINANCE_ALPHA||e===it.RGB_DXT1||e===it.RGBA_DXT1||e===it.RGBA_DXT3||e===it.RGBA_DXT5||e===it.RGB_PVRTC_4BPPV1||e===it.RGB_PVRTC_2BPPV1||e===it.RGBA_PVRTC_4BPPV1||e===it.RGBA_PVRTC_2BPPV1||e===it.RGBA_ASTC||e===it.RGB_ETC1||e===it.RGB8_ETC2||e===it.RGBA8_ETC2_EAC||e===it.RGBA_BC7};it.isColorFormat=function(e){return e===it.ALPHA||e===it.RGB||e===it.RGBA||e===it.LUMINANCE||e===it.LUMINANCE_ALPHA};it.isDepthFormat=function(e){return e===it.DEPTH_COMPONENT||e===it.DEPTH_STENCIL};it.isCompressedFormat=function(e){return e===it.RGB_DXT1||e===it.RGBA_DXT1||e===it.RGBA_DXT3||e===it.RGBA_DXT5||e===it.RGB_PVRTC_4BPPV1||e===it.RGB_PVRTC_2BPPV1||e===it.RGBA_PVRTC_4BPPV1||e===it.RGBA_PVRTC_2BPPV1||e===it.RGBA_ASTC||e===it.RGB_ETC1||e===it.RGB8_ETC2||e===it.RGBA8_ETC2_EAC||e===it.RGBA_BC7};it.isDXTFormat=function(e){return e===it.RGB_DXT1||e===it.RGBA_DXT1||e===it.RGBA_DXT3||e===it.RGBA_DXT5};it.isPVRTCFormat=function(e){return e===it.RGB_PVRTC_4BPPV1||e===it.RGB_PVRTC_2BPPV1||e===it.RGBA_PVRTC_4BPPV1||e===it.RGBA_PVRTC_2BPPV1};it.isASTCFormat=function(e){return e===it.RGBA_ASTC};it.isETC1Format=function(e){return e===it.RGB_ETC1};it.isETC2Format=function(e){return e===it.RGB8_ETC2||e===it.RGBA8_ETC2_EAC};it.isBC7Format=function(e){return e===it.RGBA_BC7};it.compressedTextureSizeInBytes=function(e,t,n){switch(e){case it.RGB_DXT1:case it.RGBA_DXT1:case it.RGB_ETC1:case it.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case it.RGBA_DXT3:case it.RGBA_DXT5:case it.RGBA_ASTC:case it.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case it.RGB_PVRTC_4BPPV1:case it.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case it.RGB_PVRTC_2BPPV1:case it.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case it.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};it.textureSizeInBytes=function(e,t,n,i){let r=it.componentsLength(e);return qe.isPacked(t)&&(r=1),r*qe.sizeInBytes(t)*n*i};it.alignmentInBytes=function(e,t,n){let i=it.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};it.createTypedArray=function(e,t,n,i){let r,o=qe.sizeInBytes(t);o===Uint8Array.BYTES_PER_ELEMENT?r=Uint8Array:o===Uint16Array.BYTES_PER_ELEMENT?r=Uint16Array:o===Float32Array.BYTES_PER_ELEMENT&&t===qe.FLOAT?r=Float32Array:r=Uint32Array;let s=it.componentsLength(e)*n*i;return new r(s)};it.flipY=function(e,t,n,i,r){if(r===1)return e;let o=it.createTypedArray(t,n,i,r),s=it.componentsLength(t),a=i*s;for(let c=0;c<r;++c){let u=c*i*s,f=(r-c-1)*i*s;for(let d=0;d<a;++d)o[f+d]=e[u+d]}return o};it.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===it.DEPTH_STENCIL)return Z.DEPTH24_STENCIL8;if(e===it.DEPTH_COMPONENT){if(t===qe.UNSIGNED_SHORT)return Z.DEPTH_COMPONENT16;if(t===qe.UNSIGNED_INT)return Z.DEPTH_COMPONENT24}if(t===qe.FLOAT)switch(e){case it.RGBA:return Z.RGBA32F;case it.RGB:return Z.RGB32F;case it.RG:return Z.RG32F;case it.R:return Z.R32F}if(t===qe.HALF_FLOAT)switch(e){case it.RGBA:return Z.RGBA16F;case it.RGB:return Z.RGB16F;case it.RG:return Z.RG16F;case it.R:return Z.R16F}return e};var ct=Object.freeze(it);function ZA(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.vertexFormat,Pe.DEFAULT);this._vertexFormat=t,this._workerName="createPlaneGeometry"}ZA.packedLength=Pe.packedLength;ZA.pack=function(e,t,n){return n=y(n,0),Pe.pack(e._vertexFormat,t,n),t};var fte=new Pe,jRe={vertexFormat:fte};ZA.unpack=function(e,t,n){t=y(t,0);let i=Pe.unpack(e,t,fte);return l(n)?(n._vertexFormat=Pe.clone(i,n._vertexFormat),n):new ZA(jRe)};var IO=new h(-.5,-.5,0),OO=new h(.5,.5,0);ZA.createGeometry=function(e){let t=e._vertexFormat,n=new dn,i,r;if(t.position){if(r=new Float64Array(4*3),r[0]=IO.x,r[1]=IO.y,r[2]=0,r[3]=OO.x,r[4]=IO.y,r[5]=0,r[6]=OO.x,r[7]=OO.y,r[8]=0,r[9]=IO.x,r[10]=OO.y,r[11]=0,n.position=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:r}),t.normal){let o=new Float32Array(12);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=0,o[5]=1,o[6]=0,o[7]=0,o[8]=1,o[9]=0,o[10]=0,o[11]=1,n.normal=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:o})}if(t.st){let o=new Float32Array(8);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=1,o[5]=1,o[6]=0,o[7]=1,n.st=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:o})}if(t.tangent){let o=new Float32Array(12);o[0]=1,o[1]=0,o[2]=0,o[3]=1,o[4]=0,o[5]=0,o[6]=1,o[7]=0,o[8]=0,o[9]=1,o[10]=0,o[11]=0,n.tangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:o})}if(t.bitangent){let o=new Float32Array(12);o[0]=0,o[1]=1,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=0,o[7]=1,o[8]=0,o[9]=0,o[10]=1,o[11]=0,n.bitangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:o})}i=new Uint16Array(2*3),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new ot({attributes:n,indices:i,primitiveType:Me.TRIANGLES,boundingSphere:new re(h.ZERO,Math.sqrt(2))})};var RO=ZA;function JA(){this._workerName="createPlaneOutlineGeometry"}JA.packedLength=0;JA.pack=function(e,t){return t};JA.unpack=function(e,t,n){return l(n)?n:new JA};var K_=new h(-.5,-.5,0),MO=new h(.5,.5,0);JA.createGeometry=function(){let e=new dn,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=K_.x,n[1]=K_.y,n[2]=K_.z,n[3]=MO.x,n[4]=K_.y,n[5]=K_.z,n[6]=MO.x,n[7]=MO.y,n[8]=K_.z,n[9]=K_.x,n[10]=MO.y,n[11]=K_.z,e.position=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:n}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new ot({attributes:e,indices:t,primitiveType:Me.LINES,boundingSphere:new re(h.ZERO,Math.sqrt(2))})};var BO=JA;var qRe=new h;function YRe(e,t,n,i){let r=uA(e,t,n,i,qRe);return l(r)?r.x>0&&r.y>0&&r.z>0:!1}var dte=YRe;var XRe=new me,hte=new me;function KRe(e,t,n,i){let o=i.cartesianToCartographic(e,XRe).height,s=i.cartesianToCartographic(t,hte);s.height=o,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,hte);a.height=o-100,i.cartographicToCartesian(a,n)}var $Re=new je,ZRe=new h,JRe=new h,QRe=new h,eMe=new h,tMe=new h,nMe=new h,LO=new h,Nh=new h,QA=new h,iMe=new W,rMe=new W,oMe=new h,mte=new Re,sMe=new Q,aMe=new Q;function NG(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,r=n.attributes.position.values,o=l(n.attributes.st)?n.attributes.st.values:void 0,s=r.length,a=e.wall,c=e.top||a,u=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,d=e.tangentPlane,p=e.ellipsoid,g=e.stRotation,m=e.perPositionHeight,x=iMe;x.x=f.x,x.y=f.y;let C=t.st?new Float32Array(2*(s/3)):void 0,A;t.normal&&(m&&c&&!a?A=n.attributes.normal.values:A=new Float32Array(s));let b=t.tangent?new Float32Array(s):void 0,T=t.bitangent?new Float32Array(s):void 0,S=i?new Float32Array(s):void 0,w=0,D=0,I=JRe,O=QRe,B=eMe,L=!0,_=sMe,E=aMe;if(g!==0){let R=Re.fromAxisAngle(d._plane.normal,g,mte);_=Q.fromQuaternion(R,_),R=Re.fromAxisAngle(d._plane.normal,-g,mte),E=Q.fromQuaternion(R,E)}else _=Q.clone(Q.IDENTITY,_),E=Q.clone(Q.IDENTITY,E);let v=0,P=0;c&&u&&(v=s/2,P=s/3,s/=2);for(let R=0;R<s;R+=3){let F=h.fromArray(r,R,oMe);if(t.st&&!l(o)){let U=Q.multiplyByVector(_,F,ZRe);U=p.scaleToGeodeticSurface(U,U);let k=d.projectPointOntoPlane(U,rMe);W.subtract(k,x,k);let H=M.clamp(k.x/f.width,0,1),V=M.clamp(k.y/f.height,0,1);u&&(C[w+P]=H,C[w+1+P]=V),c&&(C[w]=H,C[w+1]=V),w+=2}if(t.normal||t.tangent||t.bitangent||i){let U=D+1,k=D+2;if(a){if(R+3<s){let H=h.fromArray(r,R+3,tMe);if(L){let V=h.fromArray(r,R+s,nMe);m&&KRe(F,H,V,p),h.subtract(H,F,H),h.subtract(V,F,V),I=h.normalize(h.cross(V,H,I),I),L=!1}h.equalsEpsilon(H,F,M.EPSILON10)&&(L=!0)}(t.tangent||t.bitangent)&&(B=p.geodeticSurfaceNormal(F,B),t.tangent&&(O=h.normalize(h.cross(B,I,O),O)))}else I=p.geodeticSurfaceNormal(F,I),(t.tangent||t.bitangent)&&(m&&(LO=h.fromArray(A,D,LO),Nh=h.cross(h.UNIT_Z,LO,Nh),Nh=h.normalize(Q.multiplyByVector(E,Nh,Nh),Nh),t.bitangent&&(QA=h.normalize(h.cross(LO,Nh,QA),QA))),O=h.cross(h.UNIT_Z,I,O),O=h.normalize(Q.multiplyByVector(E,O,O),O),t.bitangent&&(B=h.normalize(h.cross(I,O,B),B)));t.normal&&(e.wall?(A[D+v]=I.x,A[U+v]=I.y,A[k+v]=I.z):u&&(A[D+v]=-I.x,A[U+v]=-I.y,A[k+v]=-I.z),(c&&!m||a)&&(A[D]=I.x,A[U]=I.y,A[k]=I.z)),i&&(a&&(I=p.geodeticSurfaceNormal(F,I)),S[D+v]=-I.x,S[U+v]=-I.y,S[k+v]=-I.z),t.tangent&&(e.wall?(b[D+v]=O.x,b[U+v]=O.y,b[k+v]=O.z):u&&(b[D+v]=-O.x,b[U+v]=-O.y,b[k+v]=-O.z),c&&(m?(b[D]=Nh.x,b[U]=Nh.y,b[k]=Nh.z):(b[D]=O.x,b[U]=O.y,b[k]=O.z))),t.bitangent&&(u&&(T[D+v]=B.x,T[U+v]=B.y,T[k+v]=B.z),c&&(m?(T[D]=QA.x,T[U]=QA.y,T[k]=QA.z):(T[D]=B.x,T[U]=B.y,T[k]=B.z))),D+=3}}t.st&&!l(o)&&(n.attributes.st=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:C})),t.normal&&(n.attributes.normal=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(n.attributes.tangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:b})),t.bitangent&&(n.attributes.bitangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:T})),i&&(n.attributes.extrudeDirection=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:S}))}if(e.extrude&&l(e.offsetAttribute)){let f=r.length/3,d=new Uint8Array(f);if(e.offsetAttribute===nn.TOP)c&&u||a?d=d.fill(1,0,f/2):c&&(d=d.fill(1));else{let p=e.offsetAttribute===nn.NONE?0:1;d=d.fill(p)}n.attributes.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return n}var cMe=new me,lMe=new me,$_={westOverIDL:0,eastOverIDL:0},eT=new ed;function gte(e,t,n,i,r){if(r=y(r,new he),!l(e)||e.length<3)return r.west=0,r.north=0,r.south=0,r.east=0,r;if(n===Kt.RHUMB)return he.fromCartesianArray(e,t,r);eT.ellipsoid.equals(t)||(eT=new ed(void 0,void 0,t)),r.west=Number.POSITIVE_INFINITY,r.east=Number.NEGATIVE_INFINITY,r.south=Number.POSITIVE_INFINITY,r.north=Number.NEGATIVE_INFINITY,$_.westOverIDL=Number.POSITIVE_INFINITY,$_.eastOverIDL=Number.NEGATIVE_INFINITY;let o=1/M.chordLength(i,t.maximumRadius),s=e.length,a=t.cartesianToCartographic(e[0],lMe),c=cMe,u;for(let f=1;f<s;f++)u=c,c=a,a=t.cartesianToCartographic(e[f],u),eT.setEndPoints(c,a),pte(eT,o,r,$_);return u=c,c=a,a=t.cartesianToCartographic(e[0],u),eT.setEndPoints(c,a),pte(eT,o,r,$_),r.east-r.west>$_.eastOverIDL-$_.westOverIDL&&(r.west=$_.westOverIDL,r.east=$_.eastOverIDL,r.east>M.PI&&(r.east=r.east-M.TWO_PI),r.west>M.PI&&(r.west=r.west-M.TWO_PI)),r}var uMe=new me;function pte(e,t,n,i){let r=e.surfaceDistance,o=Math.ceil(r*t),s=o>0?r/(o-1):Number.POSITIVE_INFINITY,a=0;for(let c=0;c<o;c++){let u=e.interpolateUsingSurfaceDistance(a,uMe);a+=s;let f=u.longitude,d=u.latitude;n.west=Math.min(n.west,f),n.east=Math.max(n.east,f),n.south=Math.min(n.south,d),n.north=Math.max(n.north,d);let p=f>=0?f:f+M.TWO_PI;i.westOverIDL=Math.min(i.westOverIDL,p),i.eastOverIDL=Math.max(i.eastOverIDL,p)}}var _te=[];function fMe(e,t,n,i,r,o,s,a,c,u){let f={walls:[]},d;if(s||a){let b=Hn.createGeometryFromPositions(e,t,n,i,o,c,u),T=b.attributes.position.values,S=b.indices,w,D;if(s&&a){let I=T.concat(T);w=I.length/3,D=Le.createTypedArray(w,S.length*2),D.set(S);let O=S.length,B=w/2;for(d=0;d<O;d+=3){let L=D[d]+B,_=D[d+1]+B,E=D[d+2]+B;D[d+O]=E,D[d+1+O]=_,D[d+2+O]=L}if(b.attributes.position.values=I,o&&c.normal){let L=b.attributes.normal.values;b.attributes.normal.values=new Float32Array(I.length),b.attributes.normal.values.set(L)}if(c.st&&l(n)){let L=b.attributes.st.values;b.attributes.st.values=new Float32Array(w*2),b.attributes.st.values=L.concat(L)}b.indices=D}else if(a){for(w=T.length/3,D=Le.createTypedArray(w,S.length),d=0;d<S.length;d+=3)D[d]=S[d+2],D[d+1]=S[d+1],D[d+2]=S[d];b.indices=D}f.topAndBottom=new pt({geometry:b})}let p=r.outerRing,g=La.fromPoints(p,e),m=g.projectPointsOntoPlane(p,_te),x=si.computeWindingOrder2D(m);x===hs.CLOCKWISE&&(p=p.slice().reverse());let C=Hn.computeWallGeometry(p,n,e,i,o,u);f.walls.push(new pt({geometry:C}));let A=r.holes;for(d=0;d<A.length;d++){let b=A[d];g=La.fromPoints(b,e),m=g.projectPointsOntoPlane(b,_te),x=si.computeWindingOrder2D(m),x===hs.COUNTER_CLOCKWISE&&(b=b.slice().reverse()),C=Hn.computeWallGeometry(b,n,e,i,o,u),f.walls.push(new pt({geometry:C}))}return f}function rd(e){let t=e.polygonHierarchy,n=y(e.vertexFormat,Pe.DEFAULT),i=y(e.ellipsoid,oe.WGS84),r=y(e.granularity,M.RADIANS_PER_DEGREE),o=y(e.stRotation,0),s=e.textureCoordinates,a=y(e.perPositionHeight,!1),c=a&&l(e.extrudedHeight),u=y(e.height,0),f=y(e.extrudedHeight,u);if(!c){let d=Math.max(u,f);f=Math.min(u,f),u=d}this._vertexFormat=Pe.clone(n),this._ellipsoid=oe.clone(i),this._granularity=r,this._stRotation=o,this._height=u,this._extrudedHeight=f,this._closeTop=y(e.closeTop,!0),this._closeBottom=y(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=y(e.arcType,Kt.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=Hn.computeHierarchyPackedLength(t,h)+oe.packedLength+Pe.packedLength+(s?Hn.computeHierarchyPackedLength(s,W):1)+12}rd.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates};return new rd(t)};rd.pack=function(e,t,n){return n=y(n,0),n=Hn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=y(e._offsetAttribute,-1),t[n++]=e._arcType,l(e._textureCoordinates)?n=Hn.packPolygonHierarchy(e._textureCoordinates,t,n,W):t[n++]=-1,t[n++]=e.packedLength,t};var dMe=oe.clone(oe.UNIT_SPHERE),hMe=new Pe,mMe={polygonHierarchy:{}};rd.unpack=function(e,t,n){t=y(t,0);let i=Hn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=oe.unpack(e,t,dMe);t+=oe.packedLength;let o=Pe.unpack(e,t,hMe);t+=Pe.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++]===1,d=e[t++]===1,p=e[t++]===1,g=e[t++]===1,m=e[t++]===1,x=e[t++],C=e[t++],A=e[t]===-1?void 0:Hn.unpackPolygonHierarchy(e,t,W);l(A)?(t=A.startingIndex,delete A.startingIndex):t++;let b=e[t++];return l(n)||(n=new rd(mMe)),n._polygonHierarchy=i,n._ellipsoid=oe.clone(r,n._ellipsoid),n._vertexFormat=Pe.clone(o,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=d,n._closeTop=p,n._closeBottom=g,n._shadowVolume=m,n._offsetAttribute=x===-1?void 0:x,n._arcType=C,n._textureCoordinates=A,n.packedLength=b,n};rd.computeRectangle=function(e,t){let n=y(e.granularity,M.RADIANS_PER_DEGREE),i=y(e.arcType,Kt.GEODESIC),r=e.polygonHierarchy,o=y(e.ellipsoid,oe.WGS84);return gte(r.positions,o,i,n,t)};rd.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,r=e._stRotation,o=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,u=e._arcType,f=e._textureCoordinates,d=l(f),p=o.positions;if(p.length<3)return;let g=La.fromPoints(p,n),m=Hn.polygonsFromHierarchy(o,d,g.projectPointsOntoPlane.bind(g),!s,n),x=m.hierarchy,C=m.polygons,A=function(v){return v},b=d?Hn.polygonsFromHierarchy(f,!0,A,!1).polygons:void 0;if(x.length===0)return;p=x[0].outerRing;let T=Hn.computeBoundingRectangle(g.plane.normal,g.projectPointOntoPlane.bind(g),p,r,$Re),S=[],w=e._height,D=e._extrudedHeight,I=e._perPositionHeightExtrude||!M.equalsEpsilon(w,D,0,M.EPSILON2),O={perPositionHeight:s,vertexFormat:t,geometry:void 0,tangentPlane:g,boundingRectangle:T,ellipsoid:n,stRotation:r,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},B;if(I)for(O.extrude=!0,O.top=a,O.bottom=c,O.shadowVolume=e._shadowVolume,O.offsetAttribute=e._offsetAttribute,B=0;B<C.length;B++){let v=fMe(n,C[B],d?b[B]:void 0,i,x[B],s,a,c,t,u),P;a&&c?(P=v.topAndBottom,O.geometry=Hn.scaleToGeodeticHeightExtruded(P.geometry,w,D,n,s)):a?(P=v.topAndBottom,P.geometry.attributes.position.values=si.scaleToGeodeticHeight(P.geometry.attributes.position.values,w,n,!s),O.geometry=P.geometry):c&&(P=v.topAndBottom,P.geometry.attributes.position.values=si.scaleToGeodeticHeight(P.geometry.attributes.position.values,D,n,!0),O.geometry=P.geometry),(a||c)&&(O.wall=!1,P.geometry=NG(O),S.push(P));let R=v.walls;O.wall=!0;for(let F=0;F<R.length;F++){let U=R[F];O.geometry=Hn.scaleToGeodeticHeightExtruded(U.geometry,w,D,n,s),U.geometry=NG(O),S.push(U)}}else for(B=0;B<C.length;B++){let v=new pt({geometry:Hn.createGeometryFromPositions(n,C[B],d?b[B]:void 0,i,s,t,u)});if(v.geometry.attributes.position.values=si.scaleToGeodeticHeight(v.geometry.attributes.position.values,w,n,!s),O.geometry=v.geometry,v.geometry=NG(O),l(e._offsetAttribute)){let P=v.geometry.attributes.position.values.length,R=e._offsetAttribute===nn.NONE?0:1,F=new Uint8Array(P/3).fill(R);v.geometry.attributes.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}S.push(v)}let L=Bn.combineInstances(S)[0];L.attributes.position.values=new Float64Array(L.attributes.position.values),L.indices=Le.createTypedArray(L.attributes.position.values.length/3,L.indices);let _=L.attributes,E=re.fromVertices(_.position.values);return t.position||delete _.position,new ot({attributes:_,indices:L.indices,primitiveType:L.primitiveType,boundingSphere:E,offsetAttribute:e._offsetAttribute})};rd.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new rd({polygonHierarchy:e._polygonHierarchy,ellipsoid:r,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:o,height:s,vertexFormat:Pe.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function pMe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,r=e.rectangle;return ot._textureCoordinateRotationPoints(i,t,n,r)}Object.defineProperties(rd.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=gte(e,this._ellipsoid,this._arcType,this._granularity)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=pMe(this)),this._textureCoordinateRotationPoints}}});var tT=rd;function _Me(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var ul=_Me;var yte=[],NO=[];function gMe(e,t,n,i,r){let s=La.fromPoints(t,e).projectPointsOntoPlane(t,yte);si.computeWindingOrder2D(s)===hs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=0;if(i)for(c=new Float64Array(f*2*3),u=0;u<f;u++){let m=t[u],x=t[(u+1)%f];c[d++]=m.x,c[d++]=m.y,c[d++]=m.z,c[d++]=x.x,c[d++]=x.y,c[d++]=x.z}else{let m=0;if(r===Kt.GEODESIC)for(u=0;u<f;u++)m+=Hn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===Kt.RHUMB)for(u=0;u<f;u++)m+=Hn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(m*3),u=0;u<f;u++){let x;r===Kt.GEODESIC?x=Hn.subdivideLine(t[u],t[(u+1)%f],n,NO):r===Kt.RHUMB&&(x=Hn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,NO));let C=x.length;for(let A=0;A<C;++A)c[d++]=x[A]}}f=c.length/3;let p=f*2,g=Le.createTypedArray(f,p);for(d=0,u=0;u<f-1;u++)g[d++]=u,g[d++]=u+1;return g[d++]=f-1,g[d++]=0,new pt({geometry:new ot({attributes:new dn({position:new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Me.LINES})})}function yMe(e,t,n,i,r){let s=La.fromPoints(t,e).projectPointsOntoPlane(t,yte);si.computeWindingOrder2D(s)===hs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=new Array(f),p=0;if(i)for(c=new Float64Array(f*2*3*2),u=0;u<f;++u){d[u]=p/3;let C=t[u],A=t[(u+1)%f];c[p++]=C.x,c[p++]=C.y,c[p++]=C.z,c[p++]=A.x,c[p++]=A.y,c[p++]=A.z}else{let C=0;if(r===Kt.GEODESIC)for(u=0;u<f;u++)C+=Hn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===Kt.RHUMB)for(u=0;u<f;u++)C+=Hn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(C*3*2),u=0;u<f;++u){d[u]=p/3;let A;r===Kt.GEODESIC?A=Hn.subdivideLine(t[u],t[(u+1)%f],n,NO):r===Kt.RHUMB&&(A=Hn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,NO));let b=A.length;for(let T=0;T<b;++T)c[p++]=A[T]}}f=c.length/(3*2);let g=d.length,m=(f*2+g)*2,x=Le.createTypedArray(f+g,m);for(p=0,u=0;u<f;++u)x[p++]=u,x[p++]=(u+1)%f,x[p++]=u+f,x[p++]=(u+1)%f+f;for(u=0;u<g;u++){let C=d[u];x[p++]=C,x[p++]=C+f}return new pt({geometry:new ot({attributes:new dn({position:new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:c})}),indices:x,primitiveType:Me.LINES})})}function Fy(e){let t=e.polygonHierarchy,n=y(e.ellipsoid,oe.WGS84),i=y(e.granularity,M.RADIANS_PER_DEGREE),r=y(e.perPositionHeight,!1),o=r&&l(e.extrudedHeight),s=y(e.arcType,Kt.GEODESIC),a=y(e.height,0),c=y(e.extrudedHeight,a);if(!o){let u=Math.max(a,c);c=Math.min(a,c),a=u}this._ellipsoid=oe.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=r,this._perPositionHeightExtrude=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=Hn.computeHierarchyPackedLength(t,h)+oe.packedLength+8}Fy.pack=function(e,t,n){return n=y(n,0),n=Hn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=y(e._offsetAttribute,-1),t[n]=e.packedLength,t};var xMe=oe.clone(oe.UNIT_SPHERE),CMe={polygonHierarchy:{}};Fy.unpack=function(e,t,n){t=y(t,0);let i=Hn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=oe.unpack(e,t,xMe);t+=oe.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,u=e[t++]===1,f=e[t++],d=e[t++],p=e[t];return l(n)||(n=new Fy(CMe)),n._polygonHierarchy=i,n._ellipsoid=oe.clone(r,n._ellipsoid),n._height=o,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=d===-1?void 0:d,n.packedLength=p,n};Fy.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new Fy(t)};Fy.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,r=e._perPositionHeight,o=e._arcType,s=Hn.polygonOutlinesFromHierarchy(i,!r,t);if(s.length===0)return;let a,c=[],u=M.chordLength(n,t.maximumRadius),f=e._height,d=e._extrudedHeight,p=e._perPositionHeightExtrude||!M.equalsEpsilon(f,d,0,M.EPSILON2),g,m;if(p)for(m=0;m<s.length;m++){if(a=yMe(t,s[m],u,r,o),a.geometry=Hn.scaleToGeodeticHeightExtruded(a.geometry,f,d,t,r),l(e._offsetAttribute)){let A=a.geometry.attributes.position.values.length/3,b=new Uint8Array(A);e._offsetAttribute===nn.TOP?b=b.fill(1,0,A/2):(g=e._offsetAttribute===nn.NONE?0:1,b=b.fill(g)),a.geometry.attributes.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}c.push(a)}else for(m=0;m<s.length;m++){if(a=gMe(t,s[m],u,r,o),a.geometry.attributes.position.values=si.scaleToGeodeticHeight(a.geometry.attributes.position.values,f,t,!r),l(e._offsetAttribute)){let A=a.geometry.attributes.position.values.length;g=e._offsetAttribute===nn.NONE?0:1;let b=new Uint8Array(A/3).fill(g);a.geometry.attributes.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}c.push(a)}let x=Bn.combineInstances(c)[0],C=re.fromVertices(x.attributes.position.values);return new ot({attributes:x.attributes,indices:x.indices,primitiveType:x.primitiveType,boundingSphere:C,offsetAttribute:e._offsetAttribute})};var FO=Fy;var bte=[];function AMe(e,t,n,i,r){let o=bte;o.length=r;let s,a=n.red,c=n.green,u=n.blue,f=n.alpha,d=i.red,p=i.green,g=i.blue,m=i.alpha;if(z.equals(n,i)){for(s=0;s<r;s++)o[s]=z.clone(n);return o}let x=(d-a)/r,C=(p-c)/r,A=(g-u)/r,b=(m-f)/r;for(s=0;s<r;s++)o[s]=new z(a+s*x,c+s*C,u+s*A,f+s*b);return o}function ew(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.width,1),r=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=r,this._vertexFormat=Pe.clone(y(e.vertexFormat,Pe.DEFAULT)),this._arcType=y(e.arcType,Kt.GEODESIC),this._granularity=y(e.granularity,M.RADIANS_PER_DEGREE),this._ellipsoid=oe.clone(y(e.ellipsoid,oe.WGS84)),this._workerName="createPolylineGeometry";let o=1+t.length*h.packedLength;o+=l(n)?1+n.length*z.packedLength:1,this.packedLength=o+oe.packedLength+Pe.packedLength+4}ew.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._colors;for(o=l(s)?s.length:0,t[n++]=o,i=0;i<o;++i,n+=z.packedLength)z.pack(s[i],t,n);return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var Ete=oe.clone(oe.UNIT_SPHERE),Ste=new Pe,Vy={positions:void 0,colors:void 0,ellipsoid:Ete,vertexFormat:Ste,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};ew.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=oe.unpack(e,t,Ete);t+=oe.packedLength;let c=Pe.unpack(e,t,Ste);t+=Pe.packedLength;let u=e[t++],f=e[t++]===1,d=e[t++],p=e[t];return l(n)?(n._positions=o,n._colors=s,n._ellipsoid=oe.clone(a,n._ellipsoid),n._vertexFormat=Pe.clone(c,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=d,n._granularity=p,n):(Vy.positions=o,Vy.colors=s,Vy.width=u,Vy.colorsPerVertex=f,Vy.arcType=d,Vy.granularity=p,new ew(Vy))};var xte=new h,Cte=new h,Ate=new h,Tte=new h;ew.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,r=e._colorsPerVertex,o=e._arcType,s=e._granularity,a=e._ellipsoid,c,u,f,d=[],p=vr(e._positions,h.equalsEpsilon,!1,d);if(l(i)&&d.length>0){let R=0,F=d[0];i=i.filter(function(U,k){let H=!1;return r?H=k===F||k===0&&F===1:H=k+1===F,H?(R++,F=d[R],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(o===Kt.GEODESIC||o===Kt.RHUMB){let R,F;o===Kt.GEODESIC?(R=M.chordLength(s,a.maximumRadius),F=Ni.numberOfPoints):(R=s,F=Ni.numberOfPointsRhumbLine);let U=Ni.extractHeights(p,a);if(l(i)){let k=1;for(c=0;c<g-1;++c)k+=F(p[c],p[c+1],R);let H=new Array(k),V=0;for(c=0;c<g-1;++c){let q=p[c],j=p[c+1],X=i[c],G=F(q,j,R);if(r&&c<k){let $=i[c+1],J=AMe(q,j,X,$,G),ce=J.length;for(u=0;u<ce;++u)H[V++]=J[u]}else for(u=0;u<G;++u)H[V++]=z.clone(X)}H[V]=z.clone(i[i.length-1]),i=H,bte.length=0}o===Kt.GEODESIC?p=Ni.generateCartesianArc({positions:p,minDistance:R,ellipsoid:a,height:U}):p=Ni.generateCartesianRhumbArc({positions:p,granularity:R,ellipsoid:a,height:U})}g=p.length;let m=g*4-4,x=new Float64Array(m*3),C=new Float64Array(m*3),A=new Float64Array(m*3),b=new Float32Array(m*2),T=n.st?new Float32Array(m*2):void 0,S=l(i)?new Uint8Array(m*4):void 0,w=0,D=0,I=0,O=0,B;for(u=0;u<g;++u){u===0?(B=xte,h.subtract(p[0],p[1],B),h.add(p[0],B,B)):B=p[u-1],h.clone(B,Ate),h.clone(p[u],Cte),u===g-1?(B=xte,h.subtract(p[g-1],p[g-2],B),h.add(p[g-1],B,B)):B=p[u+1],h.clone(B,Tte);let R,F;l(S)&&(u!==0&&!r?R=i[u-1]:R=i[u],u!==g-1&&(F=i[u]));let U=u===0?2:0,k=u===g-1?2:4;for(f=U;f<k;++f){h.pack(Cte,x,w),h.pack(Ate,C,w),h.pack(Tte,A,w),w+=3;let H=f-2<0?-1:1;if(b[D++]=2*(f%2)-1,b[D++]=H*t,n.st&&(T[I++]=u/(g-1),T[I++]=Math.max(b[D-2],0)),l(S)){let V=f<2?R:F;S[O++]=z.floatToByte(V.red),S[O++]=z.floatToByte(V.green),S[O++]=z.floatToByte(V.blue),S[O++]=z.floatToByte(V.alpha)}}}let L=new dn;L.position=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:x}),L.prevPosition=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:C}),L.nextPosition=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:A}),L.expandAndWidth=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:b}),n.st&&(L.st=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:T})),l(S)&&(L.color=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:4,values:S,normalize:!0}));let _=Le.createTypedArray(m,g*6-6),E=0,v=0,P=g-1;for(u=0;u<P;++u)_[v++]=E,_[v++]=E+2,_[v++]=E+1,_[v++]=E+1,_[v++]=E+2,_[v++]=E+3,E+=4;return new ot({attributes:L,indices:_,primitiveType:Me.TRIANGLES,boundingSphere:re.fromPoints(p),geometryType:$f.POLYLINES})};var Z_=ew;function TMe(e,t,n,i){let r=new dn;i.position&&(r.position=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:e}));let o=t.length,s=e.length/3,a=(s-o*2)/(o*2),c=si.triangulate(t),u=(a-1)*o*6+c.length*2,f=Le.createTypedArray(s,u),d,p,g,m,x,C,A=o*2,b=0;for(d=0;d<a-1;d++){for(p=0;p<o-1;p++)g=p*2+d*o*2,C=g+A,m=g+1,x=m+A,f[b++]=m,f[b++]=g,f[b++]=x,f[b++]=x,f[b++]=g,f[b++]=C;g=o*2-2+d*o*2,m=g+1,x=m+A,C=g+A,f[b++]=m,f[b++]=g,f[b++]=x,f[b++]=x,f[b++]=g,f[b++]=C}if(i.st||i.tangent||i.bitangent){let w=new Float32Array(s*2),D=1/(a-1),I=1/n.height,O=n.height/2,B,L,_=0;for(d=0;d<a;d++){for(B=d*D,L=I*(t[0].y+O),w[_++]=B,w[_++]=L,p=1;p<o;p++)L=I*(t[p].y+O),w[_++]=B,w[_++]=L,w[_++]=B,w[_++]=L;L=I*(t[0].y+O),w[_++]=B,w[_++]=L}for(p=0;p<o;p++)B=0,L=I*(t[p].y+O),w[_++]=B,w[_++]=L;for(p=0;p<o;p++)B=(a-1)*D,L=I*(t[p].y+O),w[_++]=B,w[_++]=L;r.st=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:new Float32Array(w)})}let T=s-o*2;for(d=0;d<c.length;d+=3){let w=c[d]+T,D=c[d+1]+T,I=c[d+2]+T;f[b++]=w,f[b++]=D,f[b++]=I,f[b++]=I+o,f[b++]=D+o,f[b++]=w+o}let S=new ot({attributes:r,indices:f,boundingSphere:re.fromVertices(e),primitiveType:Me.TRIANGLES});if(i.normal&&(S=Bn.computeNormal(S)),i.tangent||i.bitangent){try{S=Bn.computeTangentAndBitangent(S)}catch{Lt("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(S.attributes.tangent=void 0),i.bitangent||(S.attributes.bitangent=void 0),i.st||(S.attributes.st=void 0)}return S}function nw(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=oe.clone(y(e.ellipsoid,oe.WGS84)),this._cornerType=y(e.cornerType,Li.ROUNDED),this._vertexFormat=Pe.clone(y(e.vertexFormat,Pe.DEFAULT)),this._granularity=y(e.granularity,M.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*W.packedLength,this.packedLength=i+oe.packedLength+Pe.packedLength+2}nw.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._shape;for(o=s.length,t[n++]=o,i=0;i<o;++i,n+=W.packedLength)W.pack(s[i],t,n);return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var wte=oe.clone(oe.UNIT_SPHERE),vte=new Pe,tw={polylinePositions:void 0,shapePositions:void 0,ellipsoid:wte,vertexFormat:vte,cornerType:void 0,granularity:void 0};nw.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=new Array(r);for(i=0;i<r;++i,t+=W.packedLength)s[i]=W.unpack(e,t);let a=oe.unpack(e,t,wte);t+=oe.packedLength;let c=Pe.unpack(e,t,vte);t+=Pe.packedLength;let u=e[t++],f=e[t];return l(n)?(n._positions=o,n._shape=s,n._ellipsoid=oe.clone(a,n._ellipsoid),n._vertexFormat=Pe.clone(c,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(tw.polylinePositions=o,tw.shapePositions=s,tw.cornerType=u,tw.granularity=f,new nw(tw))};var bMe=new je;nw.createGeometry=function(e){let t=e._positions,n=vr(t,h.equalsEpsilon),i=e._shape;if(i=wh.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;si.computeWindingOrder2D(i)===hs.CLOCKWISE&&i.reverse();let r=je.fromPoints(i,bMe),o=wh.computePositions(n,i,r,e,!0);return TMe(o,i,r,e._vertexFormat)};var VO=nw;function EMe(e,t){let n=new dn;n.position=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,r=n.position.values.length/3,s=e.length/3/i,a=Le.createTypedArray(r,2*i*(s+1)),c,u,f=0;c=0;let d=c*i;for(u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=s-1,d=c*i,u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=0;c<s-1;c++){let g=i*c,m=g+i;for(u=0;u<i;u++)a[f++]=u+g,a[f++]=u+m}return new ot({attributes:n,indices:Le.createTypedArray(r,a),boundingSphere:re.fromVertices(e),primitiveType:Me.LINES})}function rw(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=oe.clone(y(e.ellipsoid,oe.WGS84)),this._cornerType=y(e.cornerType,Li.ROUNDED),this._granularity=y(e.granularity,M.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*W.packedLength,this.packedLength=i+oe.packedLength+2}rw.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._shape;for(o=s.length,t[n++]=o,i=0;i<o;++i,n+=W.packedLength)W.pack(s[i],t,n);return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Dte=oe.clone(oe.UNIT_SPHERE),iw={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Dte,height:void 0,cornerType:void 0,granularity:void 0};rw.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=new Array(r);for(i=0;i<r;++i,t+=W.packedLength)s[i]=W.unpack(e,t);let a=oe.unpack(e,t,Dte);t+=oe.packedLength;let c=e[t++],u=e[t];return l(n)?(n._positions=o,n._shape=s,n._ellipsoid=oe.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=u,n):(iw.polylinePositions=o,iw.shapePositions=s,iw.cornerType=c,iw.granularity=u,new rw(iw))};var SMe=new je;rw.createGeometry=function(e){let t=e._positions,n=vr(t,h.equalsEpsilon),i=e._shape;if(i=wh.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;si.computeWindingOrder2D(i)===hs.CLOCKWISE&&i.reverse();let r=je.fromPoints(i,SMe),o=wh.computePositions(n,i,r,e,!1);return EMe(o,i)};var kO=rw;function Pte(){ye.throwInstantiationError()}Pte.prototype.getURL=ye.throwInstantiationError;var Ite=Pte;function wMe(e){let t=e.points,n=e.times;return function(i,r){l(r)||(r=new Re);let o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[o])/(n[o+1]-n[o]),a=t[o],c=t[o+1];return Re.fastSlerp(a,c,s,r)}}function nT(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=wMe(this),this._lastTimeIndex=0}Object.defineProperties(nT.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});nT.prototype.findTimeInterval=qi.prototype.findTimeInterval;nT.prototype.wrapTime=qi.prototype.wrapTime;nT.prototype.clampTime=qi.prototype.clampTime;nT.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var iT=nT;var ow=Ns(Ote(),1);function UO(){this._tree=new ow.default}function ky(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}ky.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n};UO.prototype.insert=function(e,t){let n=ky.fromRectangleAndId(e,t,new ky);this._tree.insert(n)};function vMe(e,t){return e.id===t.id}var DMe=new ky;UO.prototype.remove=function(e,t){let n=ky.fromRectangleAndId(e,t,DMe);this._tree.remove(n,vMe)};var PMe=new ky;UO.prototype.collides=function(e){let t=ky.fromRectangleAndId("",e,PMe);return this._tree.collides(t)};var rT=UO;var Rte=Math.cos,Mte=Math.sin,IMe=Math.sqrt,UG={};UG.computePosition=function(e,t,n,i,r,o,s){let a=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle,f=c.latitude-e.granYCos*i+r*e.granXSin,d=Rte(f),p=Mte(f),g=a.z*p,m=c.longitude+i*e.granYSin+r*e.granXCos,x=d*Rte(m),C=d*Mte(m),A=a.x*x,b=a.y*C,T=IMe(A*x+b*C+g*p);if(o.x=A/T,o.y=b/T,o.z=g/T,n){let S=e.stNwCorner;l(S)?(f=S.latitude-e.stGranYCos*i+r*e.stGranXSin,m=S.longitude+i*e.stGranYSin+r*e.stGranXCos,s.x=(m-e.stWest)*e.lonScalar,s.y=(f-e.stSouth)*e.latScalar):(s.x=(m-u.west)*e.lonScalar,s.y=(f-u.south)*e.latScalar)}};var OMe=new Ri,Xu=new h,RMe=new me,zO=new h,kG=new Ii;function Bte(e,t,n,i,r,o,s){let a=Math.cos(t),c=i*a,u=n*a,f=Math.sin(t),d=i*f,p=n*f;Xu=kG.project(e,Xu),Xu=h.subtract(Xu,zO,Xu);let g=Ri.fromRotation(t,OMe);Xu=Ri.multiplyByVector(g,Xu,Xu),Xu=h.add(Xu,zO,Xu),e=kG.unproject(Xu,e),o-=1,s-=1;let m=e.latitude,x=m+o*p,C=m-c*s,A=m-c*s+o*p,b=Math.max(m,x,C,A),T=Math.min(m,x,C,A),S=e.longitude,w=S+o*u,D=S+s*d,I=S+s*d+o*u,O=Math.max(S,w,D,I),B=Math.min(S,w,D,I);return{north:b,south:T,east:O,west:B,granYCos:c,granYSin:d,granXCos:u,granXSin:p,nwCorner:e}}UG.computeOptions=function(e,t,n,i,r,o,s){let a=e.east,c=e.west,u=e.north,f=e.south,d=!1,p=!1;u===M.PI_OVER_TWO&&(d=!0),f===-M.PI_OVER_TWO&&(p=!0);let g,m=u-f;c>a?g=M.TWO_PI-c+a:g=a-c;let x=Math.ceil(g/t)+1,C=Math.ceil(m/t)+1,A=g/(x-1),b=m/(C-1),T=he.northwest(e,o),S=he.center(e,RMe);(n!==0||i!==0)&&(S.longitude<T.longitude&&(S.longitude+=M.TWO_PI),zO=kG.project(S,zO));let w=b,D=A,I=0,O=0,B=he.clone(e,r),L={granYCos:w,granYSin:I,granXCos:D,granXSin:O,nwCorner:T,boundingRectangle:B,width:x,height:C,northCap:d,southCap:p};if(n!==0){let _=Bte(T,n,A,b,S,x,C);u=_.north,f=_.south,a=_.east,c=_.west,L.granYCos=_.granYCos,L.granYSin=_.granYSin,L.granXCos=_.granXCos,L.granXSin=_.granXSin,B.north=u,B.south=f,B.east=a,B.west=c}if(i!==0){n=n-i;let _=he.northwest(B,s),E=Bte(_,n,A,b,S,x,C);L.stGranYCos=E.granYCos,L.stGranXCos=E.granXCos,L.stGranYSin=E.granYSin,L.stGranXSin=E.granXSin,L.stNwCorner=_,L.stWest=E.west,L.stSouth=E.south}return L};var Ss=UG;var zG=new h,Fte=new h,Vte=new h,kte=new h,Ute=new he,MMe=new W,BMe=new re,LMe=new re;function zte(e,t){let n=new ot({attributes:new dn,primitiveType:Me.TRIANGLES});return n.attributes.position=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function NMe(e,t,n,i){let r=e.length,o=t.normal?new Float32Array(r):void 0,s=t.tangent?new Float32Array(r):void 0,a=t.bitangent?new Float32Array(r):void 0,c=0,u=kte,f=Vte,d=Fte;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<r;p+=3){let g=h.fromArray(e,p,zG),m=c+1,x=c+2;d=n.geodeticSurfaceNormal(g,d),(t.tangent||t.bitangent)&&(h.cross(h.UNIT_Z,d,f),Q.multiplyByVector(i,f,f),h.normalize(f,f),t.bitangent&&h.normalize(h.cross(d,f,u),u)),t.normal&&(o[c]=d.x,o[m]=d.y,o[x]=d.z),t.tangent&&(s[c]=f.x,s[m]=f.y,s[x]=f.z),t.bitangent&&(a[c]=u.x,a[m]=u.y,a[x]=u.z),c+=3}return zte(t,{positions:e,normals:o,tangents:s,bitangents:a})}var HG=new h,Hte=new h;function FMe(e,t,n){let i=e.length,r=t.normal?new Float32Array(i):void 0,o=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,u=0,f=!0,d=kte,p=Vte,g=Fte;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let x=h.fromArray(e,m,zG),C=h.fromArray(e,(m+6)%i,HG);if(f){let A=h.fromArray(e,(m+3)%i,Hte);h.subtract(C,x,C),h.subtract(A,x,A),g=h.normalize(h.cross(A,C,g),g),f=!1}h.equalsEpsilon(C,x,M.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(d=n.geodeticSurfaceNormal(x,d),t.tangent&&(p=h.normalize(h.cross(d,g,p),p))),t.normal&&(r[a++]=g.x,r[a++]=g.y,r[a++]=g.z,r[a++]=g.x,r[a++]=g.y,r[a++]=g.z),t.tangent&&(o[c++]=p.x,o[c++]=p.y,o[c++]=p.z,o[c++]=p.x,o[c++]=p.y,o[c++]=p.z),t.bitangent&&(s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,s[u++]=d.x,s[u++]=d.y,s[u++]=d.z)}return zte(t,{positions:e,normals:r,tangents:o,bitangents:s})}function Gte(e,t){let n=e._vertexFormat,i=e._ellipsoid,r=t.height,o=t.width,s=t.northCap,a=t.southCap,c=0,u=r,f=r,d=0;s&&(c=1,f-=1,d+=1),a&&(u-=1,f-=1,d+=1),d+=o*f;let p=n.position?new Float64Array(d*3):void 0,g=n.st?new Float32Array(d*2):void 0,m=0,x=0,C=zG,A=MMe,b=Number.MAX_VALUE,T=Number.MAX_VALUE,S=-Number.MAX_VALUE,w=-Number.MAX_VALUE;for(let E=c;E<u;++E)for(let v=0;v<o;++v)Ss.computePosition(t,i,n.st,E,v,C,A),p[m++]=C.x,p[m++]=C.y,p[m++]=C.z,n.st&&(g[x++]=A.x,g[x++]=A.y,b=Math.min(b,A.x),T=Math.min(T,A.y),S=Math.max(S,A.x),w=Math.max(w,A.y));if(s&&(Ss.computePosition(t,i,n.st,0,0,C,A),p[m++]=C.x,p[m++]=C.y,p[m++]=C.z,n.st&&(g[x++]=A.x,g[x++]=A.y,b=A.x,T=A.y,S=A.x,w=A.y)),a&&(Ss.computePosition(t,i,n.st,r-1,0,C,A),p[m++]=C.x,p[m++]=C.y,p[m]=C.z,n.st&&(g[x++]=A.x,g[x]=A.y,b=Math.min(b,A.x),T=Math.min(T,A.y),S=Math.max(S,A.x),w=Math.max(w,A.y))),n.st&&(b<0||T<0||S>1||w>1))for(let E=0;E<g.length;E+=2)g[E]=(g[E]-b)/(S-b),g[E+1]=(g[E+1]-T)/(w-T);let D=NMe(p,n,i,t.tangentRotationMatrix),I=6*(o-1)*(f-1);s&&(I+=3*(o-1)),a&&(I+=3*(o-1));let O=Le.createTypedArray(d,I),B=0,L=0,_;for(_=0;_<f-1;++_){for(let E=0;E<o-1;++E){let v=B,P=v+o,R=P+1,F=v+1;O[L++]=v,O[L++]=P,O[L++]=F,O[L++]=F,O[L++]=P,O[L++]=R,++B}++B}if(s||a){let E=d-1,v=d-1;s&&a&&(E=d-2);let P,R;if(B=0,s)for(_=0;_<o-1;_++)P=B,R=P+1,O[L++]=E,O[L++]=P,O[L++]=R,++B;if(a)for(B=(f-1)*o,_=0;_<o-1;_++)P=B,R=P+1,O[L++]=P,O[L++]=v,O[L++]=R,++B}return D.indices=O,n.st&&(D.attributes.st=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:g})),D}function oT(e,t,n,i,r){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=r[n],e[t++]=r[n+1],e[t]=r[n+2],e}function sT(e,t,n,i){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n],e[t]=i[n+1],e}var GG=new Pe;function VMe(e,t){let n=e._shadowVolume,i=e._offsetAttribute,r=e._vertexFormat,o=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,u=t.width,f;if(n){let ht=Pe.clone(r,GG);ht.normal=!0,e._vertexFormat=ht}let d=Gte(e,t);n&&(e._vertexFormat=r);let p=si.scaleToGeodeticHeight(d.attributes.position.values,s,a,!1);p=new Float64Array(p);let g=p.length,m=g*2,x=new Float64Array(m);x.set(p);let C=si.scaleToGeodeticHeight(d.attributes.position.values,o,a);x.set(C,g),d.attributes.position.values=x;let A=r.normal?new Float32Array(m):void 0,b=r.tangent?new Float32Array(m):void 0,T=r.bitangent?new Float32Array(m):void 0,S=r.st?new Float32Array(m/3*2):void 0,w,D;if(r.normal){for(D=d.attributes.normal.values,A.set(D),f=0;f<g;f++)D[f]=-D[f];A.set(D,g),d.attributes.normal.values=A}if(n){D=d.attributes.normal.values,r.normal||(d.attributes.normal=void 0);let ht=new Float32Array(m);for(f=0;f<g;f++)D[f]=-D[f];ht.set(D,g),d.attributes.extrudeDirection=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:ht})}let I,O=l(i);if(O){let ht=g/3*2,wn=new Uint8Array(ht);i===nn.TOP?wn=wn.fill(1,0,ht/2):(I=i===nn.NONE?0:1,wn=wn.fill(I)),d.attributes.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:wn})}if(r.tangent){let ht=d.attributes.tangent.values;for(b.set(ht),f=0;f<g;f++)ht[f]=-ht[f];b.set(ht,g),d.attributes.tangent.values=b}if(r.bitangent){let ht=d.attributes.bitangent.values;T.set(ht),T.set(ht,g),d.attributes.bitangent.values=T}r.st&&(w=d.attributes.st.values,S.set(w),S.set(w,g/3*2),d.attributes.st.values=S);let B=d.indices,L=B.length,_=g/3,E=Le.createTypedArray(m/3,L*2);for(E.set(B),f=0;f<L;f+=3)E[f+L]=B[f+2]+_,E[f+1+L]=B[f+1]+_,E[f+2+L]=B[f]+_;d.indices=E;let v=t.northCap,P=t.southCap,R=c,F=2,U=0,k=4,H=4;v&&(F-=1,R-=1,U+=1,k-=2,H-=1),P&&(F-=1,R-=1,U+=1,k-=2,H-=1),U+=F*u+2*R-k;let V=(U+H)*2,q=new Float64Array(V*3),j=n?new Float32Array(V*3):void 0,X=O?new Uint8Array(V):void 0,G=r.st?new Float32Array(V*2):void 0,$=i===nn.TOP;O&&!$&&(I=i===nn.ALL?1:0,X=X.fill(I));let J=0,ce=0,de=0,ie=0,ae=u*R,_e;for(f=0;f<ae;f+=u)_e=f*3,q=oT(q,J,_e,p,C),J+=6,r.st&&(G=sT(G,ce,f*2,w),ce+=4),n&&(de+=3,j[de++]=D[_e],j[de++]=D[_e+1],j[de++]=D[_e+2]),$&&(X[ie++]=1,ie+=1);if(P){let ht=v?ae+1:ae;for(_e=ht*3,f=0;f<2;f++)q=oT(q,J,_e,p,C),J+=6,r.st&&(G=sT(G,ce,ht*2,w),ce+=4),n&&(de+=3,j[de++]=D[_e],j[de++]=D[_e+1],j[de++]=D[_e+2]),$&&(X[ie++]=1,ie+=1)}else for(f=ae-u;f<ae;f++)_e=f*3,q=oT(q,J,_e,p,C),J+=6,r.st&&(G=sT(G,ce,f*2,w),ce+=4),n&&(de+=3,j[de++]=D[_e],j[de++]=D[_e+1],j[de++]=D[_e+2]),$&&(X[ie++]=1,ie+=1);for(f=ae-1;f>0;f-=u)_e=f*3,q=oT(q,J,_e,p,C),J+=6,r.st&&(G=sT(G,ce,f*2,w),ce+=4),n&&(de+=3,j[de++]=D[_e],j[de++]=D[_e+1],j[de++]=D[_e+2]),$&&(X[ie++]=1,ie+=1);if(v){let ht=ae;for(_e=ht*3,f=0;f<2;f++)q=oT(q,J,_e,p,C),J+=6,r.st&&(G=sT(G,ce,ht*2,w),ce+=4),n&&(de+=3,j[de++]=D[_e],j[de++]=D[_e+1],j[de++]=D[_e+2]),$&&(X[ie++]=1,ie+=1)}else for(f=u-1;f>=0;f--)_e=f*3,q=oT(q,J,_e,p,C),J+=6,r.st&&(G=sT(G,ce,f*2,w),ce+=4),n&&(de+=3,j[de++]=D[_e],j[de++]=D[_e+1],j[de++]=D[_e+2]),$&&(X[ie++]=1,ie+=1);let be=FMe(q,r,a);r.st&&(be.attributes.st=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:G})),n&&(be.attributes.extrudeDirection=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:j})),O&&(be.attributes.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:X}));let Te=Le.createTypedArray(V,U*6),Oe,Be,tt,lt;g=q.length/3;let Pt=0;for(f=0;f<g-1;f+=2){Oe=f,lt=(Oe+2)%g;let ht=h.fromArray(q,Oe*3,HG),wn=h.fromArray(q,lt*3,Hte);h.equalsEpsilon(ht,wn,M.EPSILON10)||(Be=(Oe+1)%g,tt=(Be+2)%g,Te[Pt++]=Oe,Te[Pt++]=Be,Te[Pt++]=lt,Te[Pt++]=lt,Te[Pt++]=Be,Te[Pt++]=tt)}return be.indices=Te,be=Bn.combineInstances([new pt({geometry:d}),new pt({geometry:be})]),be[0]}var kMe=[new h,new h,new h,new h],Wte=new me,UMe=new me;function WG(e,t,n,i,r){if(n===0)return he.clone(e,r);let o=Ss.computeOptions(e,t,n,0,Ute,Wte),s=o.height,a=o.width,c=kMe;return Ss.computePosition(o,i,!1,0,0,c[0]),Ss.computePosition(o,i,!1,0,a-1,c[1]),Ss.computePosition(o,i,!1,s-1,0,c[2]),Ss.computePosition(o,i,!1,s-1,a-1,c[3]),he.fromCartesianArray(c,i,r)}function Fh(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.height,0),i=y(e.extrudedHeight,n);this._rectangle=he.clone(t),this._granularity=y(e.granularity,M.RADIANS_PER_DEGREE),this._ellipsoid=oe.clone(y(e.ellipsoid,oe.WGS84)),this._surfaceHeight=Math.max(n,i),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._vertexFormat=Pe.clone(y(e.vertexFormat,Pe.DEFAULT)),this._extrudedHeight=Math.min(n,i),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}Fh.packedLength=he.packedLength+oe.packedLength+Pe.packedLength+7;Fh.pack=function(e,t,n){return n=y(n,0),he.pack(e._rectangle,t,n),n+=he.packedLength,oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var jte=new he,qte=oe.clone(oe.UNIT_SPHERE),J_={rectangle:jte,ellipsoid:qte,vertexFormat:GG,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Fh.unpack=function(e,t,n){t=y(t,0);let i=he.unpack(e,t,jte);t+=he.packedLength;let r=oe.unpack(e,t,qte);t+=oe.packedLength;let o=Pe.unpack(e,t,GG);t+=Pe.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++]===1,p=e[t];return l(n)?(n._rectangle=he.clone(i,n._rectangle),n._ellipsoid=oe.clone(r,n._ellipsoid),n._vertexFormat=Pe.clone(o,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=d,n._offsetAttribute=p===-1?void 0:p,n):(J_.granularity=s,J_.height=a,J_.rotation=c,J_.stRotation=u,J_.extrudedHeight=f,J_.shadowVolume=d,J_.offsetAttribute=p===-1?void 0:p,new Fh(J_))};Fh.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.rectangle,i=y(e.granularity,M.RADIANS_PER_DEGREE),r=y(e.ellipsoid,oe.WGS84),o=y(e.rotation,0);return WG(n,i,o,r,t)};var zMe=new Q,Lte=new Re,HMe=new me;Fh.createGeometry=function(e){if(M.equalsEpsilon(e._rectangle.north,e._rectangle.south,M.EPSILON10)||M.equalsEpsilon(e._rectangle.east,e._rectangle.west,M.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,r=e._stRotation,o=e._vertexFormat,s=Ss.computeOptions(t,e._granularity,i,r,Ute,Wte,UMe),a=zMe;if(r!==0||i!==0){let g=he.center(t,HMe),m=n.geodeticSurfaceNormalCartographic(g,HG);Re.fromAxisAngle(m,-r,Lte),Q.fromQuaternion(Lte,a)}else Q.clone(Q.IDENTITY,a);let c=e._surfaceHeight,u=e._extrudedHeight,f=!M.equalsEpsilon(c,u,0,M.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let d,p;if(t=e._rectangle,f){d=VMe(e,s);let g=re.fromRectangle3D(t,n,c,LMe),m=re.fromRectangle3D(t,n,u,BMe);p=re.union(g,m)}else{if(d=Gte(e,s),d.attributes.position.values=si.scaleToGeodeticHeight(d.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let g=d.attributes.position.values.length,m=e._offsetAttribute===nn.NONE?0:1,x=new Uint8Array(g/3).fill(m);d.attributes.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}p=re.fromRectangle3D(t,n,c)}return o.position||delete d.attributes.position,new ot({attributes:d.attributes,indices:d.indices,primitiveType:d.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Fh.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new Fh({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:r,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:o,vertexFormat:Pe.POSITION_ONLY,shadowVolume:!0})};var Nte=new he,GMe=[new W,new W,new W],WMe=new Ri,jMe=new me;function qMe(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=he.clone(e._rectangle,Nte),n=e._granularity,i=e._ellipsoid,r=e._rotation-e._stRotation,o=WG(t,n,r,i,Nte),s=GMe;s[0].x=o.west,s[0].y=o.south,s[1].x=o.west,s[1].y=o.north,s[2].x=o.east,s[2].y=o.south;let a=e.rectangle,c=Ri.fromRotation(e._stRotation,WMe),u=he.center(a,jMe);for(let m=0;m<3;++m){let x=s[m];x.x-=u.longitude,x.y-=u.latitude,Ri.multiplyByVector(c,x,x),x.x+=u.longitude,x.y+=u.latitude,x.x=(x.x-a.west)/a.width,x.y=(x.y-a.south)/a.height}let f=s[0],d=s[1],p=s[2],g=new Array(6);return W.pack(f,g),W.pack(d,g,2),W.pack(p,g,4),g}Object.defineProperties(Fh.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=WG(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=qMe(this)),this._textureCoordinateRotationPoints}}});var aT=Fh;var YMe=new re,XMe=new re,KMe=new h,$Me=new he;function Yte(e,t){let n=e._ellipsoid,i=t.height,r=t.width,o=t.northCap,s=t.southCap,a=i,c=2,u=0,f=4;o&&(c-=1,a-=1,u+=1,f-=2),s&&(c-=1,a-=1,u+=1,f-=2),u+=c*r+2*a-f;let d=new Float64Array(u*3),p=0,g=0,m,x=KMe;if(o)Ss.computePosition(t,n,!1,g,0,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;else for(m=0;m<r;m++)Ss.computePosition(t,n,!1,g,m,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;for(m=r-1,g=1;g<i;g++)Ss.computePosition(t,n,!1,g,m,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;if(g=i-1,!s)for(m=r-2;m>=0;m--)Ss.computePosition(t,n,!1,g,m,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;for(m=0,g=i-2;g>0;g--)Ss.computePosition(t,n,!1,g,m,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;let C=d.length/3*2,A=Le.createTypedArray(d.length/3,C),b=0;for(let S=0;S<d.length/3-1;S++)A[b++]=S,A[b++]=S+1;A[b++]=d.length/3-1,A[b++]=0;let T=new ot({attributes:new dn,primitiveType:Me.LINES});return T.attributes.position=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:d}),T.indices=A,T}function ZMe(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,r=e._ellipsoid,o=i,s=n,a=Yte(e,t),c=t.height,u=t.width,f=si.scaleToGeodeticHeight(a.attributes.position.values,s,r,!1),d=f.length,p=new Float64Array(d*2);p.set(f);let g=si.scaleToGeodeticHeight(a.attributes.position.values,o,r);p.set(g,d),a.attributes.position.values=p;let m=t.northCap,x=t.southCap,C=4;m&&(C-=1),x&&(C-=1);let A=(p.length/3+C)*2,b=Le.createTypedArray(p.length/3,A);d=p.length/6;let T=0;for(let w=0;w<d-1;w++)b[T++]=w,b[T++]=w+1,b[T++]=w+d,b[T++]=w+d+1;b[T++]=d-1,b[T++]=0,b[T++]=d+d-1,b[T++]=d,b[T++]=0,b[T++]=d;let S;if(m)S=c-1;else{let w=u-1;b[T++]=w,b[T++]=w+d,S=u+c-2}if(b[T++]=S,b[T++]=S+d,!x){let w=u+S-1;b[T++]=w,b[T]=w+d}return a.indices=b,a}function lT(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.granularity,M.RADIANS_PER_DEGREE),i=y(e.ellipsoid,oe.WGS84),r=y(e.rotation,0),o=y(e.height,0),s=y(e.extrudedHeight,o);this._rectangle=he.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(o,s),this._rotation=r,this._extrudedHeight=Math.min(o,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}lT.packedLength=he.packedLength+oe.packedLength+5;lT.pack=function(e,t,n){return n=y(n,0),he.pack(e._rectangle,t,n),n+=he.packedLength,oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=y(e._offsetAttribute,-1),t};var Xte=new he,Kte=oe.clone(oe.UNIT_SPHERE),cT={rectangle:Xte,ellipsoid:Kte,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};lT.unpack=function(e,t,n){t=y(t,0);let i=he.unpack(e,t,Xte);t+=he.packedLength;let r=oe.unpack(e,t,Kte);t+=oe.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t];return l(n)?(n._rectangle=he.clone(i,n._rectangle),n._ellipsoid=oe.clone(r,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=u===-1?void 0:u,n):(cT.granularity=o,cT.height=s,cT.rotation=a,cT.extrudedHeight=c,cT.offsetAttribute=u===-1?void 0:u,new lT(cT))};var JMe=new me;lT.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Ss.computeOptions(t,e._granularity,e._rotation,0,$Me,JMe),r,o;if(M.equalsEpsilon(t.north,t.south,M.EPSILON10)||M.equalsEpsilon(t.east,t.west,M.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!M.equalsEpsilon(s,a,0,M.EPSILON2),u;if(c){if(r=ZMe(e,i),l(e._offsetAttribute)){let p=r.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===nn.TOP?g=g.fill(1,0,p/2):(u=e._offsetAttribute===nn.NONE?0:1,g=g.fill(u)),r.attributes.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let f=re.fromRectangle3D(t,n,s,XMe),d=re.fromRectangle3D(t,n,a,YMe);o=re.union(f,d)}else{if(r=Yte(e,i),r.attributes.position.values=si.scaleToGeodeticHeight(r.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let f=r.attributes.position.values.length;u=e._offsetAttribute===nn.NONE?0:1;let d=new Uint8Array(f/3).fill(u);r.attributes.applyOffset=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}o=re.fromRectangle3D(t,n,s)}return new ot({attributes:r.attributes,indices:r.indices,primitiveType:Me.LINES,boundingSphere:o,offsetAttribute:e._offsetAttribute})};var uT=lT;var QMe={FIXED:0,INERTIAL:1},sr=Object.freeze(QMe);var Uy;typeof requestAnimationFrame<"u"&&(Uy=requestAnimationFrame);(function(){if(!l(Uy)&&typeof window<"u"){let e=["webkit","moz","ms","o"],t=0,n=e.length;for(;t<n&&!l(Uy);)Uy=window[`${e[t]}RequestAnimationFrame`],++t}if(!l(Uy)){let e=16.666666666666668,t=0;Uy=function(n){let i=Bi(),r=Math.max(e-(i-t),0);return t=i+r,setTimeout(function(){n(t)},r)}}})();function eBe(e){return di("Cesium.requestAnimationFrame","Cesium.requestAnimationFrame was deprecated in CesiumJS 1.96 and will be removed in 1.99. Use the native requestAnimationFrame method instead."),Uy(e)}var $te=eBe;function tBe(e){let t=document.createElement("canvas");return t.width=M.nextPowerOfTwo(e.width),t.height=M.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var zy=tBe;var Hy=30,nBe=1<<Hy,iBe=1<<Hy+1>>>0,jG=2*Hy+1,Q_=4,Qte=[],ene=[],rBe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],eg=1,fT=2,HO=[eg,0,0,eg|fT];function Ko(e){if(!Et.supportsBigInt())throw new fe("S2 required BigInt support");this._cellId=e,this._level=Ko.getLevel(e)}Ko.fromToken=function(e){return new Ko(Ko.getIdFromToken(e))};Ko.isValidId=function(e){return!(e<=0||e>>BigInt(jG)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};Ko.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?Ko.isValidId(Ko.getIdFromToken(e)):!1};Ko.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};Ko.getTokenFromId=function(e){let t=Math.floor(mBe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};Ko.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return Hy-(t>>1)};Ko.prototype.getChild=function(e){let t=ine(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Ko(n)};Ko.prototype.getParent=function(){let e=ine(this._cellId)<<BigInt(2);return new Ko(this._cellId&~e+BigInt(1)|e)};Ko.prototype.getParentAtLevel=function(e){let t=dBe(e);return new Ko(this._cellId&-t|t)};Ko.prototype.getCenter=function(e){e=y(e,oe.WGS84);let t=oBe(this._cellId,this._level);t=h.normalize(t,t);let n=new me.fromCartesian(t,oe.UNIT_SPHERE);return me.toCartesian(n,e,new h)};Ko.prototype.getVertex=function(e,t){t=y(t,oe.WGS84);let n=sBe(this._cellId,this._level,e);n=h.normalize(n,n);let i=new me.fromCartesian(n,oe.UNIT_SPHERE);return me.toCartesian(i,t,new h)};Ko.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),r=t.toString(2),o=Array(2*n-r.length+1).join("0"),s=Array(jG-2*n).join("0"),a=BigInt(`0b${i}${o}${r}1${s}`);return new Ko(a)};function oBe(e,t){let n=aBe(e,t);return cBe(n[0],n[1],n[2])}function sBe(e,t,n){let i=tne(e,t),r=lBe([i[1],i[2]],t),o=n>>1&1;return nne(i[0],r[0][o^n&1],r[1][o])}function aBe(e,t){let n=tne(e),i=n[0],r=n[1],o=n[2],s=t===30,a=!s&&(BigInt(r)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,u=(r<<1)+c,f=(o<<1)+c;return[i,u,f]}function tne(e){Qte.length===0&&fBe();let t=Number(e>>BigInt(jG)),n=t&eg,i=(1<<Q_)-1,r=0,o=0;for(let s=7;s>=0;s--){let a=s===7?Hy-7*Q_:Q_,c=(1<<2*a)-1;n+=Number(e>>BigInt(s*2*Q_+1)&BigInt(c))<<2,n=ene[n];let u=s*Q_;r+=n>>Q_+2<<u,o+=(n>>2&i)<<u,n&=eg|fT}return[t,r,o]}function cBe(e,t,n){let i=Zte(t),r=Zte(n),o=GO(i),s=GO(r);return nne(e,o,s)}function nne(e,t,n){switch(e){case 0:return new h(1,t,n);case 1:return new h(-t,1,n);case 2:return new h(-t,-n,1);case 3:return new h(-1,-n,-t);case 4:return new h(n,-1,-t);default:return new h(n,t,-1)}}function GO(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Zte(e){return 1/iBe*e}function lBe(e,t){let n=[[],[]],i=uBe(t);for(let r=0;r<2;++r){let o=e[r]&-i,s=o+i;n[r][0]=GO(Jte(o)),n[r][1]=GO(Jte(s))}return n}function uBe(e){return 1<<Hy-e>>>0}function Jte(e){return 1/nBe*e}function tg(e,t,n,i,r,o){if(e===Q_){let s=(t<<Q_)+n;Qte[(s<<2)+i]=(r<<2)+o,ene[(r<<2)+i]=(s<<2)+o}else{e++,t<<=1,n<<=1,r<<=2;let s=rBe[o];tg(e,t+(s[0]>>1),n+(s[0]&1),i,r,o^HO[0]),tg(e,t+(s[1]>>1),n+(s[1]&1),i,r+1,o^HO[1]),tg(e,t+(s[2]>>1),n+(s[2]&1),i,r+2,o^HO[2]),tg(e,t+(s[3]>>1),n+(s[3]&1),i,r+3,o^HO[3])}}function fBe(){tg(0,0,0,0,0,0),tg(0,0,0,eg,0,eg),tg(0,0,0,fT,0,fT),tg(0,0,0,eg|fT,0,eg|fT)}function ine(e){return e&~e+BigInt(1)}function dBe(e){return BigInt(1)<<BigInt(2*(Hy-e))}var hBe=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function mBe(e){return hBe[(-e&e)%BigInt(67)]}var ng=Ko;function pBe(e,t,n){return e.readyPromise.then(function(){return yBe(e,t,n)})}function _Be(e,t){let n=e[0],i=n.terrainProvider.requestTileGeometry(n.x,n.y,n.level);if(!i)return!1;let r=i.then(xBe(n)).catch(CBe(n));return e.shift(),t.push(r),!0}function gBe(e){return new Promise(function(t){setTimeout(t,e)})}function qG(e,t){return e.length?_Be(e,t)?qG(e,t):gBe(100).then(()=>qG(e,t)):Promise.resolve()}function yBe(e,t,n){let i=e.tilingScheme,r,o=[],s={};for(r=0;r<n.length;++r){let c=i.positionToTileXY(n[r],t),u=c.toString();if(!s.hasOwnProperty(u)){let f={x:c.x,y:c.y,level:t,tilingScheme:i,terrainProvider:e,positions:[]};s[u]=f,o.push(f)}s[u].positions.push(n[r])}let a=[];return qG(o,a).then(function(){return Promise.all(a).then(function(){return n})})}function rne(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function xBe(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let r=!1;for(let o=0;o<t.length;++o){let s=t[o];if(!rne(s,i,n)){r=!0;break}}return r?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let o=0;o<t.length;++o){let s=t[o];rne(s,i,n)}}):Promise.resolve()}}function CBe(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var WO=pBe;var YG=new W;function one(e,t){return e.readyPromise.then(function(){let n=[],i=[],r=e.availability,o=[];for(let s=0;s<t.length;++s){let a=t[s],c=r.computeMaximumLevelAtPosition(a);if(i[s]=c,c===0){e.tilingScheme.positionToTileXY(a,1,YG);let f=e.loadTileDataAvailability(YG.x,YG.y,1);l(f)&&o.push(f)}let u=n[c];l(u)||(n[c]=u=[]),u.push(a)}return Promise.all(o).then(function(){return Promise.all(n.map(function(s,a){if(l(s))return WO(e,a,s)}))}).then(function(){let s=[];for(let a=0;a<t.length;++a){let c=t[a];r.computeMaximumLevelAtPosition(c)!==i[a]&&s.push(c)}if(s.length>0)return one(e,s)}).then(function(){return t})})}var dT=one;var ABe={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19},_n=Object.freeze(ABe);function ig(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let r=i.getBoundingClientRect();return n.x=t.clientX-r.left,n.y=t.clientY-r.top,n}function QG(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function Gy(e){if(e.shiftKey)return ha.SHIFT;if(e.ctrlKey)return ha.CTRL;if(e.altKey)return ha.ALT}var ms={LEFT:0,MIDDLE:1,RIGHT:2};function Hl(e,t,n,i){function r(o){i(e,o)}Et.isInternetExplorer()?n.addEventListener(t,r,!1):n.addEventListener(t,r,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,r,!1)})}function TBe(e){let t=e._element,n=l(t.disableRootEvents)?t:document;Et.supportsPointerEvents()?(Hl(e,"pointerdown",t,DBe),Hl(e,"pointerup",t,pne),Hl(e,"pointermove",t,PBe),Hl(e,"pointercancel",t,pne)):(Hl(e,"mousedown",t,_ne),Hl(e,"mouseup",n,gne),Hl(e,"mousemove",n,yne),Hl(e,"touchstart",t,wBe),Hl(e,"touchend",n,une),Hl(e,"touchmove",n,vBe),Hl(e,"touchcancel",n,une)),Hl(e,"dblclick",t,EBe);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Hl(e,i,t,SBe)}function bBe(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var sne={position:new W};function e6(e){e._lastSeenTouchEvent=Bi()}function t6(e){return Bi()-e._lastSeenTouchEvent>od.mouseEmulationIgnoreMilliseconds}function JG(e,t,n){let i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)<n}function _ne(e,t){if(!t6(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===ms.LEFT)i=_n.LEFT_DOWN;else if(n===ms.MIDDLE)i=_n.MIDDLE_DOWN;else if(n===ms.RIGHT)i=_n.RIGHT_DOWN;else return;let r=ig(e,t,e._primaryPosition);W.clone(r,e._primaryStartPosition),W.clone(r,e._primaryPreviousPosition);let o=Gy(t),s=e.getInputAction(i,o);l(s)&&(W.clone(r,sne.position),s(sne),t.preventDefault())}var ane={position:new W},cne={position:new W};function XG(e,t,n,i){let r=Gy(i),o=e.getInputAction(t,r),s=e.getInputAction(n,r);if(l(o)||l(s)){let a=ig(e,i,e._primaryPosition);if(l(o)&&(W.clone(a,ane.position),o(ane)),l(s)){let c=e._primaryStartPosition;JG(c,a,e._clickPixelTolerance)&&(W.clone(a,cne.position),s(cne))}}}function gne(e,t){if(!t6(e))return;let n=t.button;n!==ms.LEFT&&n!==ms.MIDDLE&&n!==ms.RIGHT||(e._buttonDown[ms.LEFT]&&(XG(e,_n.LEFT_UP,_n.LEFT_CLICK,t),e._buttonDown[ms.LEFT]=!1),e._buttonDown[ms.MIDDLE]&&(XG(e,_n.MIDDLE_UP,_n.MIDDLE_CLICK,t),e._buttonDown[ms.MIDDLE]=!1),e._buttonDown[ms.RIGHT]&&(XG(e,_n.RIGHT_UP,_n.RIGHT_CLICK,t),e._buttonDown[ms.RIGHT]=!1))}var KG={startPosition:new W,endPosition:new W};function yne(e,t){if(!t6(e))return;let n=Gy(t),i=ig(e,t,e._primaryPosition),r=e._primaryPreviousPosition,o=e.getInputAction(_n.MOUSE_MOVE,n);l(o)&&(W.clone(r,KG.startPosition),W.clone(i,KG.endPosition),o(KG)),W.clone(i,r),(e._buttonDown[ms.LEFT]||e._buttonDown[ms.MIDDLE]||e._buttonDown[ms.RIGHT])&&t.preventDefault()}var lne={position:new W};function EBe(e,t){let n=t.button,i;if(n===ms.LEFT)i=_n.LEFT_DOUBLE_CLICK;else return;let r=Gy(t),o=e.getInputAction(i,r);l(o)&&(ig(e,t,lne.position),o(lne))}function SBe(e,t){let n;if(l(t.deltaY)){let o=t.deltaMode;o===t.DOM_DELTA_PIXEL?n=-t.deltaY:o===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=Gy(t),r=e.getInputAction(_n.WHEEL,i);l(r)&&(r(n),t.preventDefault())}function wBe(e,t){e6(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i)o=n[i],s=o.identifier,a.set(s,ig(e,o,new W));jO(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.set(s,W.clone(a.get(s)))}function une(e,t){e6(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i)o=n[i],s=o.identifier,a.remove(s);jO(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.remove(s)}var fne={position:new W},$G={position1:new W,position2:new W},dne={position:new W},hne={position:new W},mne={position:new W};function jO(e,t){let n=Gy(t),i=e._positions,r=i.length,o,s,a=e._isPinching;if(r!==1&&e._buttonDown[ms.LEFT]){if(e._buttonDown[ms.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),o=e.getInputAction(_n.LEFT_UP,n),l(o)&&(W.clone(e._primaryPosition,dne.position),o(dne)),r===0&&!e._isTouchHolding&&(s=e.getInputAction(_n.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];JG(c,u,e._clickPixelTolerance)&&(W.clone(e._primaryPosition,hne.position),s(hne))}e._isTouchHolding=!1}if(r===0&&a&&(e._isPinching=!1,o=e.getInputAction(_n.PINCH_END,n),l(o)&&o()),r===1&&!a){let c=i.values[0];W.clone(c,e._primaryPosition),W.clone(c,e._primaryStartPosition),W.clone(c,e._primaryPreviousPosition),e._buttonDown[ms.LEFT]=!0,o=e.getInputAction(_n.LEFT_DOWN,n),l(o)&&(W.clone(c,fne.position),o(fne)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(_n.RIGHT_CLICK,n),l(s))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];JG(u,f,e._holdPixelTolerance)&&(W.clone(e._primaryPosition,mne.position),s(mne))}},od.touchHoldDelayMilliseconds),t.preventDefault()}r===2&&!a&&(e._isPinching=!0,o=e.getInputAction(_n.PINCH_START,n),l(o)&&(W.clone(i.values[0],$G.position1),W.clone(i.values[1],$G.position2),o($G),t.preventDefault()))}function vBe(e,t){e6(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i){o=n[i],s=o.identifier;let u=a.get(s);l(u)&&ig(e,o,u)}xne(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,W.clone(a.get(s),c.get(s))}var ZG={startPosition:new W,endPosition:new W},sw={distance:{startPosition:new W,endPosition:new W},angleAndHeight:{startPosition:new W,endPosition:new W}};function xne(e,t){let n=Gy(t),i=e._positions,r=e._previousPositions,o=i.length,s;if(o===1&&e._buttonDown[ms.LEFT]){let a=i.values[0];W.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(_n.MOUSE_MOVE,n),l(s)&&(W.clone(c,ZG.startPosition),W.clone(a,ZG.endPosition),s(ZG)),W.clone(a,c),t.preventDefault()}else if(o===2&&e._isPinching&&(s=e.getInputAction(_n.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],u=r.values[0],f=r.values[1],d=c.x-a.x,p=c.y-a.y,g=Math.sqrt(d*d+p*p)*.25,m=f.x-u.x,x=f.y-u.y,C=Math.sqrt(m*m+x*x)*.25,A=(c.y+a.y)*.125,b=(f.y+u.y)*.125,T=Math.atan2(p,d),S=Math.atan2(x,m);W.fromElements(0,C,sw.distance.startPosition),W.fromElements(0,g,sw.distance.endPosition),W.fromElements(S,b,sw.angleAndHeight.startPosition),W.fromElements(T,A,sw.angleAndHeight.endPosition),s(sw)}}function DBe(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,ig(e,t,new W)),jO(e,t),e._previousPositions.set(i,W.clone(n.get(i)))}else _ne(e,t)}function pne(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),jO(e,t),e._previousPositions.remove(i)}else gne(e,t)}function PBe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,r=n.get(i);if(!l(r))return;ig(e,t,r),xne(e,t);let o=e._previousPositions;W.clone(n.get(i),o.get(i))}else yne(e,t)}function od(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-od.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new W,this._primaryPosition=new W,this._primaryPreviousPosition=new W,this._positions=new xt,this._previousPositions=new xt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=y(e,document),TBe(this)}od.prototype.setInputAction=function(e,t,n){let i=QG(t,n);this._inputEvents[i]=e};od.prototype.getInputAction=function(e,t){let n=QG(e,t);return this._inputEvents[n]};od.prototype.removeInputAction=function(e,t){let n=QG(e,t);delete this._inputEvents[n]};od.prototype.isDestroyed=function(){return!1};od.prototype.destroy=function(){return bBe(this),ue(this)};od.mouseEmulationIgnoreMilliseconds=800;od.touchHoldDelayMilliseconds=1500;var Ku=od;function qO(e){e=y(e,!0),this.value=qO.toValue(e)}Object.defineProperties(qO.prototype,{componentDatatype:{get:function(){return K.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});qO.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var gn=qO;var n6={};function IBe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var OBe=32.184,RBe=2451545;function Vne(e,t){t=ee.addSeconds(e,OBe,t);let n=ee.totalDays(t)-RBe;return t=ee.addSeconds(t,IBe(n),t),t}var YO=new ee(2451545,0,Wn.TAI),MBe=1e3,$u=M.RADIANS_PER_DEGREE,Gl=M.RADIANS_PER_ARCSECOND,ma=14959787e4,Cne=new Q;function kne(e,t,n,i,r,o,s){n<0&&(n=-n,r+=M.PI);let a=e*(1-t),c=i-r,u=r,f=LBe(o-i,t),d=BBe(t,0);UBe(c,n,u,Cne);let p=a*(1+t),g=Math.cos(f),m=Math.sin(f),x=1+t*g,C=p/x;return l(s)?(s.x=C*g,s.y=C*m,s.z=0):s=new h(C*g,C*m,0),Q.multiplyByVector(Cne,s,s)}function BBe(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function LBe(e,t){let n=VBe(e,t);return kBe(n,t)}var NBe=50,FBe=M.EPSILON8;function VBe(e,t){let n=Math.floor(e/M.TWO_PI);e-=n*M.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),r=Number.MAX_VALUE,o;for(o=0;o<NBe&&Math.abs(r-i)>FBe;++o){r=i;let s=r-t*Math.sin(r)-e,a=1-t*Math.cos(r);i=r-s/a}return r=i+n*M.TWO_PI,r}function kBe(e,t){let n=Math.floor(e/M.TWO_PI);e-=n*M.TWO_PI;let i=Math.cos(e)-t,r=Math.sin(e)*Math.sqrt(1-t*t),o=Math.atan2(r,i);return o=M.zeroToTwoPi(o),e<0&&(o-=M.TWO_PI),o+=n*M.TWO_PI,o}function UBe(e,t,n,i){let r=Math.cos(e),o=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*r-u*o*s,i[1]=u*r+c*o*s,i[2]=o*a,i[3]=-c*o-u*r*s,i[4]=-u*o+c*r*s,i[5]=r*a,i[6]=u*a,i[7]=-c*a,i[8]=s):i=new Q(c*r-u*o*s,-c*o-u*r*s,u*a,u*r+c*o*s,-u*o+c*r*s,-c*a,o*a,r*a,s),i}var zBe=1.0000010178*ma,HBe=100.46645683*$u,GBe=129597742283429e-5*Gl,Ane=16002,Tne=21863,bne=32004,Ene=10931,Sne=14529,wne=16368,vne=15318,Dne=32794,WBe=64*1e-7*ma,jBe=-152*1e-7*ma,qBe=62*1e-7*ma,YBe=-8*1e-7*ma,XBe=32*1e-7*ma,KBe=-41*1e-7*ma,$Be=19*1e-7*ma,ZBe=-11*1e-7*ma,JBe=-150*1e-7*ma,QBe=-46*1e-7*ma,eLe=68*1e-7*ma,tLe=54*1e-7*ma,nLe=14*1e-7*ma,iLe=24*1e-7*ma,rLe=-28*1e-7*ma,oLe=22*1e-7*ma,Pne=10,Ine=16002,One=21863,Rne=10931,Mne=1473,Bne=32004,Lne=4387,Nne=73,sLe=-325*1e-7,aLe=-322*1e-7,cLe=-79*1e-7,lLe=232*1e-7,uLe=-52*1e-7,fLe=97*1e-7,dLe=55*1e-7,hLe=-41*1e-7,mLe=-105*1e-7,pLe=-137*1e-7,_Le=258*1e-7,gLe=35*1e-7,yLe=-116*1e-7,xLe=-88*1e-7,CLe=-112*1e-7,ALe=-80*1e-7,hT=new ee(0,0,Wn.TAI);function TLe(e,t){Vne(e,hT);let i=(hT.dayNumber-YO.dayNumber+(hT.secondsOfDay-YO.secondsOfDay)/Yn.SECONDS_PER_DAY)/(Yn.DAYS_PER_JULIAN_CENTURY*10),r=.3595362*i,o=zBe+WBe*Math.cos(Ane*r)+JBe*Math.sin(Ane*r)+jBe*Math.cos(Tne*r)+QBe*Math.sin(Tne*r)+qBe*Math.cos(bne*r)+eLe*Math.sin(bne*r)+YBe*Math.cos(Ene*r)+tLe*Math.sin(Ene*r)+XBe*Math.cos(Sne*r)+nLe*Math.sin(Sne*r)+KBe*Math.cos(wne*r)+iLe*Math.sin(wne*r)+$Be*Math.cos(vne*r)+rLe*Math.sin(vne*r)+ZBe*Math.cos(Dne*r)+oLe*Math.sin(Dne*r),s=HBe+GBe*i+sLe*Math.cos(Pne*r)+mLe*Math.sin(Pne*r)+aLe*Math.cos(Ine*r)+pLe*Math.sin(Ine*r)+cLe*Math.cos(One*r)+_Le*Math.sin(One*r)+lLe*Math.cos(Rne*r)+gLe*Math.sin(Rne*r)+uLe*Math.cos(Mne*r)+yLe*Math.sin(Mne*r)+fLe*Math.cos(Bne*r)+xLe*Math.sin(Bne*r)+dLe*Math.cos(Lne*r)+CLe*Math.sin(Lne*r)+hLe*Math.cos(Nne*r)+ALe*Math.sin(Nne*r),a=.0167086342-.0004203654*i,c=102.93734808*$u+11612.3529*Gl*i,u=469.97289*Gl*i,f=174.87317577*$u-8679.27034*Gl*i;return kne(o,a,u,c,f,s,t)}function Une(e,t){Vne(e,hT);let i=(hT.dayNumber-YO.dayNumber+(hT.secondsOfDay-YO.secondsOfDay)/Yn.SECONDS_PER_DAY)/Yn.DAYS_PER_JULIAN_CENTURY,r=i*i,o=r*i,s=o*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*$u,f=-8e-5*i+.02966*r-42e-6*o-13e-8*s,d=83.35324312*$u,p=146434202669e-4*i-38.2702*r-.045047*o+21301e-8*s,g=125.04455501*$u,m=-69679193631e-4*i+6.3602*r+.007625*o-3586e-8*s,x=218.31664563*$u,C=17325593434847e-4*i-6.391*r+.006588*o-3169e-8*s,A=297.85019547*$u+Gl*(1602961601209e-3*i-6.3706*r+.006593*o-3169e-8*s),b=93.27209062*$u+Gl*(17395272628478e-4*i-12.7512*r-.001037*o+417e-8*s),T=134.96340251*$u+Gl*(17179159232178e-4*i+31.8792*r+.051635*o-2447e-7*s),S=357.52910918*$u+Gl*(1295965810481e-4*i-.5532*r+136e-6*o-1149e-8*s),w=310.17137918*$u-Gl*(6967051436e-3*i+6.2068*r+.007618*o-3219e-8*s),D=2*A,I=4*A,O=6*A,B=2*T,L=3*T,_=4*T,E=2*b;a+=3400.4*Math.cos(D)-635.6*Math.cos(D-T)-235.6*Math.cos(T)+218.1*Math.cos(D-S)+181*Math.cos(D+T),c+=.014216*Math.cos(D-T)+.008551*Math.cos(D-B)-.001383*Math.cos(T)+.001356*Math.cos(D+T)-.001147*Math.cos(I-L)-914e-6*Math.cos(I-B)+869e-6*Math.cos(D-S-T)-627e-6*Math.cos(D)-394e-6*Math.cos(I-_)+282e-6*Math.cos(D-S-B)-279e-6*Math.cos(A-T)-236e-6*Math.cos(B)+231e-6*Math.cos(I)+229e-6*Math.cos(O-_)-201e-6*Math.cos(B-E),f+=486.26*Math.cos(D-E)-40.13*Math.cos(D)+37.51*Math.cos(E)+25.73*Math.cos(B-E)+19.97*Math.cos(D-S-E),p+=-55609*Math.sin(D-T)-34711*Math.sin(D-B)-9792*Math.sin(T)+9385*Math.sin(I-L)+7505*Math.sin(I-B)+5318*Math.sin(D+T)+3484*Math.sin(I-_)-3417*Math.sin(D-S-T)-2530*Math.sin(O-_)-2376*Math.sin(D)-2075*Math.sin(D-L)-1883*Math.sin(B)-1736*Math.sin(O-5*T)+1626*Math.sin(S)-1370*Math.sin(O-L),m+=-5392*Math.sin(D-E)-540*Math.sin(S)-441*Math.sin(D)+423*Math.sin(E)-288*Math.sin(B-E),C+=-3332.9*Math.sin(D)+1197.4*Math.sin(D-T)-662.5*Math.sin(S)+396.3*Math.sin(T)-218*Math.sin(D-S);let v=2*w,P=3*w;f+=46.997*Math.cos(w)*i-.614*Math.cos(D-E+w)*i+.614*Math.cos(D-E-w)*i-.0297*Math.cos(v)*r-.0335*Math.cos(w)*r+.0012*Math.cos(D-E+v)*r-16e-5*Math.cos(w)*o+4e-5*Math.cos(P)*o+4e-5*Math.cos(v)*o;let R=2.116*Math.sin(w)*i-.111*Math.sin(D-E-w)*i-.0015*Math.sin(w)*r;p+=R,C+=R,m+=-520.77*Math.sin(w)*i+13.66*Math.sin(D-E+w)*i+1.12*Math.sin(D-w)*i-1.06*Math.sin(E-w)*i+.66*Math.sin(v)*r+.371*Math.sin(w)*r-.035*Math.sin(D-E+v)*r-.015*Math.sin(D-E+w)*r+.0014*Math.sin(w)*o-.0011*Math.sin(P)*o-9e-4*Math.sin(v)*o,a*=MBe;let F=u+f*Gl,U=d+p*Gl,k=x+C*Gl,H=g+m*Gl;return kne(a,c,F,U,H,k,t)}var Fne=.012300034,bLe=Fne/(Fne+1)*-1;function ELe(e,t){return t=Une(e,t),h.multiplyByScalar(t,bLe,t)}var zne=new Q(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),aw=new h;n6.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=ee.now()),l(t)||(t=new h),aw=TLe(e,aw),t=h.negate(aw,t),ELe(e,aw),h.subtract(t,aw,t),Q.multiplyByVector(zne,t,t),t};n6.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=ee.now()),t=Une(e,t),Q.multiplyByVector(zne,t,t),t};var Wy=n6;function SLe(e,t,n,i,r,o,s){let a=Ni.numberOfPoints(e,t,r),c,u=n.red,f=n.green,d=n.blue,p=n.alpha,g=i.red,m=i.green,x=i.blue,C=i.alpha;if(z.equals(n,i)){for(c=0;c<a;c++)o[s++]=z.floatToByte(u),o[s++]=z.floatToByte(f),o[s++]=z.floatToByte(d),o[s++]=z.floatToByte(p);return s}let A=(g-u)/a,b=(m-f)/a,T=(x-d)/a,S=(C-p)/a,w=s;for(c=0;c<a;c++)o[w++]=z.floatToByte(u+c*A),o[w++]=z.floatToByte(f+c*b),o[w++]=z.floatToByte(d+c*T),o[w++]=z.floatToByte(p+c*S);return w}function cw(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=y(e.arcType,Kt.GEODESIC),this._granularity=y(e.granularity,M.RADIANS_PER_DEGREE),this._ellipsoid=y(e.ellipsoid,oe.WGS84),this._workerName="createSimplePolylineGeometry";let r=1+t.length*h.packedLength;r+=l(n)?1+n.length*z.packedLength:1,this.packedLength=r+oe.packedLength+3}cw.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._colors;for(o=l(s)?s.length:0,t[n++]=o,i=0;i<o;++i,n+=z.packedLength)z.pack(s[i],t,n);return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};cw.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=oe.unpack(e,t);t+=oe.packedLength;let c=e[t++]===1,u=e[t++],f=e[t];return l(n)?(n._positions=o,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=u,n._granularity=f,n):new cw({positions:o,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:u,granularity:f})};var XO=new Array(2),KO=new Array(2),wLe={positions:XO,height:KO,ellipsoid:void 0,minDistance:void 0,granularity:void 0};cw.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,r=e._arcType,o=e._granularity,s=e._ellipsoid,a=M.chordLength(o,s.maximumRadius),c=l(n)&&!i,u,f=t.length,d,p,g,m,x=0;if(r===Kt.GEODESIC||r===Kt.RHUMB){let S,w,D;r===Kt.GEODESIC?(S=M.chordLength(o,s.maximumRadius),w=Ni.numberOfPoints,D=Ni.generateArc):(S=o,w=Ni.numberOfPointsRhumbLine,D=Ni.generateRhumbArc);let I=Ni.extractHeights(t,s),O=wLe;if(r===Kt.GEODESIC?O.minDistance=a:O.granularity=o,O.ellipsoid=s,c){let B=0;for(u=0;u<f-1;u++)B+=w(t[u],t[u+1],S)+1;d=new Float64Array(B*3),g=new Uint8Array(B*4),O.positions=XO,O.height=KO;let L=0;for(u=0;u<f-1;++u){XO[0]=t[u],XO[1]=t[u+1],KO[0]=I[u],KO[1]=I[u+1];let _=D(O);if(l(n)){let E=_.length/3;m=n[u];for(let v=0;v<E;++v)g[L++]=z.floatToByte(m.red),g[L++]=z.floatToByte(m.green),g[L++]=z.floatToByte(m.blue),g[L++]=z.floatToByte(m.alpha)}d.set(_,x),x+=_.length}}else if(O.positions=t,O.height=I,d=new Float64Array(D(O)),l(n)){for(g=new Uint8Array(d.length/3*4),u=0;u<f-1;++u){let L=t[u],_=t[u+1],E=n[u],v=n[u+1];x=SLe(L,_,E,v,a,g,x)}let B=n[f-1];g[x++]=z.floatToByte(B.red),g[x++]=z.floatToByte(B.green),g[x++]=z.floatToByte(B.blue),g[x++]=z.floatToByte(B.alpha)}}else{p=c?f*2-2:f,d=new Float64Array(p*3),g=l(n)?new Uint8Array(p*4):void 0;let S=0,w=0;for(u=0;u<f;++u){let D=t[u];if(c&&u>0&&(h.pack(D,d,S),S+=3,m=n[u-1],g[w++]=z.floatToByte(m.red),g[w++]=z.floatToByte(m.green),g[w++]=z.floatToByte(m.blue),g[w++]=z.floatToByte(m.alpha)),c&&u===f-1)break;h.pack(D,d,S),S+=3,l(n)&&(m=n[u],g[w++]=z.floatToByte(m.red),g[w++]=z.floatToByte(m.green),g[w++]=z.floatToByte(m.blue),g[w++]=z.floatToByte(m.alpha))}}let C=new dn;C.position=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:d}),l(n)&&(C.color=new Ee({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=d.length/3;let A=(p-1)*2,b=Le.createTypedArray(p,A),T=0;for(u=0;u<p-1;++u)b[T++]=u,b[T++]=u+1;return new ot({attributes:C,indices:b,primitiveType:Me.LINES,boundingSphere:re.fromPoints(t)})};var Hne=cw;function mT(e){let t=y(e.radius,1),i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Us(i),this._workerName="createSphereGeometry"}mT.packedLength=Us.packedLength;mT.pack=function(e,t,n){return Us.pack(e._ellipsoidGeometry,t,n)};var vLe=new Us,rg={radius:void 0,radii:new h,vertexFormat:new Pe,stackPartitions:void 0,slicePartitions:void 0};mT.unpack=function(e,t,n){let i=Us.unpack(e,t,vLe);return rg.vertexFormat=Pe.clone(i._vertexFormat,rg.vertexFormat),rg.stackPartitions=i._stackPartitions,rg.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,rg.radii),n._ellipsoidGeometry=new Us(rg),n):(rg.radius=i._radii.x,new mT(rg))};mT.createGeometry=function(e){return Us.createGeometry(e._ellipsoidGeometry)};var Gne=mT;function pT(e){let t=y(e.radius,1),i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new zu(i),this._workerName="createSphereOutlineGeometry"}pT.packedLength=zu.packedLength;pT.pack=function(e,t,n){return zu.pack(e._ellipsoidGeometry,t,n)};var DLe=new zu,jy={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};pT.unpack=function(e,t,n){let i=zu.unpack(e,t,DLe);return jy.stackPartitions=i._stackPartitions,jy.slicePartitions=i._slicePartitions,jy.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,jy.radii),n._ellipsoidGeometry=new zu(jy),n):(jy.radius=i._radii.x,new pT(jy))};pT.createGeometry=function(e){return zu.createGeometry(e._ellipsoidGeometry)};var og=pT;function Ha(e,t,n){this.clock=y(e,0),this.cone=y(t,0),this.magnitude=y(n,1)}Ha.fromCartesian3=function(e,t){let n=e.x,i=e.y,r=e.z,o=n*n+i*i;return l(t)||(t=new Ha),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(o),r),t.magnitude=Math.sqrt(o+r*r),t};Ha.clone=function(e,t){if(!!l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new Ha(e.clock,e.cone,e.magnitude)};Ha.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new Ha(e.clock,e.cone,1)};Ha.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};Ha.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};Ha.prototype.equals=function(e){return Ha.equals(this,e)};Ha.prototype.clone=function(e){return Ha.clone(this,e)};Ha.prototype.equalsEpsilon=function(e,t){return Ha.equalsEpsilon(this,e,t)};Ha.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var $O=Ha;function _T(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=qi.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(_T.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});_T.prototype.findTimeInterval=qi.prototype.findTimeInterval;_T.prototype.wrapTime=qi.prototype.wrapTime;_T.prototype.clampTime=qi.prototype.clampTime;_T.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,r=this._pointType;return r===Number?n[i]:(l(t)||(t=new r),r.clone(n[i],t))};var ZO=_T;function PLe(e,t){let n=[],i=e.length,r=0;for(;r<i;){let o=Math.ceil((i-r)/t--);n.push(e.slice(r,r+o)),r+=o}return n}var JO=PLe;var ILe={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},pn=ILe;function sg(e){}Object.defineProperties(sg.prototype,{ellipsoid:{get:ye.throwInstantiationError},rectangle:{get:ye.throwInstantiationError},projection:{get:ye.throwInstantiationError}});sg.prototype.getNumberOfXTilesAtLevel=ye.throwInstantiationError;sg.prototype.getNumberOfYTilesAtLevel=ye.throwInstantiationError;sg.prototype.rectangleToNativeRectangle=ye.throwInstantiationError;sg.prototype.tileXYToNativeRectangle=ye.throwInstantiationError;sg.prototype.tileXYToRectangle=ye.throwInstantiationError;sg.prototype.positionToTileXY=ye.throwInstantiationError;var Wne=sg;function o6(e,t){return ee.compare(e.start,t.start)}function Bo(e){if(this._intervals=[],this._changedEvent=new ge,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Bo.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return e.length===0?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return e.length===0?!1:e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return t===0?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return t===0?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return this._intervals.length===0}}});Bo.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Bo))return!1;let n=this._intervals,i=e._intervals,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;o++)if(!Cn.equals(n[o],i[o],t))return!1;return!0};Bo.prototype.get=function(e){return this._intervals[e]};Bo.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Bo.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Bo.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Bo.prototype.contains=function(e){return this.indexOf(e)>=0};var i6=new Cn;Bo.prototype.indexOf=function(e){let t=this._intervals;i6.start=e,i6.stop=e;let n=ao(t,i6,o6);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&Cn.contains(t[n-1],e)?n-1:~n)};Bo.prototype.findInterval=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.start,n=e.stop,i=e.isStartIncluded,r=e.isStopIncluded,o=this._intervals;for(let s=0,a=o.length;s<a;s++){let c=o[s];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(r)||c.isStopIncluded===r))return o[s]}};Bo.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||ee.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=ao(n,e,o6);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let r;for(i>0&&(r=ee.compare(n[i-1].stop,e.start),(r>0||r===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(ee.greaterThan(e.stop,n[i-1].stop)?e=new Cn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Cn({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(r=ee.compare(n[i-1].stop,e.stop),(r>0||r===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Cn({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new Cn({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(r=ee.compare(e.stop,n[i].start),r>0||r===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Cn({start:e.start,stop:ee.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:ee.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Cn({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};Bo.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=ao(t,e,o6);n<0&&(n=~n);let i=!1;for(n>0&&(ee.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(ee.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new Cn({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new Cn({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new Cn({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&ee.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new Cn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Cn({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(ee.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new Cn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Bo.prototype.intersect=function(e,t,n){let i=new Bo,r=0,o=0,s=this._intervals,a=e._intervals;for(;r<s.length&&o<a.length;){let c=s[r],u=a[o];if(ee.lessThan(c.stop,u.start))++r;else if(ee.lessThan(u.stop,c.start))++o;else{if(l(n)||l(t)&&t(c.data,u.data)||!l(t)&&u.data===c.data){let f=Cn.intersect(c,u,new Cn,n);f.isEmpty||i.addInterval(f,t)}ee.lessThan(c.stop,u.stop)||c.stop.equals(u.stop)&&!c.isStopIncluded&&u.isStopIncluded?++r:++o}}return i};Bo.fromJulianDateArray=function(e,t){l(t)||(t=new Bo);let n=e.julianDates,i=n.length,r=e.dataCallback,o=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=y(e.leadingInterval,!1),c=y(e.trailingInterval,!1),u,f=0;a&&(++f,u=new Cn({start:ke.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!o}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u));for(let d=0;d<i-1;++d){let p=n[d],g=n[d+1];u=new Cn({start:p,stop:g,isStartIncluded:t.length===f?o:!0,isStopIncluded:d===i-2?s:!1}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u),p=g}return c&&(u=new Cn({start:n[i-1],stop:ke.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u)),t};var Ga=new y_,lw=[0,31,28,31,30,31,30,31,31,30,31,30,31];function r6(e,t,n){l(n)||(n=new ee),ee.toGregorianDate(e,Ga);let i=Ga.millisecond+t.millisecond,r=Ga.second+t.second,o=Ga.minute+t.minute,s=Ga.hour+t.hour,a=Ga.day+t.day,c=Ga.month+t.month,u=Ga.year+t.year;for(i>=1e3&&(r+=Math.floor(i/1e3),i=i%1e3),r>=60&&(o+=Math.floor(r/60),r=r%60),o>=60&&(s+=Math.floor(o/60),o=o%60),s>=24&&(a+=Math.floor(s/24),s=s%24),lw[2]=x_(u)?29:28;a>lw[c]||c>=13;)a>lw[c]&&(a-=lw[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),lw[2]=x_(u)?29:28;return Ga.millisecond=i,Ga.second=r,Ga.minute=o,Ga.hour=s,Ga.day=a,Ga.month=c,Ga.year=u,ee.fromGregorianDate(Ga,n)}var OLe=new ee,RLe=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function jne(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(RLe);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),ee.toGregorianDate(ee.fromIso8601(e,OLe),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var uw=new y_;Bo.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=ee.fromIso8601(n[0]),r=ee.fromIso8601(n[1]),o=[];if(!jne(n[2],uw))o.push(i,r);else{let s=ee.clone(i);for(o.push(s);ee.compare(s,r)<0;)s=r6(s,uw),ee.compare(r,s)<=0&&ee.clone(r,s),o.push(s)}return Bo.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Bo.fromIso8601DateArray=function(e,t){return Bo.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return ee.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Bo.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,r=y(e.relativeToPrevious,!1),o=[],s,a,c=i.length;for(let u=0;u<c;++u)(jne(i[u],uw)||u===0)&&(r&&l(a)?s=r6(a,uw):s=r6(n,uw),o.push(s),a=s);return Bo.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var $o=Bo;var MLe=new h(1,1,1),BLe=h.ZERO,LLe=Re.IDENTITY;function qne(e,t,n){this.translation=h.clone(y(e,BLe)),this.rotation=Re.clone(y(t,LLe)),this.scale=h.clone(y(n,MLe))}qne.prototype.equals=function(e){return this===e||l(e)&&h.equals(this.translation,e.translation)&&Re.equals(this.rotation,e.rotation)&&h.equals(this.scale,e.scale)};var sp=qne;function qy(e){e=y(e,y.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=y(e.epoch,ke.MINIMUM_VALUE),this.tolerance=y(e.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(qy.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(l(t)&&(this._clockSubscription(),this._clockSubscription=void 0),l(e)&&(this._clockSubscription=e.onTick.addEventListener(qy.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(l(t)&&t.removeEventListener("seeked",this._seekFunction,!1),l(e)&&(this._seeking=!1,this._seekFunction=NLe(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});qy.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,ue(this)};qy.prototype.isDestroyed=function(){return!1};qy.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};qy.prototype._onTick=function(e){let t=this._element;if(!l(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let r=e.currentTime,o=y(this.epoch,ke.MINIMUM_VALUE),s=ee.secondsDifference(r,o),a=t.duration,c,u=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let f=i?y(this.tolerance,1):.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function NLe(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var Yne=qy;function FLe(e,t){this.rectangle=e,this.maxLevel=t}function gT(e){e=y(e,y.EMPTY_OBJECT);let t=De.createIfNeeded(e.url);this._resource=t,this._errorEvent=new ge,this._ready=!1,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let n=e.credit;typeof n=="string"&&(n=new Gt(n)),this._credit=n,this._tilingScheme=void 0,this._rectangles=[];let i=this,r,o=y(e.ellipsoid,oe.WGS84);function s(u){let f=u.getElementsByTagName("SRS")[0].textContent;if(f==="EPSG:4326")i._tilingScheme=new Qi({ellipsoid:o});else return Promise.reject(new fe(`SRS ${f} is not supported.`));let d=u.getElementsByTagName("TileFormat")[0];i._heightmapWidth=parseInt(d.getAttribute("width"),10),i._heightmapHeight=parseInt(d.getAttribute("height"),10),i._levelZeroMaximumGeometricError=ns.getEstimatedLevelZeroGeometricErrorForAHeightmap(o,Math.min(i._heightmapWidth,i._heightmapHeight),i._tilingScheme.getNumberOfXTilesAtLevel(0));let p=u.getElementsByTagName("DataExtent");for(let g=0;g<p.length;++g){let m=p[g],x=M.toRadians(parseFloat(m.getAttribute("minx"))),C=M.toRadians(parseFloat(m.getAttribute("miny"))),A=M.toRadians(parseFloat(m.getAttribute("maxx"))),b=M.toRadians(parseFloat(m.getAttribute("maxy"))),T=parseInt(m.getAttribute("maxlevel"),10);i._rectangles.push(new FLe(new he(x,C,A,b),T))}return i._ready=!0,Promise.resolve(!0)}function a(u){let f=y(l(u)?u.message:void 0,`An error occurred while accessing ${i._resource.url}.`);return r=jn.reportError(r,i,i._errorEvent,f),r.retry?c():Promise.reject(new fe(f))}function c(){return i._resource.fetchXML().then(s).catch(a)}this._readyPromise=c()}Object.defineProperties(gT.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});gT.prototype.requestTileGeometry=function(e,t,n,i){let r=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${r-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new Fa({buffer:ch(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:VLe(a,e,t,n),structure:a._terrainDataStructure})})};gT.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var Xne=new he;function VLe(e,t,n,i){let r=e._tilingScheme,o=e._rectangles,s=r.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<o.length&&a!==15;++c){let u=o[c];if(u.maxLevel<=i)continue;let f=u.rectangle,d=he.intersection(f,s,Xne);l(d)&&(QO(r,f,t*2,n*2,i+1)&&(a|=4),QO(r,f,t*2+1,n*2,i+1)&&(a|=8),QO(r,f,t*2,n*2+1,i+1)&&(a|=1),QO(r,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function QO(e,t,n,i,r){let o=e.tileXYToRectangle(n,i,r);return l(he.intersection(o,t,Xne))}gT.prototype.getTileDataAvailable=function(e,t,n){};gT.prototype.loadTileDataAvailability=function(e,t,n){};var Kne=gT;var kLe={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033},$ne=Object.freeze(kLe);var Zne={};function ULe(e,t){return M.equalsEpsilon(e.latitude,t.latitude,M.EPSILON10)&&M.equalsEpsilon(e.longitude,t.longitude,M.EPSILON10)}var zLe=new me,HLe=new me;function GLe(e,t,n,i){t=vr(t,h.equalsEpsilon);let r=t.length;if(r<2)return;let o=l(i),s=l(n),a=new Array(r),c=new Array(r),u=new Array(r),f=t[0];a[0]=f;let d=e.cartesianToCartographic(f,zLe);s&&(d.height=n[0]),c[0]=d.height,o?u[0]=i[0]:u[0]=0;let p=c[0],g=u[0],m=p===g,x=1;for(let C=1;C<r;++C){let A=t[C],b=e.cartesianToCartographic(A,HLe);s&&(b.height=n[C]),m=m&&b.height===0,ULe(d,b)?d.height<b.height&&(c[x-1]=b.height):(a[x]=A,c[x]=b.height,o?u[x]=i[C]:u[x]=0,m=m&&c[x]===u[x],me.clone(b,d),++x)}if(!(m||x<2))return a.length=x,c.length=x,u.length=x,{positions:a,topHeights:c,bottomHeights:u}}var WLe=new Array(2),jLe=new Array(2),qLe={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};Zne.computePositions=function(e,t,n,i,r,o){let s=GLe(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,u,f,d=M.chordLength(r,e.maximumRadius),p=qLe;if(p.minDistance=d,p.ellipsoid=e,o){let g=0,m;for(m=0;m<a-1;m++)g+=Ni.numberOfPoints(t[m],t[m+1],d)+1;u=new Float64Array(g*3),f=new Float64Array(g*3);let x=WLe,C=jLe;p.positions=x,p.height=C;let A=0;for(m=0;m<a-1;m++){x[0]=t[m],x[1]=t[m+1],C[0]=n[m],C[1]=n[m+1];let b=Ni.generateArc(p);u.set(b,A),C[0]=i[m],C[1]=i[m+1],f.set(Ni.generateArc(p),A),A+=b.length}}else p.positions=t,p.height=n,u=new Float64Array(Ni.generateArc(p)),p.height=i,f=new Float64Array(Ni.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var yT=Zne;var s6=new h,eR=new h,YLe=new h,Jne=new h,XLe=new h,KLe=new h,$Le=new h;function Yy(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=y(e.vertexFormat,Pe.DEFAULT),o=y(e.granularity,M.RADIANS_PER_DEGREE),s=y(e.ellipsoid,oe.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Pe.clone(r),this._granularity=o,this._ellipsoid=oe.clone(s),this._workerName="createWallGeometry";let a=1+t.length*h.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+oe.packedLength+Pe.packedLength+1}Yy.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._minimumHeights;if(o=l(s)?s.length:0,t[n++]=o,l(s))for(i=0;i<o;++i)t[n++]=s[i];let a=e._maximumHeights;if(o=l(a)?a.length:0,t[n++]=o,l(a))for(i=0;i<o;++i)t[n++]=a[i];return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n]=e._granularity,t};var Qne=oe.clone(oe.UNIT_SPHERE),eie=new Pe,fw={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Qne,vertexFormat:eie,granularity:void 0};Yy.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s;if(r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];r=e[t++];let a;if(r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];let c=oe.unpack(e,t,Qne);t+=oe.packedLength;let u=Pe.unpack(e,t,eie);t+=Pe.packedLength;let f=e[t];return l(n)?(n._positions=o,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=oe.clone(c,n._ellipsoid),n._vertexFormat=Pe.clone(u,n._vertexFormat),n._granularity=f,n):(fw.positions=o,fw.minimumHeights=s,fw.maximumHeights=a,fw.granularity=f,new Yy(fw))};Yy.fromConstantHeights=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n,i,r=e.minimumHeight,o=e.maximumHeight,s=l(r),a=l(o);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=r),a&&(i[f]=o)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new Yy(c)};Yy.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._vertexFormat,o=e._granularity,s=e._ellipsoid,a=yT.computePositions(s,t,i,n,o,!0);if(!l(a))return;let c=a.bottomPositions,u=a.topPositions,f=a.numCorners,d=u.length,p=d*2,g=r.position?new Float64Array(p):void 0,m=r.normal?new Float32Array(p):void 0,x=r.tangent?new Float32Array(p):void 0,C=r.bitangent?new Float32Array(p):void 0,A=r.st?new Float32Array(p/3*2):void 0,b=0,T=0,S=0,w=0,D=0,I=$Le,O=KLe,B=XLe,L=!0;d/=3;let _,E=0,v=1/(d-f-1);for(_=0;_<d;++_){let k=_*3,H=h.fromArray(u,k,s6),V=h.fromArray(c,k,eR);if(r.position&&(g[b++]=V.x,g[b++]=V.y,g[b++]=V.z,g[b++]=H.x,g[b++]=H.y,g[b++]=H.z),r.st&&(A[D++]=E,A[D++]=0,A[D++]=E,A[D++]=1),r.normal||r.tangent||r.bitangent){let q=h.clone(h.ZERO,Jne),j=h.subtract(H,s.geodeticSurfaceNormal(H,eR),eR);if(_+1<d&&(q=h.fromArray(u,k+3,Jne)),L){let X=h.subtract(q,H,YLe),G=h.subtract(j,H,s6);I=h.normalize(h.cross(G,X,I),I),L=!1}h.equalsEpsilon(H,q,M.EPSILON10)?L=!0:(E+=v,r.tangent&&(O=h.normalize(h.subtract(q,H,O),O)),r.bitangent&&(B=h.normalize(h.cross(I,O,B),B))),r.normal&&(m[T++]=I.x,m[T++]=I.y,m[T++]=I.z,m[T++]=I.x,m[T++]=I.y,m[T++]=I.z),r.tangent&&(x[w++]=O.x,x[w++]=O.y,x[w++]=O.z,x[w++]=O.x,x[w++]=O.y,x[w++]=O.z),r.bitangent&&(C[S++]=B.x,C[S++]=B.y,C[S++]=B.z,C[S++]=B.x,C[S++]=B.y,C[S++]=B.z)}}let P=new dn;r.position&&(P.position=new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:g})),r.normal&&(P.normal=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:m})),r.tangent&&(P.tangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:x})),r.bitangent&&(P.bitangent=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:C})),r.st&&(P.st=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:A}));let R=p/3;p-=6*(f+1);let F=Le.createTypedArray(R,p),U=0;for(_=0;_<R-2;_+=2){let k=_,H=_+2,V=h.fromArray(g,k*3,s6),q=h.fromArray(g,H*3,eR);if(h.equalsEpsilon(V,q,M.EPSILON10))continue;let j=_+1,X=_+3;F[U++]=j,F[U++]=k,F[U++]=X,F[U++]=X,F[U++]=k,F[U++]=H}return new ot({attributes:P,indices:F,primitiveType:Me.TRIANGLES,boundingSphere:new re.fromVertices(g)})};var tR=Yy;var tie=new h,nie=new h;function Xy(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=y(e.granularity,M.RADIANS_PER_DEGREE),o=y(e.ellipsoid,oe.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=r,this._ellipsoid=oe.clone(o),this._workerName="createWallOutlineGeometry";let s=1+t.length*h.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+oe.packedLength+1}Xy.pack=function(e,t,n){n=y(n,0);let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._minimumHeights;if(o=l(s)?s.length:0,t[n++]=o,l(s))for(i=0;i<o;++i)t[n++]=s[i];let a=e._maximumHeights;if(o=l(a)?a.length:0,t[n++]=o,l(a))for(i=0;i<o;++i)t[n++]=a[i];return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,t[n]=e._granularity,t};var iie=oe.clone(oe.UNIT_SPHERE),dw={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:iie,granularity:void 0};Xy.unpack=function(e,t,n){t=y(t,0);let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s;if(r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];r=e[t++];let a;if(r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];let c=oe.unpack(e,t,iie);t+=oe.packedLength;let u=e[t];return l(n)?(n._positions=o,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=oe.clone(c,n._ellipsoid),n._granularity=u,n):(dw.positions=o,dw.minimumHeights=s,dw.maximumHeights=a,dw.granularity=u,new Xy(dw))};Xy.fromConstantHeights=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n,i,r=e.minimumHeight,o=e.maximumHeight,s=l(r),a=l(o);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=r),a&&(i[f]=o)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new Xy(c)};Xy.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._granularity,o=e._ellipsoid,s=yT.computePositions(o,t,i,n,r,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,u=c.length,f=u*2,d=new Float64Array(f),p=0;u/=3;let g;for(g=0;g<u;++g){let b=g*3,T=h.fromArray(c,b,tie),S=h.fromArray(a,b,nie);d[p++]=S.x,d[p++]=S.y,d[p++]=S.z,d[p++]=T.x,d[p++]=T.y,d[p++]=T.z}let m=new dn({position:new Ee({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:d})}),x=f/3;f=2*x-4+x;let C=Le.createTypedArray(x,f),A=0;for(g=0;g<x-2;g+=2){let b=g,T=g+2,S=h.fromArray(d,b*3,tie),w=h.fromArray(d,T*3,nie);if(h.equalsEpsilon(S,w,M.EPSILON10))continue;let D=g+1,I=g+3;C[A++]=D,C[A++]=b,C[A++]=D,C[A++]=I,C[A++]=b,C[A++]=T}return C[A++]=x-2,C[A++]=x-1,new ot({attributes:m,indices:C,primitiveType:Me.LINES,boundingSphere:new re.fromVertices(d)})};var nR=Xy;function ZLe(e){switch(e){case Z.FLOAT:return"float";case Z.FLOAT_VEC2:return"vec2";case Z.FLOAT_VEC3:return"vec3";case Z.FLOAT_VEC4:return"vec4";case Z.FLOAT_MAT2:return"mat2";case Z.FLOAT_MAT3:return"mat3";case Z.FLOAT_MAT4:return"mat4";case Z.SAMPLER_2D:return"sampler2D";case Z.BOOL:return"bool"}}var ag=ZLe;var a6={};function JLe(e){let t=Le.createTypedArray(e,e*2),n=e,i=0;for(let r=0;r<n;r+=3)t[i++]=r,t[i++]=r+1,t[i++]=r+1,t[i++]=r+2,t[i++]=r+2,t[i++]=r;return t}function QLe(e,t){let n=t.length,i=Le.createTypedArray(e,n*2),r=0;for(let o=0;o<n;o+=3){let s=t[o],a=t[o+1],c=t[o+2];i[r++]=s,i[r++]=a,i[r++]=a,i[r++]=c,i[r++]=c,i[r++]=s}return i}function eNe(e){let t=e-2,n=2+t*4,i=Le.createTypedArray(e,n),r=0;i[r++]=0,i[r++]=1;for(let o=0;o<t;o++)i[r++]=o+1,i[r++]=o+2,i[r++]=o+2,i[r++]=o;return i}function tNe(e,t){let i=t.length-2,r=2+i*4,o=Le.createTypedArray(e,r),s=0;o[s++]=t[0],o[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],u=t[a+1],f=t[a+2];o[s++]=u,o[s++]=f,o[s++]=f,o[s++]=c}return o}function nNe(e){let t=e-2,n=2+t*4,i=Le.createTypedArray(e,n),r=0;i[r++]=0,i[r++]=1;for(let o=0;o<t;o++)i[r++]=o+1,i[r++]=o+2,i[r++]=o+2,i[r++]=0;return i}function iNe(e,t){let i=t.length-2,r=2+i*4,o=Le.createTypedArray(e,r),s=0,a=t[0];o[s++]=a,o[s++]=t[1];for(let c=0;c<i;c++){let u=t[c+1],f=t[c+2];o[s++]=u,o[s++]=f,o[s++]=f,o[s++]=a}return o}a6.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Me.TRIANGLES)return i?QLe(t,n):JLe(t);if(e===Me.TRIANGLE_STRIP)return i?tNe(t,n):eNe(t);if(e===Me.TRIANGLE_FAN)return i?iNe(t,n):nNe(t)};a6.getWireframeIndicesCount=function(e,t){if(e===Me.TRIANGLES)return t*2;if(e===Me.TRIANGLE_STRIP||e===Me.TRIANGLE_FAN){let n=t-2;return 2+n*4}return t};var hw=a6;function rNe(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var iR=rNe;function cg(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new ge,this.setValue(e)}Object.defineProperties(cg.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});cg.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};cg.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",r=n&&typeof e.equals=="function";(!r||!e.equals(t))&&(this._hasClone=i,this._hasEquals=r,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};cg.prototype.equals=function(e){return this===e||e instanceof cg&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};cg.prototype.valueOf=function(){return this._value};cg.prototype.toString=function(){return String(this._value)};var Jn=cg;function oNe(e,t,n,i,r){return{configurable:i,get:function(){return this[t]},set:function(o){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),o!==void 0&&(!l(o)||!l(o.getValue))&&l(r)&&(o=r(o)),s!==o&&(this[t]=o,this._definitionChanged.raiseEvent(this,e,o,s)),l(o)&&l(o.definitionChanged)&&(this[n]=o.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,o,o)},this))}}}function sNe(e){return new Jn(e)}function aNe(e,t,n){return oNe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,y(t,!1),y(n,sNe))}var le=aNe;function mw(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(mw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),image:le("image"),scale:le("scale"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),color:le("color"),rotation:le("rotation"),alignedAxis:le("alignedAxis"),sizeInMeters:le("sizeInMeters"),width:le("width"),height:le("height"),scaleByDistance:le("scaleByDistance"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),imageSubRegion:le("imageSubRegion"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});mw.prototype.clone=function(e){return l(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e):new mw(this)};mw.prototype.merge=function(e){this.show=y(this._show,e.show),this.image=y(this._image,e.image),this.scale=y(this._scale,e.scale),this.pixelOffset=y(this._pixelOffset,e.pixelOffset),this.eyeOffset=y(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this._verticalOrigin,e.verticalOrigin),this.heightReference=y(this._heightReference,e.heightReference),this.color=y(this._color,e.color),this.rotation=y(this._rotation,e.rotation),this.alignedAxis=y(this._alignedAxis,e.alignedAxis),this.sizeInMeters=y(this._sizeInMeters,e.sizeInMeters),this.width=y(this._width,e.width),this.height=y(this._height,e.height),this.scaleByDistance=y(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=y(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=y(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this._disableDepthTestDistance,e.disableDepthTestDistance)};var Ec=mw;var cNe={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2},ze=Object.freeze(cNe);var lNe={CENTER:0,LEFT:1,RIGHT:-1},gi=Object.freeze(lNe);var uNe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},vn=Object.freeze(uNe);var fNe={DONE:0,PENDING:1,FAILED:2},st=Object.freeze(fNe);function sd(){ye.throwInstantiationError()}Object.defineProperties(sd.prototype,{isConstant:{get:ye.throwInstantiationError},definitionChanged:{get:ye.throwInstantiationError}});sd.prototype.getValue=ye.throwInstantiationError;sd.prototype.equals=ye.throwInstantiationError;sd.equals=function(e,t){return e===t||l(e)&&e.equals(t)};sd.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!sd.equals(e[i],t[i]))return!1;return!0};sd.isConstant=function(e){return!l(e)||e.isConstant};sd.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};sd.getValueOrDefault=function(e,t,n,i){return l(e)?y(e.getValue(t,i),n):n};sd.getValueOrClonedDefault=function(e,t,n,i){let r;return l(e)&&(r=e.getValue(t,i)),l(r)||(r=n.clone(r)),r};var Y=sd;var dNe=z.WHITE,hNe=h.ZERO,mNe=ze.NONE,pNe=W.ZERO,_Ne=1,gNe=0,yNe=h.ZERO,xNe=gi.CENTER,CNe=vn.CENTER,ANe=!1,TNe=new h,bNe=new z,ENe=new h,SNe=new W,wNe=new St,vNe=new St,DNe=new St,PNe=new je,INe=new Tt;function rie(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function lg(e,t){t.collectionChanged.addEventListener(lg.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new xt,this._onCollectionChanged(t,t.values,[],[])}lg.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._billboard,c,u=o.billboard,f=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),d;if(f&&(d=Y.getValueOrUndefined(s._position,e,TNe),c=Y.getValueOrUndefined(a._image,e),f=l(d)&&l(c)),!f){c6(o,s,n);continue}Y.isConstant(s._position)||(n._clusterDirty=!0),l(u)||(u=n.getBillboard(s),u.id=s,u.image=void 0,o.billboard=u),u.show=f,(!l(u.image)||o.textureValue!==c)&&(u.image=c,o.textureValue=c),u.position=d,u.color=Y.getValueOrDefault(a._color,e,dNe,bNe),u.eyeOffset=Y.getValueOrDefault(a._eyeOffset,e,hNe,ENe),u.heightReference=Y.getValueOrDefault(a._heightReference,e,mNe),u.pixelOffset=Y.getValueOrDefault(a._pixelOffset,e,pNe,SNe),u.scale=Y.getValueOrDefault(a._scale,e,_Ne),u.rotation=Y.getValueOrDefault(a._rotation,e,gNe),u.alignedAxis=Y.getValueOrDefault(a._alignedAxis,e,yNe),u.horizontalOrigin=Y.getValueOrDefault(a._horizontalOrigin,e,xNe),u.verticalOrigin=Y.getValueOrDefault(a._verticalOrigin,e,CNe),u.width=Y.getValueOrUndefined(a._width,e),u.height=Y.getValueOrUndefined(a._height,e),u.scaleByDistance=Y.getValueOrUndefined(a._scaleByDistance,e,wNe),u.translucencyByDistance=Y.getValueOrUndefined(a._translucencyByDistance,e,vNe),u.pixelOffsetScaleByDistance=Y.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,DNe),u.sizeInMeters=Y.getValueOrDefault(a._sizeInMeters,e,ANe),u.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e,INe),u.disableDepthTestDistance=Y.getValueOrUndefined(a._disableDepthTestDistance,e);let p=Y.getValueOrUndefined(a._imageSubRegion,e,PNe);l(p)&&u.setImageSubRegion(u._imageId,p)}return!0};lg.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return st.FAILED;let i=n.billboard;if(i.heightReference===ze.NONE)t.center=h.clone(i.position,t.center);else{if(!l(i._clampedPosition))return st.PENDING;t.center=h.clone(i._clampedPosition,t.center)}return t.radius=0,st.DONE};lg.prototype.isDestroyed=function(){return!1};lg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(lg.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return ue(this)};lg.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._billboard)&&l(o._position)&&s.set(o.id,new rie(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._billboard)&&l(o._position)?s.contains(o.id)||s.set(o.id,new rie(o)):(c6(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],c6(s.get(o.id),o,a),s.remove(o.id)};function c6(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var rR=lg;var oR=`varying vec3 v_positionEC;
- varying vec3 v_normalEC;
- varying vec3 v_tangentEC;
- varying vec3 v_bitangentEC;
- varying vec2 v_st;
- void main()
- {
- vec3 positionToEyeEC = -v_positionEC;
- mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);
- vec3 normalEC = normalize(v_normalEC);
- #ifdef FACE_FORWARD
- normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
- #endif
- czm_materialInput materialInput;
- materialInput.normalEC = normalEC;
- materialInput.tangentToEyeMatrix = tangentToEyeMatrix;
- materialInput.positionToEyeEC = positionToEyeEC;
- materialInput.st = v_st;
- czm_material material = czm_getMaterial(materialInput);
- #ifdef FLAT
- gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);
- #else
- gl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
- #endif
- }
- `;var sR=`attribute vec3 position3DHigh;
- attribute vec3 position3DLow;
- attribute vec3 normal;
- attribute vec3 tangent;
- attribute vec3 bitangent;
- attribute vec2 st;
- attribute float batchId;
- varying vec3 v_positionEC;
- varying vec3 v_normalEC;
- varying vec3 v_tangentEC;
- varying vec3 v_bitangentEC;
- varying vec2 v_st;
- void main()
- {
- vec4 p = czm_computePosition();
- v_positionEC = (czm_modelViewRelativeToEye * p).xyz;
- v_normalEC = czm_normal * normal;
- v_tangentEC = czm_normal * tangent;
- v_bitangentEC = czm_normal * bitangent;
- v_st = st;
- gl_Position = czm_modelViewProjectionRelativeToEye * p;
- }
- `;var aR=`varying vec3 v_positionEC;
- varying vec3 v_normalEC;
- void main()
- {
- vec3 positionToEyeEC = -v_positionEC;
- vec3 normalEC = normalize(v_normalEC);
- #ifdef FACE_FORWARD
- normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
- #endif
- czm_materialInput materialInput;
- materialInput.normalEC = normalEC;
- materialInput.positionToEyeEC = positionToEyeEC;
- czm_material material = czm_getMaterial(materialInput);
- #ifdef FLAT
- gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);
- #else
- gl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
- #endif
- }
- `;var cR=`attribute vec3 position3DHigh;
- attribute vec3 position3DLow;
- attribute vec3 normal;
- attribute float batchId;
- varying vec3 v_positionEC;
- varying vec3 v_normalEC;
- void main()
- {
- vec4 p = czm_computePosition();
- v_positionEC = (czm_modelViewRelativeToEye * p).xyz;
- v_normalEC = czm_normal * normal;
- gl_Position = czm_modelViewProjectionRelativeToEye * p;
- }
- `;var lR=`varying vec3 v_positionEC;
- varying vec3 v_normalEC;
- varying vec2 v_st;
- void main()
- {
- vec3 positionToEyeEC = -v_positionEC;
- vec3 normalEC = normalize(v_normalEC);
- #ifdef FACE_FORWARD
- normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
- #endif
- czm_materialInput materialInput;
- materialInput.normalEC = normalEC;
- materialInput.positionToEyeEC = positionToEyeEC;
- materialInput.st = v_st;
- czm_material material = czm_getMaterial(materialInput);
- #ifdef FLAT
- gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);
- #else
- gl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
- #endif
- }
- `;var uR=`attribute vec3 position3DHigh;
- attribute vec3 position3DLow;
- attribute vec3 normal;
- attribute vec2 st;
- attribute float batchId;
- varying vec3 v_positionEC;
- varying vec3 v_normalEC;
- varying vec2 v_st;
- void main()
- {
- vec4 p = czm_computePosition();
- v_positionEC = (czm_modelViewRelativeToEye * p).xyz;
- v_normalEC = czm_normal * normal;
- v_st = st;
- gl_Position = czm_modelViewProjectionRelativeToEye * p;
- }
- `;var ONe={ADD:Z.FUNC_ADD,SUBTRACT:Z.FUNC_SUBTRACT,REVERSE_SUBTRACT:Z.FUNC_REVERSE_SUBTRACT,MIN:Z.MIN,MAX:Z.MAX},Wa=Object.freeze(ONe);var RNe={ZERO:Z.ZERO,ONE:Z.ONE,SOURCE_COLOR:Z.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:Z.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:Z.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:Z.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:Z.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:Z.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:Z.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:Z.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:Z.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:Z.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:Z.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:Z.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:Z.SRC_ALPHA_SATURATE},Pr=Object.freeze(RNe);var MNe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Wa.ADD,equationAlpha:Wa.ADD,functionSourceRgb:Pr.SOURCE_ALPHA,functionSourceAlpha:Pr.ONE,functionDestinationRgb:Pr.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Pr.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Wa.ADD,equationAlpha:Wa.ADD,functionSourceRgb:Pr.ONE,functionSourceAlpha:Pr.ONE,functionDestinationRgb:Pr.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Pr.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Wa.ADD,equationAlpha:Wa.ADD,functionSourceRgb:Pr.SOURCE_ALPHA,functionSourceAlpha:Pr.ONE,functionDestinationRgb:Pr.ONE,functionDestinationAlpha:Pr.ONE})},hn=Object.freeze(MNe);var BNe={FRONT:Z.FRONT,BACK:Z.BACK,FRONT_AND_BACK:Z.FRONT_AND_BACK},Yi=Object.freeze(BNe);function xT(e){e=y(e,y.EMPTY_OBJECT),this.material=e.material,this.translucent=y(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=y(e.closed,!1)}Object.defineProperties(xT.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}});xT.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(`
- `)};xT.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};xT.prototype.getRenderState=function(){let e=this.isTranslucent(),t=$e(this.renderState,!1);return e?(t.depthMask=!1,t.blending=hn.ALPHA_BLEND):t.depthMask=!0,t};xT.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=hn.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:Yi.BACK}),l(n)&&(i=rt(n,i,!0)),i};var ar=xT;var Co={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(Co,{maximumCombinedTextureImageUnits:{get:function(){return Co._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Co._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Co._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Co._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Co._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Co._maximumTextureSize}},maximumVaryingVectors:{get:function(){return Co._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Co._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Co._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Co._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Co._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Co._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Co._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Co._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Co._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Co._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Co._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Co._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Co._maximumColorAttachments}},maximumSamples:{get:function(){return Co._maximumSamples}},highpFloatSupported:{get:function(){return Co._highpFloatSupported}},highpIntSupported:{get:function(){return Co._highpIntSupported}}});var Bt=Co;function fR(e,t,n,i,r,o,s,a,c,u,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=r,this._pixelFormat=o,this._size=a,this._preMultiplyAlpha=c,this._flipY=u,this._initialized=f}Object.defineProperties(fR.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});fR.prototype.copyFrom=function(e){let t=y(e.xOffset,0),n=y(e.yOffset,0),i=e.source,r=this._context._gl,o=this._textureTarget,s=this._targetFace;r.activeTexture(r.TEXTURE0),r.bindTexture(o,this._texture);let a=i.width,c=i.height,u=i.arrayBufferView,f=this._size,d=this._pixelFormat,p=this._internalFormat,g=this._pixelDatatype,m=this._preMultiplyAlpha,x=this._flipY,C=y(e.skipColorSpaceConversion,!1),A=4;l(u)&&(A=ct.alignmentInBytes(d,g,a)),r.pixelStorei(r.UNPACK_ALIGNMENT,A),C?r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.NONE):r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.BROWSER_DEFAULT_WEBGL);let b=!1;if(!this._initialized){if(t===0&&n===0&&a===f&&c===f)l(u)?(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),x&&(u=ct.flipY(u,d,g,f,f)),r.texImage2D(s,0,p,f,f,0,d,qe.toWebGLConstant(g,this._context),u)):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,m),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,x),r.texImage2D(s,0,p,d,qe.toWebGLConstant(g,this._context),i)),b=!0;else{r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);let T=ct.createTypedArray(d,g,f,f);r.texImage2D(s,0,p,f,f,0,d,qe.toWebGLConstant(g,this._context),T)}this._initialized=!0}b||(l(u)?(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),x&&(u=ct.flipY(u,d,g,a,c)),r.texSubImage2D(s,0,t,n,a,c,d,qe.toWebGLConstant(g,this._context),u)):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,m),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,x),r.texSubImage2D(s,0,t,n,d,qe.toWebGLConstant(g,this._context),i))),r.bindTexture(o,null)};fR.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),r=y(r,this._size),o=y(o,this._size);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,r,o),s.bindTexture(a,null),this._initialized=!0};var ap=fR;var dR={DONT_CARE:Z.DONT_CARE,FASTEST:Z.FASTEST,NICEST:Z.NICEST,validate:function(e){return e===dR.DONT_CARE||e===dR.FASTEST||e===dR.NICEST}},cp=Object.freeze(dR);var hR={NEAREST:Z.NEAREST,LINEAR:Z.LINEAR};hR.validate=function(e){return e===hR.NEAREST||e===hR.LINEAR};var Xi=Object.freeze(hR);var ug={NEAREST:Z.NEAREST,LINEAR:Z.LINEAR,NEAREST_MIPMAP_NEAREST:Z.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:Z.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:Z.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:Z.LINEAR_MIPMAP_LINEAR};ug.validate=function(e){return e===ug.NEAREST||e===ug.LINEAR||e===ug.NEAREST_MIPMAP_NEAREST||e===ug.LINEAR_MIPMAP_NEAREST||e===ug.NEAREST_MIPMAP_LINEAR||e===ug.LINEAR_MIPMAP_LINEAR};var It=Object.freeze(ug);var mR={CLAMP_TO_EDGE:Z.CLAMP_TO_EDGE,REPEAT:Z.REPEAT,MIRRORED_REPEAT:Z.MIRRORED_REPEAT,validate:function(e){return e===mR.CLAMP_TO_EDGE||e===mR.REPEAT||e===mR.MIRRORED_REPEAT}},mn=Object.freeze(mR);function pw(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.wrapS,mn.CLAMP_TO_EDGE),n=y(e.wrapT,mn.CLAMP_TO_EDGE),i=y(e.minificationFilter,It.LINEAR),r=y(e.magnificationFilter,Xi.LINEAR),o=l(e.maximumAnisotropy)?e.maximumAnisotropy:1;this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=r,this._maximumAnisotropy=o}Object.defineProperties(pw.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});pw.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};pw.NEAREST=Object.freeze(new pw({wrapS:mn.CLAMP_TO_EDGE,wrapT:mn.CLAMP_TO_EDGE,minificationFilter:It.NEAREST,magnificationFilter:Xi.NEAREST}));var on=pw;function _w(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=e.source,i,r;if(l(n)){let b=[n.positiveX,n.negativeX,n.positiveY,n.negativeY,n.positiveZ,n.negativeZ];i=b[0].width,r=b[0].height}else i=e.width,r=e.height;let o=i,s=y(e.pixelDatatype,qe.UNSIGNED_BYTE),a=y(e.pixelFormat,ct.RGBA),c=ct.toInternalFormat(a,s,t),u=ct.textureSizeInBytes(a,s,o,o)*6,f=e.preMultiplyAlpha||a===ct.RGB||a===ct.LUMINANCE,d=y(e.flipY,!0),p=y(e.skipColorSpaceConversion,!1),g=t._gl,m=g.TEXTURE_CUBE_MAP,x=g.createTexture();g.activeTexture(g.TEXTURE0),g.bindTexture(m,x);function C(b,T,S,w,D){let I=T.arrayBufferView;l(I)||(I=T.bufferView);let O=4;l(I)&&(O=ct.alignmentInBytes(a,s,i)),g.pixelStorei(g.UNPACK_ALIGNMENT,O),D?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),l(I)?(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!1),w&&(I=ct.flipY(I,a,s,o,o)),g.texImage2D(b,0,c,o,o,0,a,qe.toWebGLConstant(s,t),I)):(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,S),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,w),g.texImage2D(b,0,c,a,qe.toWebGLConstant(s,t),T))}l(n)?(C(g.TEXTURE_CUBE_MAP_POSITIVE_X,n.positiveX,f,d,p),C(g.TEXTURE_CUBE_MAP_NEGATIVE_X,n.negativeX,f,d,p),C(g.TEXTURE_CUBE_MAP_POSITIVE_Y,n.positiveY,f,d,p),C(g.TEXTURE_CUBE_MAP_NEGATIVE_Y,n.negativeY,f,d,p),C(g.TEXTURE_CUBE_MAP_POSITIVE_Z,n.positiveZ,f,d,p),C(g.TEXTURE_CUBE_MAP_NEGATIVE_Z,n.negativeZ,f,d,p)):(g.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_X,0,c,o,o,0,a,qe.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_NEGATIVE_X,0,c,o,o,0,a,qe.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_Y,0,c,o,o,0,a,qe.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,c,o,o,0,a,qe.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_Z,0,c,o,o,0,a,qe.toWebGLConstant(s,t),null),g.texImage2D(g.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,c,o,o,0,a,qe.toWebGLConstant(s,t),null)),g.bindTexture(m,null),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=m,this._texture=x,this._pixelFormat=a,this._pixelDatatype=s,this._size=o,this._hasMipmap=!1,this._sizeInBytes=u,this._preMultiplyAlpha=f,this._flipY=d,this._sampler=void 0;let A=l(n);this._positiveX=new ap(t,x,m,g.TEXTURE_CUBE_MAP_POSITIVE_X,c,a,s,o,f,d,A),this._negativeX=new ap(t,x,m,g.TEXTURE_CUBE_MAP_NEGATIVE_X,c,a,s,o,f,d,A),this._positiveY=new ap(t,x,m,g.TEXTURE_CUBE_MAP_POSITIVE_Y,c,a,s,o,f,d,A),this._negativeY=new ap(t,x,m,g.TEXTURE_CUBE_MAP_NEGATIVE_Y,c,a,s,o,f,d,A),this._positiveZ=new ap(t,x,m,g.TEXTURE_CUBE_MAP_POSITIVE_Z,c,a,s,o,f,d,A),this._negativeZ=new ap(t,x,m,g.TEXTURE_CUBE_MAP_NEGATIVE_Z,c,a,s,o,f,d,A),this.sampler=l(e.sampler)?e.sampler:new on}Object.defineProperties(_w.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){let t=e.minificationFilter,n=e.magnificationFilter,i=t===It.NEAREST_MIPMAP_NEAREST||t===It.NEAREST_MIPMAP_LINEAR||t===It.LINEAR_MIPMAP_NEAREST||t===It.LINEAR_MIPMAP_LINEAR,r=this._context,o=this._pixelDatatype;(o===qe.FLOAT&&!r.textureFloatLinear||o===qe.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(t=i?It.NEAREST_MIPMAP_NEAREST:It.NEAREST,n=Xi.NEAREST);let s=r._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.texParameteri(a,s.TEXTURE_MIN_FILTER,t),s.texParameteri(a,s.TEXTURE_MAG_FILTER,n),s.texParameteri(a,s.TEXTURE_WRAP_S,e.wrapS),s.texParameteri(a,s.TEXTURE_WRAP_T,e.wrapT),l(this._textureFilterAnisotropic)&&s.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),s.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});_w.prototype.generateMipmap=function(e){e=y(e,cp.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};_w.prototype.isDestroyed=function(){return!1};_w.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=ue(this._positiveX),this._negativeX=ue(this._negativeX),this._positiveY=ue(this._positiveY),this._negativeY=ue(this._negativeY),this._positiveZ=ue(this._positiveZ),this._negativeZ=ue(this._negativeZ),ue(this)};var Sc=_w;function ad(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=e.width,i=e.height,r=e.source;l(r)&&(l(n)||(n=y(r.videoWidth,r.width)),l(i)||(i=y(r.videoHeight,r.height)));let o=y(e.pixelFormat,ct.RGBA),s=y(e.pixelDatatype,qe.UNSIGNED_BYTE),a=ct.toInternalFormat(o,s,t),c=ct.isCompressedFormat(a),u=e.preMultiplyAlpha||o===ct.RGB||o===ct.LUMINANCE,f=y(e.flipY,!0),d=y(e.skipColorSpaceConversion,!1),p=!0,g=t._gl,m=g.TEXTURE_2D,x=g.createTexture();g.activeTexture(g.TEXTURE0),g.bindTexture(m,x);let C=4;if(l(r)&&l(r.arrayBufferView)&&!c&&(C=ct.alignmentInBytes(o,s,n)),g.pixelStorei(g.UNPACK_ALIGNMENT,C),d?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),l(r))if(l(r.arrayBufferView)){g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!1);let b=r.arrayBufferView,T,S,w;if(c){if(g.compressedTexImage2D(m,0,a,n,i,0,b),l(r.mipLevels))for(S=n,w=i,T=0;T<r.mipLevels.length;++T)S=Math.floor(S/2)|0,S<1&&(S=1),w=Math.floor(w/2)|0,w<1&&(w=1),g.compressedTexImage2D(m,T+1,a,S,w,0,r.mipLevels[T])}else if(f&&(b=ct.flipY(b,o,s,n,i)),g.texImage2D(m,0,a,n,i,0,o,qe.toWebGLConstant(s,t),b),l(r.mipLevels))for(S=n,w=i,T=0;T<r.mipLevels.length;++T)S=Math.floor(S/2)|0,S<1&&(S=1),w=Math.floor(w/2)|0,w<1&&(w=1),g.texImage2D(m,T+1,a,S,w,0,o,qe.toWebGLConstant(s,t),r.mipLevels[T])}else l(r.framebuffer)?(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!1),r.framebuffer!==t.defaultFramebuffer&&r.framebuffer._bind(),g.copyTexImage2D(m,0,a,r.xOffset,r.yOffset,n,i,0),r.framebuffer!==t.defaultFramebuffer&&r.framebuffer._unBind()):(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,f),g.texImage2D(m,0,a,o,qe.toWebGLConstant(s,t),r));else g.texImage2D(m,0,a,n,i,0,o,qe.toWebGLConstant(s,t),null),p=!1;g.bindTexture(m,null);let A;c?A=ct.compressedTextureSizeInBytes(o,n,i):A=ct.textureSizeInBytes(o,s,n,i),this._id=Ln(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=m,this._texture=x,this._internalFormat=a,this._pixelFormat=o,this._pixelDatatype=s,this._width=n,this._height=i,this._dimensions=new W(n,i),this._hasMipmap=!1,this._sizeInBytes=A,this._preMultiplyAlpha=u,this._flipY=f,this._initialized=p,this._sampler=void 0,this.sampler=l(e.sampler)?e.sampler:new on}ad.create=function(e){return new ad(e)};ad.fromFramebuffer=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,i=y(e.pixelFormat,ct.RGB),r=y(e.framebufferXOffset,0),o=y(e.framebufferYOffset,0),s=y(e.width,n.drawingBufferWidth),a=y(e.height,n.drawingBufferHeight),c=e.framebuffer;return new ad({context:t,width:s,height:a,pixelFormat:i,source:{framebuffer:l(c)?c:t.defaultFramebuffer,xOffset:r,yOffset:o,width:s,height:a}})};Object.defineProperties(ad.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){let t=e.minificationFilter,n=e.magnificationFilter,i=this._context,r=this._pixelFormat,o=this._pixelDatatype,s=t===It.NEAREST_MIPMAP_NEAREST||t===It.NEAREST_MIPMAP_LINEAR||t===It.LINEAR_MIPMAP_NEAREST||t===It.LINEAR_MIPMAP_LINEAR;(o===qe.FLOAT&&!i.textureFloatLinear||o===qe.HALF_FLOAT&&!i.textureHalfFloatLinear)&&(t=s?It.NEAREST_MIPMAP_NEAREST:It.NEAREST,n=Xi.NEAREST),i.webgl2&&ct.isDepthFormat(r)&&(t=It.NEAREST,n=Xi.NEAREST);let a=i._gl,c=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture),a.texParameteri(c,a.TEXTURE_MIN_FILTER,t),a.texParameteri(c,a.TEXTURE_MAG_FILTER,n),a.texParameteri(c,a.TEXTURE_WRAP_S,e.wrapS),a.texParameteri(c,a.TEXTURE_WRAP_T,e.wrapT),l(this._textureFilterAnisotropic)&&a.texParameteri(c,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),a.bindTexture(c,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});ad.prototype.copyFrom=function(e){let t=y(e.xOffset,0),n=y(e.yOffset,0),i=e.source,r=this._context,o=r._gl,s=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(s,this._texture);let a=i.width,c=i.height,u=i.arrayBufferView,f=this._width,d=this._height,p=this._internalFormat,g=this._pixelFormat,m=this._pixelDatatype,x=this._preMultiplyAlpha,C=this._flipY,A=y(e.skipColorSpaceConversion,!1),b=4;l(u)&&(b=ct.alignmentInBytes(g,m,a)),o.pixelStorei(o.UNPACK_ALIGNMENT,b),A?o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,o.NONE):o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,o.BROWSER_DEFAULT_WEBGL);let T=!1;if(!this._initialized){if(t===0&&n===0&&a===f&&c===d)l(u)?(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),C&&(u=ct.flipY(u,g,m,f,d)),o.texImage2D(s,0,p,f,d,0,g,qe.toWebGLConstant(m,r),u)):(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,C),o.texImage2D(s,0,p,g,qe.toWebGLConstant(m,r),i)),T=!0;else{o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1);let S=ct.createTypedArray(g,m,f,d);o.texImage2D(s,0,p,f,d,0,g,qe.toWebGLConstant(m,r),S)}this._initialized=!0}T||(l(u)?(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),C&&(u=ct.flipY(u,g,m,a,c)),o.texSubImage2D(s,0,t,n,a,c,g,qe.toWebGLConstant(m,r),u)):(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,C),o.texSubImage2D(s,0,t,n,g,qe.toWebGLConstant(m,r),i))),o.bindTexture(s,null)};ad.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),r=y(r,this._width),o=y(o,this._height);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(a,0,e,t,n,i,r,o),s.bindTexture(a,null),this._initialized=!0};ad.prototype.generateMipmap=function(e){e=y(e,cp.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};ad.prototype.isDestroyed=function(){return!1};ad.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ue(this)};var wt=ad;var pR=`uniform sampler2D image;
- czm_material czm_getMaterial(czm_materialInput materialInput)
- {
- czm_material material = czm_getDefaultMaterial(materialInput);
- vec4 rampColor = texture2D(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5));
- rampColor = czm_gammaCorrect(rampColor);
- material.diffuse = rampColor.rgb;
- material.alpha = rampColor.a;
- return material;
- }
- `;var _R=`uniform sampler2D image;
- uniform float strength;
- uniform vec2 repeat;
- czm_material czm_getMaterial(czm_materialInput materialInput)
- {
- czm_material material = czm_getDefaultMaterial(materialInput);
- vec2 st = materialInput.st;
- vec2 centerPixel = fract(repeat * st);
- float centerBump = texture2D(image, centerPixel).channel;
- float imageWidth = float(imageDimensions.x);
- vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));
- float rightBump = texture2D(image, rightPixel).channel;
- float imageHeight = float(imageDimensions.y);
- vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));
- float topBump = texture2D(image, leftPixel).channel;
- vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));
- vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;
- material.normal = normalEC;
- material.diffuse = vec3(0.01);
- return material;
- }
- `;var gR=`uniform vec4 lightColor;
- uniform vec4 darkColor;
- uniform vec2 repeat;
- czm_material czm_getMaterial(czm_materialInput materialInput)
- {
- czm_material material = czm_getDefaultMaterial(materialInput);
- vec2 st = materialInput.st;
- float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);
- float scaledWidth = fract(repeat.s * st.s);
- scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));
- float scaledHeight = fract(repeat.t * st.t);
- scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));
- float value = min(scaledWidth, scaledHeight);
- vec4 currentColor = mix(lightColor, darkColor, b);
- vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);
- color = czm_gammaCorrect(color);
- material.diffuse = color.rgb;
- material.alpha = color.a;
- return material;
- }
- `;var yR=`uniform vec4 lightColor;
- uniform vec4 darkColor;
- uniform vec2 repeat;
- czm_material czm_getMaterial(czm_materialInput materialInput)
- {
- czm_material material = czm_getDefaultMaterial(materialInput);
- float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));
- vec4 color = mix(lightColor, darkColor, b);
- color = czm_gammaCorrect(color);
- material.diffuse = color.rgb;
- material.alpha = color.a;
- return material;
- }
- `;var xR=`uniform sampler2D heights;
- uniform sampler2D colors;
- float getHeight(int idx, float invTexSize)
- {
- vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5);
- #ifdef OES_texture_float
- return texture2D(heights, uv).x;
- #else
- return czm_unpackFloat(texture2D(heights, uv));
- #endif
- }
- czm_material czm_getMaterial(czm_materialInput materialInput)
- {
- czm_material material = czm_getDefaultMaterial(materialInput);
- float height = materialInput.height;
- float invTexSize = 1.0 / float(heightsDimensions.x);
- float minHeight = getHeight(0, invTexSize);
- float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize);
- if (height < minHeight || height > maxHeight) {
- material.diffuse = vec3(0.0);
- material.alpha = 0.0;
- return material;
- }
- int idxBelow = 0;
- int idxAbove = heightsDimensions.x;
- float heightBelow = minHeight;
- float heightAbove = maxHeight;
- const int maxIterations = 16;
- for (int i = 0; i < maxIterations; i++) {
- if (idxBelow >= idxAbove - 1) {
- break;
- }
- int idxMid = (idxBelow + idxAbove) / 2;
- float heightTex = getHeight(idxMid, invTexSize);
- if (height > heightTex) {
- idxBelow = idxMid;
- heightBelow = heightTex;
- } else {
- idxAbove = idxMid;
- heightAbove = heightTex;
- }
- }
- float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow);
- vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5);
- vec4 color = texture2D(colors, colorUv);
- if (color.a > 0.0)
- {
- color.rgb /= color.a;
- }
- color.rgb = czm_gammaCorrect(color.rgb);
- material.diffuse = color.rgb;
- material.alpha = color.a;
- return material;
- }
- `;var CR=`#ifdef GL_OES_standard_derivatives
- #extension GL_OES_standard_derivatives : enable
- #endif
- uniform vec4 color;
- uniform float spacing;
- uniform float width;
- czm_material czm_getMaterial(czm_materialInput materialInput)
- {
- czm_material material = czm_getDefaultMaterial(materialInput);
- float distanceToContour = mod(materialInput.height, spacing);
- #ifdef GL_OES_standard_derivatives
- float dxc = abs(dFdx(materialInput.height));
- float dyc = abs(dFdy(materialInput.height));
- float dF = max(dxc, dyc) * czm_pixelRatio * width;
- float alpha = (distanceToContour < dF) ? 1.0 : 0.0;
- #else
- float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0;
- #endif
- vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a));
- material.diffuse = outColor.rgb;
- material.alpha = outColor.a;
- return material;
- }
- `;var AR=`uniform sampler2D image;
- uniform float minimumHeight;
- uniform float maximumHeight;
- czm_material czm_getMaterial(czm_materialInput materialInput)
- {
- czm_material material = czm_getDefaultMaterial(materialInput);
- float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0);
- vec4 rampColor = texture2D(image, vec2(scaledHeight, 0.5));
- rampColor = czm_gammaCorrect(rampColor);
- material.diffuse = rampColor.rgb;
- material.alpha = rampColor.a;
- return material;
- }
- `;var TR=`uniform vec4 fadeInColor;
- uniform vec4 fadeOutColor;
- uniform float maximumDistance;
- uniform bool repeat;
- uniform vec2 fadeDirection;
- uniform vec2 time;
- float getTime(float t, float coord)
- {
- float scalar = 1.0 / maximumDistance;
- float q = distance(t, coord) * scalar;
- if (repeat)
- {
- float r = distance(t, coord + 1.0) * scalar;
- float s = distance(t, coord - 1.0) * scalar;
- q = min(min(r, s), q);
- }
- return clamp(q, 0.0, 1.0);
- }
- czm_material czm_getMaterial(czm_materialInput materialInput)
- {
- czm_material material = czm_getDefaultMaterial(materialInput);
- vec2 st = materialInput.st;
- float s = getTime(time.x, st.s) * fadeDirection.s;
- float t = getTime(time.y, st.t) * fadeDirection.t;
- float u = length(vec2(s, t));
- vec4 color = mix(fadeInColor, fadeOutColor, u);
- color = czm_gammaCorrect(color);
- material.emission = color.rgb;
- material.alpha = color.a;
- return material;
- }
- `;var bR=`#ifdef GL_OES_standard_derivatives
- #extension GL_OES_standard_derivatives : enable
- #endif
- uniform vec4 color;
- uniform float cellAlpha;
- uniform vec2 lineCount;
- uniform vec2 lineThickness;
- uniform vec2 lineOffset;
- czm_material czm_getMaterial(czm_materialInput materialInput)
- {
- czm_material material = czm_getDefaultMaterial(materialInput);
- vec2 st = materialInput.st;
- float scaledWidth = fract(lineCount.s * st.s - lineOffset.s);
- scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));
- float scaledHeight = fract(lineCount.t * st.t - lineOffset.t);
- scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));
- float value;
- #ifdef GL_OES_standard_derivatives
- const float fuzz = 1.2;
- vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0;
- vec2 dx = abs(dFdx(st));
- vec2 dy = abs(dFdy(st));
- vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;
- value = min(
- smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),
- smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));
- #else
- const float fuzz = 0.05;
- vec2 range = 0.5 - (lineThickness * 0.05);
- value = min(
- 1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),
- 1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));
- #endif
- float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));
- float sRim = smoothstep(0.8, 1.0, dRim);
- value *= (1.0 - sRim);
- vec4 halfColor;
- halfColor.rgb = color.rgb * 0.5;
- halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value));
- halfColor = czm_gammaCorrect(halfColor);
- material.diffuse = halfColor.rgb;
- material.emission = halfColor.rgb;
- material.alpha = halfColor.a;
- return material;
- }
- `;var ER=`uniform sampler2D image;
- uniform float strength;
- uniform vec2 repeat;
- czm_material czm_getMaterial(czm_materialInput materialInput)
- {
- czm_material material = czm_getDefaultMaterial(materialInput);
- vec4 textureValue = texture2D(image, fract(repeat * materialInput.st));
- vec3 normalTangentSpace = textureValue.channels;
- normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;
- normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);
- normalTangentSpace = normalize(normalTangentSpace);
- vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;
- material.normal = normalEC;
- return material;
- }
- `;var SR=`#ifdef GL_OES_standard_derivatives
- #extension GL_OES_standard_derivatives : enable
- #endif
- uniform vec4 color;
- float getPointOnLine(vec2 p0, vec2 p1, float x)
- {
- float slope = (p0.y - p1.y) / (p0.x - p1.x);
- return slope * (x - p0.x) + p0.y;
- }
- czm_material czm_getMaterial(czm_materialInput materialInput)
- {
- czm_material material = czm_getDefaultMaterial(materialInput);
- vec2 st = materialInput.st;
- #ifdef GL_OES_standard_derivatives
- float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio;
- #else
- float base = 0.975;
- #endif
- vec2 center = vec2(1.0, 0.5);
- float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);
- float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);
- float halfWidth = 0.15;
- float s = step(0.5 - halfWidth, st.t);
- s *= 1.0 - step(0.5 + halfWidth, st.t);
- s *= 1.0 - step(base, st.s);
- float t = step(base, materialInput.st.s);
- t *= 1.0 - step(ptOnUpperLine, st.t);
- t *= step(ptOnLowerLine, st.t);
- float dist;
- if (st.s < base)
- {
- float d1 = abs(st.t - (0.5 - halfWidth));
- float d2 = abs(st.t - (0.5 + halfWidth));
- dist = min(d1, d2);
- }
- else
- {
- float d1 = czm_infinity;
- if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)
- {
- d1 = abs(st.s - base);
- }
- float d2 = abs(st.t - ptOnUpperLine);
- float d3 = abs(st.t - ptOnLowerLine);
- dist = min(min(d1, d2), d3);
- }
- vec4 outsideColor = vec4(0.0);
- vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));
- vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);
- outColor = czm_gammaCorrect(outColor);
- material.diffuse = outColor.rgb;
- material.alpha = outColor.a;
- return material;
- }
- `;var wR=`uniform vec4 color;
- uniform vec4 gapColor;
- uniform float dashLength;
- uniform float dashPattern;
- varying float v_polylineAngle;
- const float maskLength = 16.0;
- mat2 rotate(float rad) {
- float c = cos(rad);
- float s = sin(rad);
- return mat2(
- c, s,
- -s, c
- );
- }
- czm_material czm_getMaterial(czm_materialInput materialInput)
- {
- czm_material material = czm_getDefaultMaterial(materialInput);
- vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy;
- float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio));
- float maskIndex = floor(dashPosition * maskLength);
- float maskTest = floor(dashPattern / pow(2.0, maskIndex));
- vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color;
- if (fragColor.a < 0.005) {
- discard;
- }
- fragColor = czm_gammaCorrect(fragColor);
- material.emission = fragColor.rgb;
- material.alpha = fragColor.a;
- return material;
- }
- `;var vR=`uniform vec4 color;
- uniform float glowPower;
- uniform float taperPower;
- czm_material czm_getMaterial(czm_materialInput materialInput)
- {
- czm_material material = czm_getDefaultMaterial(materialInput);
- vec2 st = materialInput.st;
- float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);
- if (taperPower <= 0.99999) {
- glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5));
- }
- vec4 fragColor;
- fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);
- fragColor.a = clamp(0.0, 1.0, glow) * color.a;
- fragColor = czm_gammaCorrect(fragColor);
- material.emission = fragColor.rgb;
- material.alpha = fragColor.a;
- return material;
- }
- `;var DR=`uniform vec4 color;
- uniform vec4 outlineColor;
- uniform float outlineWidth;
- varying float v_width;
- czm_material czm_getMaterial(czm_materialInput materialInput)
- {
- czm_material material = czm_getDefaultMaterial(materialInput);
- vec2 st = materialInput.st;
- float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;
- float b = step(0.5 - halfInteriorWidth, st.t);
- b *= 1.0 - step(0.5 + halfInteriorWidth, st.t);
- float d1 = abs(st.t - (0.5 - halfInteriorWidth));
- float d2 = abs(st.t - (0.5 + halfInteriorWidth));
- float dist = min(d1, d2);
- vec4 currentColor = mix(outlineColor, color, b);
- vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);
- outColor = czm_gammaCorrect(outColor);
- material.diffuse = outColor.rgb;
- material.alpha = outColor.a;
- return material;
- }
- `;var PR=`uniform vec4 color;
- uniform vec4 rimColor;
- uniform float width;
- czm_material czm_getMaterial(czm_materialInput materialInput)
- {
- czm_material material = czm_getDefaultMaterial(materialInput);
- float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));
- float s = smoothstep(1.0 - width, 1.0, d);
- vec4 outColor = czm_gammaCorrect(color);
- vec4 outRimColor = czm_gammaCorrect(rimColor);
- material.diffuse = outColor.rgb;
- material.emission = outRimColor.rgb * s;
- material.alpha = mix(outColor.a, outRimColor.a, s);
- return material;
- }
- `;var IR=`uniform sampler2D image;
- czm_material czm_getMaterial(czm_materialInput materialInput)
- {
- czm_material material = czm_getDefaultMaterial(materialInput);
- vec4 rampColor = texture2D(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5));
- rampColor = czm_gammaCorrect(rampColor);
- material.diffuse = rampColor.rgb;
- material.alpha = rampColor.a;
- return material;
- }
- `;var OR=`uniform vec4 evenColor;
- uniform vec4 oddColor;
- uniform float offset;
- uniform float repeat;
- uniform bool horizontal;
- czm_material czm_getMaterial(czm_materialInput materialInput)
- {
- czm_material material = czm_getDefaultMaterial(materialInput);
- float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));
- float value = fract((coord - offset) * (repeat * 0.5));
- float dist = min(value, min(abs(value - 0.5), 1.0 - value));
- vec4 currentColor = mix(evenColor, oddColor, step(0.5, value));
- vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);
- color = czm_gammaCorrect(color);
- material.diffuse = color.rgb;
- material.alpha = color.a;
- return material;
- }
- `;var RR=`uniform sampler2D specularMap;
- uniform sampler2D normalMap;
- uniform vec4 baseWaterColor;
- uniform vec4 blendColor;
- uniform float frequency;
- uniform float animationSpeed;
- uniform float amplitude;
- uniform float specularIntensity;
- uniform float fadeFactor;
- czm_material czm_getMaterial(czm_materialInput materialInput)
- {
- czm_material material = czm_getDefaultMaterial(materialInput);
- float time = czm_frameNumber * animationSpeed;
- float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);
- float specularMapValue = texture2D(specularMap, materialInput.st).r;
- vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);
- vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));
- normalTangentSpace.xy /= fade;
- normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);
- normalTangentSpace = normalize(normalTangentSpace);
- float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);
- material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue;
- material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);
- material.diffuse += (0.1 * tsPerturbationRatio);
- material.diffuse = material.diffuse;
- material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);
- material.specular = specularIntensity;
- material.shininess = 10.0;
- return material;
- }
- `;function Ge(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=y(e.minificationFilter,It.LINEAR),this._magnificationFilter=y(e.magnificationFilter,Xi.LINEAR),this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,LNe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(Ge._uniformList[this.type])||(Ge._uniformList[this.type]=Object.keys(this._uniforms))}Ge._uniformList={};Ge.fromType=function(e,t){let n=new Ge({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};Ge.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){let r=t[i];if(typeof r=="function"?e=e&&r():e=e&&r,!e)break}return e};Ge.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,r=i.length;for(t=0;t<r;++t){let c=i[t];n=c.id;let u=c.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(x){return x.bufferView}),u=u[0]);let d=new on({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(u.internalFormat)?p=new wt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:d}):p=new wt({context:e,source:u,sampler:d});let g=this._textures[n];l(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=p;let m=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(m)){let x=this.uniforms[m];x.x=p._width,x.y=p._height}}i.length=0;let o=this._loadedCubeMaps;for(r=o.length,t=0;t<r;++t){let c=o[t];n=c.id;let u=c.images,f=new Sc({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new on({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}o.length=0;let s=this._updateFunctions;for(r=s.length,t=0;t<r;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};Ge.prototype.isDestroyed=function(){return!1};Ge.prototype.destroy=function(){let e=this._textures;for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];i!==this._defaultTexture&&i.destroy()}let t=this.materials;for(let n in t)t.hasOwnProperty(n)&&t[n].destroy();return ue(this)};function LNe(e,t){e=y(e,y.EMPTY_OBJECT),t._strict=y(e.strict,!1),t._count=y(e.count,0),t._template=$e(y(e.fabric,y.EMPTY_OBJECT)),t._template.uniforms=$e(y(t._template.uniforms,y.EMPTY_OBJECT)),t._template.materials=$e(y(t._template.materials,y.EMPTY_OBJECT)),t.type=l(t._template.type)?t._template.type:Ln(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=Ge._materialCache.getMaterial(t.type);if(l(i)){let o=$e(i.fabric,!0);t._template=rt(t._template,o,!0),n=i.translucent}kNe(t),l(i)||Ge._materialCache.addMaterial(t.type,t),zNe(t),jNe(t),YNe(t);let r=t._translucentFunctions.length===0?!0:void 0;if(n=y(n,r),n=y(e.translucent,n),l(n))if(typeof n=="function"){let o=function(){return n(t)};t._translucentFunctions.push(o)}else t._translucentFunctions.push(n)}function l6(e,t,n,i){if(l(e)){for(let r in e)if(e.hasOwnProperty(r)){let o=t.indexOf(r)!==-1;(i&&!o||!i&&o)&&n(r,t)}}}function oie(e,t){}function NNe(e,t){}var FNe=["type","materials","uniforms","components","source"],VNe=["diffuse","specular","shininess","normal","emission","alpha"];function kNe(e){let t=e._template,n=t.uniforms,i=t.materials,r=t.components;l6(t,FNe,oie,!0),l6(r,VNe,oie,!0);let o=[];for(let s in i)i.hasOwnProperty(s)&&o.push(s);l6(n,o,NNe,!1)}function UNe(e,t){let n=t._template.materials;for(let i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function zNe(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n}
- `;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput)
- {
- `,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput);
- `,l(t)){let i=Object.keys(e._template.materials).length>0;for(let r in t)if(t.hasOwnProperty(r))if(r==="diffuse"||r==="emission"){let s=i&&UNe(t[r],e)?t[r]:`czm_gammaCorrect(${t[r]})`;e.shaderSource+=`material.${r} = ${s};
- `}else r==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha};
- `:e.shaderSource+=`material.${r} = ${t[r]};
- `}e.shaderSource+=`return material;
- }
- `}}var sie={mat2:Ri,mat3:Q,mat4:N},HNe=/\.ktx2$/i;function GNe(e){let t;return function(n,i){let r=n.uniforms,o=r[e],s=t!==o,a=!l(o)||o===Ge.DefaultImageId;t=o;let c=n._textures[e],u,f;if(o instanceof HTMLVideoElement){if(o.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let p=new on({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new wt({context:i,source:o,sampler:p}),n._textures[e]=c;return}c.copyFrom({source:o})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(o instanceof wt&&o!==c){n._texturePaths[e]=void 0;let p=n._textures[e];l(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=o,u=`${e}Dimensions`,r.hasOwnProperty(u)&&(f=r[u],f.x=o._width,f.y=o._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0),l(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,r.hasOwnProperty(u)&&(f=r[u],f.x=c._width,f.y=c._height)),a)return;let d=o instanceof De;if(!l(n._texturePaths[e])||d&&o.url!==n._texturePaths[e].url||!d&&o!==n._texturePaths[e]){if(typeof o=="string"||d){let p=d?o:De.createIfNeeded(o),g;HNe.test(p.url)?g=Ua(p.url):g=p.fetchImage(),Promise.resolve(g).then(function(m){n._loadedImages.push({id:e,image:m})}).catch(function(){l(c)&&c!==n._defaultTexture&&c.destroy(),n._textures[e]=n._defaultTexture})}else(o instanceof HTMLCanvasElement||o instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:o});n._texturePaths[e]=o}}}function WNe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof Sc){let o=t._textures[e];o!==t._defaultTexture&&o.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(l(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===Ge.DefaultCubeMapId)return;let r=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(r!==t._texturePaths[e]){let o=[De.createIfNeeded(i.positiveX).fetchImage(),De.createIfNeeded(i.negativeX).fetchImage(),De.createIfNeeded(i.positiveY).fetchImage(),De.createIfNeeded(i.negativeY).fetchImage(),De.createIfNeeded(i.positiveZ).fetchImage(),De.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(o).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=r}}}function jNe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&aie(e,n)}function aie(e,t){let n=e._strict,i=e._template.uniforms,r=i[t],o=qNe(r),s;if(o==="channels")s=gw(e,t,r,!1);else{if(o==="sampler2D"){let u=`${t}Dimensions`;XNe(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},aie(e,u))}if(!new RegExp(`uniform\\s+${o}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${o} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(s=gw(e,t,c),e.uniforms[t]=r,o==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(GNe(t));else if(o==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(WNe(t));else if(o.indexOf("mat")!==-1){let u=new sie[o];e._uniforms[c]=function(){return sie[o].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function qNe(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof De||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===Ge.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let r in e)e.hasOwnProperty(r)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function YNe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=new Ge({strict:t,fabric:n[i],count:e._count});e._count=r._count,e._uniforms=rt(e._uniforms,r._uniforms,!0),e.materials[i]=r,e._translucentFunctions=e._translucentFunctions.concat(r._translucentFunctions);let o="czm_getMaterial",s=`${o}_${e._count++}`;gw(r,o,s),e.shaderSource=r.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=gw(e,i,a)}}function gw(e,t,n,i){i=y(i,!0);let r=0,o="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+o,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,u,f){return u||f?c:(r+=1,n)}),r}function XNe(e,t,n){return gw(e,t,t,n)}Ge._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};Ge.DefaultImageId="czm_defaultImage";Ge.DefaultCubeMapId="czm_defaultCubeMap";Ge.ColorType="Color";Ge._materialCache.addMaterial(Ge.ColorType,{fabric:{type:Ge.ColorType,uniforms:{color:new z(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Ge.ImageType="Image";Ge._materialCache.addMaterial(Ge.ImageType,{fabric:{type:Ge.ImageType,uniforms:{image:Ge.DefaultImageId,repeat:new W(1,1),color:new z(1,1,1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture2D(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Ge.DiffuseMapType="DiffuseMap";Ge._materialCache.addMaterial(Ge.DiffuseMapType,{fabric:{type:Ge.DiffuseMapType,uniforms:{image:Ge.DefaultImageId,channels:"rgb",repeat:new W(1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Ge.AlphaMapType="AlphaMap";Ge._materialCache.addMaterial(Ge.AlphaMapType,{fabric:{type:Ge.AlphaMapType,uniforms:{image:Ge.DefaultImageId,channel:"a",repeat:new W(1,1)},components:{alpha:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});Ge.SpecularMapType="SpecularMap";Ge._materialCache.addMaterial(Ge.SpecularMapType,{fabric:{type:Ge.SpecularMapType,uniforms:{image:Ge.DefaultImageId,channel:"r",repeat:new W(1,1)},components:{specular:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});Ge.EmissionMapType="EmissionMap";Ge._materialCache.addMaterial(Ge.EmissionMapType,{fabric:{type:Ge.EmissionMapType,uniforms:{image:Ge.DefaultImageId,channels:"rgb",repeat:new W(1,1)},components:{emission:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Ge.BumpMapType="BumpMap";Ge._materialCache.addMaterial(Ge.BumpMapType,{fabric:{type:Ge.BumpMapType,uniforms:{image:Ge.DefaultImageId,channel:"r",strength:.8,repeat:new W(1,1)},source:_R},translucent:!1});Ge.NormalMapType="NormalMap";Ge._materialCache.addMaterial(Ge.NormalMapType,{fabric:{type:Ge.NormalMapType,uniforms:{image:Ge.DefaultImageId,channels:"rgb",strength:.8,repeat:new W(1,1)},source:ER},translucent:!1});Ge.GridType="Grid";Ge._materialCache.addMaterial(Ge.GridType,{fabric:{type:Ge.GridType,uniforms:{color:new z(0,1,0,1),cellAlpha:.1,lineCount:new W(8,8),lineThickness:new W(1,1),lineOffset:new W(0,0)},source:bR},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});Ge.StripeType="Stripe";Ge._materialCache.addMaterial(Ge.StripeType,{fabric:{type:Ge.StripeType,uniforms:{horizontal:!0,evenColor:new z(1,1,1,.5),oddColor:new z(0,0,1,.5),offset:0,repeat:5},source:OR},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});Ge.CheckerboardType="Checkerboard";Ge._materialCache.addMaterial(Ge.CheckerboardType,{fabric:{type:Ge.CheckerboardType,uniforms:{lightColor:new z(1,1,1,.5),darkColor:new z(0,0,0,.5),repeat:new W(5,5)},source:gR},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Ge.DotType="Dot";Ge._materialCache.addMaterial(Ge.DotType,{fabric:{type:Ge.DotType,uniforms:{lightColor:new z(1,1,0,.75),darkColor:new z(0,1,1,.75),repeat:new W(5,5)},source:yR},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Ge.WaterType="Water";Ge._materialCache.addMaterial(Ge.WaterType,{fabric:{type:Ge.WaterType,uniforms:{baseWaterColor:new z(.2,.3,.6,1),blendColor:new z(0,1,.699,1),specularMap:Ge.DefaultImageId,normalMap:Ge.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:RR},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});Ge.RimLightingType="RimLighting";Ge._materialCache.addMaterial(Ge.RimLightingType,{fabric:{type:Ge.RimLightingType,uniforms:{color:new z(1,0,0,.7),rimColor:new z(1,1,1,.4),width:.3},source:PR},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});Ge.FadeType="Fade";Ge._materialCache.addMaterial(Ge.FadeType,{fabric:{type:Ge.FadeType,uniforms:{fadeInColor:new z(1,0,0,1),fadeOutColor:new z(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new W(.5,.5)},source:TR},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});Ge.PolylineArrowType="PolylineArrow";Ge._materialCache.addMaterial(Ge.PolylineArrowType,{fabric:{type:Ge.PolylineArrowType,uniforms:{color:new z(1,1,1,1)},source:SR},translucent:!0});Ge.PolylineDashType="PolylineDash";Ge._materialCache.addMaterial(Ge.PolylineDashType,{fabric:{type:Ge.PolylineDashType,uniforms:{color:new z(1,0,1,1),gapColor:new z(0,0,0,0),dashLength:16,dashPattern:255},source:wR},translucent:!0});Ge.PolylineGlowType="PolylineGlow";Ge._materialCache.addMaterial(Ge.PolylineGlowType,{fabric:{type:Ge.PolylineGlowType,uniforms:{color:new z(0,.5,1,1),glowPower:.25,taperPower:1},source:vR},translucent:!0});Ge.PolylineOutlineType="PolylineOutline";Ge._materialCache.addMaterial(Ge.PolylineOutlineType,{fabric:{type:Ge.PolylineOutlineType,uniforms:{color:new z(1,1,1,1),outlineColor:new z(1,0,0,1),outlineWidth:1},source:DR},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});Ge.ElevationContourType="ElevationContour";Ge._materialCache.addMaterial(Ge.ElevationContourType,{fabric:{type:Ge.ElevationContourType,uniforms:{spacing:100,color:new z(1,0,0,1),width:1},source:CR},translucent:!1});Ge.ElevationRampType="ElevationRamp";Ge._materialCache.addMaterial(Ge.ElevationRampType,{fabric:{type:Ge.ElevationRampType,uniforms:{image:Ge.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:AR},translucent:!1});Ge.SlopeRampMaterialType="SlopeRamp";Ge._materialCache.addMaterial(Ge.SlopeRampMaterialType,{fabric:{type:Ge.SlopeRampMaterialType,uniforms:{image:Ge.DefaultImageId},source:IR},translucent:!1});Ge.AspectRampMaterialType="AspectRamp";Ge._materialCache.addMaterial(Ge.AspectRampMaterialType,{fabric:{type:Ge.AspectRampMaterialType,uniforms:{image:Ge.DefaultImageId},source:pR},translucent:!1});Ge.ElevationBandType="ElevationBand";Ge._materialCache.addMaterial(Ge.ElevationBandType,{fabric:{type:Ge.ElevationBandType,uniforms:{heights:Ge.DefaultImageId,colors:Ge.DefaultImageId},source:xR},translucent:!0});var cr=Ge;function Ky(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.materialSupport,Ky.MaterialSupport.TEXTURED);this.material=l(e.material)?e.material:cr.fromType(cr.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,i.vertexShaderSource),this._fragmentShaderSource=y(e.fragmentShaderSource,i.fragmentShaderSource),this._renderState=ar.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,!n)}Object.defineProperties(Ky.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});Ky.prototype.getFragmentShaderSource=ar.prototype.getFragmentShaderSource;Ky.prototype.isTranslucent=ar.prototype.isTranslucent;Ky.prototype.getRenderState=ar.prototype.getRenderState;Ky.MaterialSupport={BASIC:Object.freeze({vertexFormat:Pe.POSITION_AND_NORMAL,vertexShaderSource:cR,fragmentShaderSource:aR}),TEXTURED:Object.freeze({vertexFormat:Pe.POSITION_NORMAL_AND_ST,vertexShaderSource:uR,fragmentShaderSource:lR}),ALL:Object.freeze({vertexFormat:Pe.ALL,vertexShaderSource:sR,fragmentShaderSource:oR})};var lr=Ky;var MR=`varying vec3 v_positionEC;
- varying vec3 v_normalEC;
- varying vec4 v_color;
- void main()
- {
- vec3 positionToEyeEC = -v_positionEC;
- vec3 normalEC = normalize(v_normalEC);
- #ifdef FACE_FORWARD
- normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
- #endif
- vec4 color = czm_gammaCorrect(v_color);
- czm_materialInput materialInput;
- materialInput.normalEC = normalEC;
- materialInput.positionToEyeEC = positionToEyeEC;
- czm_material material = czm_getDefaultMaterial(materialInput);
- material.diffuse = color.rgb;
- material.alpha = color.a;
- gl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
- }
- `;var BR=`attribute vec3 position3DHigh;
- attribute vec3 position3DLow;
- attribute vec3 normal;
- attribute vec4 color;
- attribute float batchId;
- varying vec3 v_positionEC;
- varying vec3 v_normalEC;
- varying vec4 v_color;
- void main()
- {
- vec4 p = czm_computePosition();
- v_positionEC = (czm_modelViewRelativeToEye * p).xyz;
- v_normalEC = czm_normal * normal;
- v_color = color;
- gl_Position = czm_modelViewProjectionRelativeToEye * p;
- }
- `;var CT=`varying vec4 v_color;
- void main()
- {
- gl_FragColor = czm_gammaCorrect(v_color);
- }
- `;var LR=`attribute vec3 position3DHigh;
- attribute vec3 position3DLow;
- attribute vec4 color;
- attribute float batchId;
- varying vec4 v_color;
- void main()
- {
- vec4 p = czm_computePosition();
- v_color = color;
- gl_Position = czm_modelViewProjectionRelativeToEye * p;
- }
- `;function lp(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.flat,!1),r=i?LR:BR,o=i?CT:MR,s=i?lp.FLAT_VERTEX_FORMAT:lp.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,r),this._fragmentShaderSource=y(e.fragmentShaderSource,o),this._renderState=ar.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=y(e.faceForward,!n)}Object.defineProperties(lp.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});lp.VERTEX_FORMAT=Pe.POSITION_AND_NORMAL;lp.FLAT_VERTEX_FORMAT=Pe.POSITION_ONLY;lp.prototype.getFragmentShaderSource=ar.prototype.getFragmentShaderSource;lp.prototype.isTranslucent=ar.prototype.isTranslucent;lp.prototype.getRenderState=ar.prototype.getRenderState;var rn=lp;function AT(e){this._definitionChanged=new ge,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(AT.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});AT.prototype.getType=function(e){return"Color"};AT.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};AT.prototype.equals=function(e){return this===e||e instanceof AT&&Y.equals(this._color,e._color)};var Dt=AT;var Ao={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function yw(e){e=y(e,y.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=y(e.primitiveType,Me.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=y(e.offset,0),this._instanceCount=y(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._flags=0,this.cull=y(e.cull,!0),this.occlude=y(e.occlude,!0),this.executeInClosestFrustum=y(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.castShadows=y(e.castShadows,!1),this.receiveShadows=y(e.receiveShadows,!1),this.pickOnly=y(e.pickOnly,!1),this.depthForTranslucentClassification=y(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function ja(e,t){return(e._flags&t)===t}function fg(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(yw.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return ja(this,Ao.CULL)},set:function(e){ja(this,Ao.CULL)!==e&&(fg(this,Ao.CULL,e),this.dirty=!0)}},occlude:{get:function(){return ja(this,Ao.OCCLUDE)},set:function(e){ja(this,Ao.OCCLUDE)!==e&&(fg(this,Ao.OCCLUDE,e),this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return ja(this,Ao.CAST_SHADOWS)},set:function(e){ja(this,Ao.CAST_SHADOWS)!==e&&(fg(this,Ao.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return ja(this,Ao.RECEIVE_SHADOWS)},set:function(e){ja(this,Ao.RECEIVE_SHADOWS)!==e&&(fg(this,Ao.RECEIVE_SHADOWS,e),this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return ja(this,Ao.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){ja(this,Ao.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(fg(this,Ao.EXECUTE_IN_CLOSEST_FRUSTUM,e),this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return ja(this,Ao.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){ja(this,Ao.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(fg(this,Ao.DEBUG_SHOW_BOUNDING_VOLUME,e),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickOnly:{get:function(){return ja(this,Ao.PICK_ONLY)},set:function(e){ja(this,Ao.PICK_ONLY)!==e&&(fg(this,Ao.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return ja(this,Ao.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){ja(this,Ao.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(fg(this,Ao.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});yw.shallowClone=function(e,t){if(!!l(e))return l(t)||(t=new yw),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t};yw.prototype.execute=function(e,t){e.draw(this,t)};var Ze=yw;var KNe={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,OVERLAY:9,NUMBER_OF_PASSES:10},Ce=Object.freeze(KNe);function cie(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=cie(e[t]));return Object.freeze(e)}var lie=cie;function kh(e){let t=y(e,y.EMPTY_OBJECT),n=y(t.cull,y.EMPTY_OBJECT),i=y(t.polygonOffset,y.EMPTY_OBJECT),r=y(t.scissorTest,y.EMPTY_OBJECT),o=y(r.rectangle,y.EMPTY_OBJECT),s=y(t.depthRange,y.EMPTY_OBJECT),a=y(t.depthTest,y.EMPTY_OBJECT),c=y(t.colorMask,y.EMPTY_OBJECT),u=y(t.blending,y.EMPTY_OBJECT),f=y(u.color,y.EMPTY_OBJECT),d=y(t.stencilTest,y.EMPTY_OBJECT),p=y(d.frontOperation,y.EMPTY_OBJECT),g=y(d.backOperation,y.EMPTY_OBJECT),m=y(t.sampleCoverage,y.EMPTY_OBJECT),x=t.viewport;this.frontFace=y(t.frontFace,hs.COUNTER_CLOCKWISE),this.cull={enabled:y(n.enabled,!1),face:y(n.face,Z.BACK)},this.lineWidth=y(t.lineWidth,1),this.polygonOffset={enabled:y(i.enabled,!1),factor:y(i.factor,0),units:y(i.units,0)},this.scissorTest={enabled:y(r.enabled,!1),rectangle:je.clone(o)},this.depthRange={near:y(s.near,0),far:y(s.far,1)},this.depthTest={enabled:y(a.enabled,!1),func:y(a.func,Z.LESS)},this.colorMask={red:y(c.red,!0),green:y(c.green,!0),blue:y(c.blue,!0),alpha:y(c.alpha,!0)},this.depthMask=y(t.depthMask,!0),this.stencilMask=y(t.stencilMask,-1),this.blending={enabled:y(u.enabled,!1),color:new z(y(f.red,0),y(f.green,0),y(f.blue,0),y(f.alpha,0)),equationRgb:y(u.equationRgb,Z.FUNC_ADD),equationAlpha:y(u.equationAlpha,Z.FUNC_ADD),functionSourceRgb:y(u.functionSourceRgb,Z.ONE),functionSourceAlpha:y(u.functionSourceAlpha,Z.ONE),functionDestinationRgb:y(u.functionDestinationRgb,Z.ZERO),functionDestinationAlpha:y(u.functionDestinationAlpha,Z.ZERO)},this.stencilTest={enabled:y(d.enabled,!1),frontFunction:y(d.frontFunction,Z.ALWAYS),backFunction:y(d.backFunction,Z.ALWAYS),reference:y(d.reference,0),mask:y(d.mask,-1),frontOperation:{fail:y(p.fail,Z.KEEP),zFail:y(p.zFail,Z.KEEP),zPass:y(p.zPass,Z.KEEP)},backOperation:{fail:y(g.fail,Z.KEEP),zFail:y(g.zFail,Z.KEEP),zPass:y(g.zPass,Z.KEEP)}},this.sampleCoverage={enabled:y(m.enabled,!1),value:y(m.value,1),invert:y(m.invert,!1)},this.viewport=l(x)?new je(x.x,x.y,x.width,x.height):void 0,this.id=0,this._applyFunctions=[]}var $Ne=0,Vh={};kh.fromCache=function(e){let t=JSON.stringify(e),n=Vh[t];if(l(n))return++n.referenceCount,n.state;let i=new kh(e),r=JSON.stringify(i);return n=Vh[r],l(n)||(i.id=$Ne++,n={referenceCount:0,state:i},Vh[r]=n),++n.referenceCount,Vh[t]={referenceCount:1,state:n.state},n.state};kh.removeFromCache=function(e){let t=new kh(e),n=JSON.stringify(t),i=Vh[n],r=JSON.stringify(e),o=Vh[r];l(o)&&(--o.referenceCount,o.referenceCount===0&&(delete Vh[r],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete Vh[n]};kh.getCache=function(){return Vh};kh.clearCache=function(){Vh={}};function $y(e,t,n){n?e.enable(t):e.disable(t)}function uie(e,t){e.frontFace(t.frontFace)}function fie(e,t){let n=t.cull,i=n.enabled;$y(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function die(e,t){e.lineWidth(t.lineWidth)}function hie(e,t){let n=t.polygonOffset,i=n.enabled;$y(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function mie(e,t,n){let i=t.scissorTest,r=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if($y(e,e.SCISSOR_TEST,r),r){let o=l(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(o.x,o.y,o.width,o.height)}}function pie(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function _ie(e,t){let n=t.depthTest,i=n.enabled;$y(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function gie(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function yie(e,t){e.depthMask(t.depthMask)}function xie(e,t){e.stencilMask(t.stencilMask)}function ZNe(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function Cie(e,t,n){let i=t.blending,r=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;$y(e,e.BLEND,r),r&&(ZNe(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function Aie(e,t){let n=t.stencilTest,i=n.enabled;if($y(e,e.STENCIL_TEST,i),i){let r=n.frontFunction,o=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(r,s,a),e.stencilFuncSeparate(e.BACK,o,s,a),e.stencilFuncSeparate(e.FRONT,r,s,a);let c=n.frontOperation,u=c.fail,f=c.zFail,d=c.zPass;e.stencilOpSeparate(e.FRONT,u,f,d);let p=n.backOperation,g=p.fail,m=p.zFail,x=p.zPass;e.stencilOpSeparate(e.BACK,g,m,x)}}function Tie(e,t){let n=t.sampleCoverage,i=n.enabled;$y(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var JNe=new je;function bie(e,t,n){let i=y(t.viewport,n.viewport);l(i)||(i=JNe,i.width=n.context.drawingBufferWidth,i.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=i,e.viewport(i.x,i.y,i.width,i.height)}kh.apply=function(e,t,n){uie(e,t),fie(e,t),die(e,t),hie(e,t),pie(e,t),_ie(e,t),gie(e,t),yie(e,t),xie(e,t),Aie(e,t),Tie(e,t),mie(e,t,n),Cie(e,t,n),bie(e,t,n)};function QNe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(uie),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(fie),e.lineWidth!==t.lineWidth&&n.push(die),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(hie),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(pie),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(_ie),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&n.push(gie),e.depthMask!==t.depthMask&&n.push(yie),e.stencilMask!==t.stencilMask&&n.push(xie),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&n.push(Aie),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(Tie),n}kh.partialApply=function(e,t,n,i,r,o){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=QNe(t,n),n._applyFunctions[t.id]=f);let d=f.length;for(let p=0;p<d;++p)f[p](e,n)}let s=l(i.scissorTest)?i.scissorTest:t.scissorTest,a=l(r.scissorTest)?r.scissorTest:n.scissorTest;(s!==a||o)&&mie(e,n,r);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=l(r.blendingEnabled)?r.blendingEnabled:n.blending.enabled;(c!==u||u&&t.blending!==n.blending)&&Cie(e,n,r),(t!==n||i!==r||i.context!==r.context)&&bie(e,n,r)};kh.getState=function(e){return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:je.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:z.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:l(e.viewport)?je.clone(e.viewport):void 0}};var Ve=kh;var eFe=new h;function Nt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var zs={};zs[Z.FLOAT]="float";zs[Z.FLOAT_VEC2]="vec2";zs[Z.FLOAT_VEC3]="vec3";zs[Z.FLOAT_VEC4]="vec4";zs[Z.INT]="int";zs[Z.INT_VEC2]="ivec2";zs[Z.INT_VEC3]="ivec3";zs[Z.INT_VEC4]="ivec4";zs[Z.BOOL]="bool";zs[Z.BOOL_VEC2]="bvec2";zs[Z.BOOL_VEC3]="bvec3";zs[Z.BOOL_VEC4]="bvec4";zs[Z.FLOAT_MAT2]="mat2";zs[Z.FLOAT_MAT3]="mat3";zs[Z.FLOAT_MAT4]="mat4";zs[Z.SAMPLER_2D]="sampler2D";zs[Z.SAMPLER_CUBE]="samplerCube";Nt.prototype.getDeclaration=function(e){let t=`uniform ${zs[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var tFe={czm_viewport:new Nt({size:1,datatype:Z.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Nt({size:1,datatype:Z.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Nt({size:1,datatype:Z.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Nt({size:1,datatype:Z.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new Nt({size:1,datatype:Z.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Nt({size:1,datatype:Z.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Nt({size:1,datatype:Z.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Nt({size:1,datatype:Z.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Nt({size:1,datatype:Z.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Nt({size:1,datatype:Z.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Nt({size:1,datatype:Z.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Nt({size:1,datatype:Z.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Nt({size:1,datatype:Z.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Nt({size:1,datatype:Z.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Nt({size:1,datatype:Z.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Nt({size:1,datatype:Z.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Nt({size:1,datatype:Z.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Nt({size:1,datatype:Z.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Nt({size:1,datatype:Z.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Nt({size:1,datatype:Z.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Nt({size:1,datatype:Z.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Nt({size:1,datatype:Z.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Nt({size:1,datatype:Z.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Nt({size:1,datatype:Z.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Nt({size:1,datatype:Z.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Nt({size:1,datatype:Z.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Nt({size:1,datatype:Z.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Nt({size:1,datatype:Z.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Nt({size:1,datatype:Z.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Nt({size:1,datatype:Z.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Nt({size:1,datatype:Z.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Nt({size:1,datatype:Z.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Nt({size:1,datatype:Z.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Nt({size:1,datatype:Z.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new Nt({size:1,datatype:Z.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_entireFrustum:new Nt({size:1,datatype:Z.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Nt({size:1,datatype:Z.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Nt({size:1,datatype:Z.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Nt({size:1,datatype:Z.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Nt({size:1,datatype:Z.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Nt({size:1,datatype:Z.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Nt({size:1,datatype:Z.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Nt({size:1,datatype:Z.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Nt({size:1,datatype:Z.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Nt({size:1,datatype:Z.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Nt({size:1,datatype:Z.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Nt({size:1,datatype:Z.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Nt({size:1,datatype:Z.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Nt({size:1,datatype:Z.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Nt({size:1,datatype:Z.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Nt({size:1,datatype:Z.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Nt({size:1,datatype:Z.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Nt({size:1,datatype:Z.FLOAT_VEC3,getValue:function(e){return N.getTranslation(e.inverseView,eFe)}}),czm_frameNumber:new Nt({size:1,datatype:Z.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Nt({size:1,datatype:Z.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Nt({size:1,datatype:Z.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Nt({size:1,datatype:Z.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Nt({size:1,datatype:Z.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Nt({size:1,datatype:Z.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Nt({size:1,datatype:Z.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Nt({size:1,datatype:Z.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapSize:new Nt({size:1,datatype:Z.FLOAT_VEC2,getValue:function(e){return e.specularEnvironmentMapsDimensions}}),czm_specularEnvironmentMapsMaximumLOD:new Nt({size:1,datatype:Z.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Nt({size:9,datatype:Z.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Nt({size:1,datatype:Z.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Nt({size:1,datatype:Z.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Nt({size:1,datatype:Z.FLOAT,getValue:function(e){return e.fogDensity}}),czm_splitPosition:new Nt({size:1,datatype:Z.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Nt({size:1,datatype:Z.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Nt({size:1,datatype:Z.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Nt({size:1,datatype:Z.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Nt({size:1,datatype:Z.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Nt({size:1,datatype:Z.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Nt({size:1,datatype:Z.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},dg=tFe;function nFe(e,t,n,i){switch(t.type){case e.FLOAT:return new Eie(e,t,n,i);case e.FLOAT_VEC2:return new Sie(e,t,n,i);case e.FLOAT_VEC3:return new wie(e,t,n,i);case e.FLOAT_VEC4:return new vie(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new u6(e,t,n,i);case e.INT:case e.BOOL:return new Die(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new Pie(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new Iie(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new Oie(e,t,n,i);case e.FLOAT_MAT2:return new Rie(e,t,n,i);case e.FLOAT_MAT3:return new Mie(e,t,n,i);case e.FLOAT_MAT4:return new Bie(e,t,n,i);default:throw new fe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function Eie(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Eie.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function Sie(e,t,n,i){this.name=n,this.value=void 0,this._value=new W,this._gl=e,this._location=i}Sie.prototype.set=function(){let e=this.value;W.equals(e,this._value)||(W.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function wie(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}wie.prototype.set=function(){let e=this.value;!e||(l(e.red)?z.equals(e,this._value)||(this._value=z.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):l(e.x)&&(h.equals(e,this._value)||(this._value=h.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z))))};function vie(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}vie.prototype.set=function(){let e=this.value;l(e.red)?z.equals(e,this._value)||(this._value=z.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):l(e.x)&&(se.equals(e,this._value)||(this._value=se.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))};function u6(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}u6.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;!t||e.bindTexture(t._target,t._texture)};u6.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function Die(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Die.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function Pie(e,t,n,i){this.name=n,this.value=void 0,this._value=new W,this._gl=e,this._location=i}Pie.prototype.set=function(){let e=this.value;W.equals(e,this._value)||(W.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function Iie(e,t,n,i){this.name=n,this.value=void 0,this._value=new h,this._gl=e,this._location=i}Iie.prototype.set=function(){let e=this.value;h.equals(e,this._value)||(h.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function Oie(e,t,n,i){this.name=n,this.value=void 0,this._value=new se,this._gl=e,this._location=i}Oie.prototype.set=function(){let e=this.value;se.equals(e,this._value)||(se.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var iFe=new Float32Array(4);function Rie(e,t,n,i){this.name=n,this.value=void 0,this._value=new Ri,this._gl=e,this._location=i}Rie.prototype.set=function(){if(!Ri.equalsArray(this.value,this._value,0)){Ri.clone(this.value,this._value);let e=Ri.toArray(this.value,iFe);this._gl.uniformMatrix2fv(this._location,!1,e)}};var rFe=new Float32Array(9);function Mie(e,t,n,i){this.name=n,this.value=void 0,this._value=new Q,this._gl=e,this._location=i}Mie.prototype.set=function(){if(!Q.equalsArray(this.value,this._value,0)){Q.clone(this.value,this._value);let e=Q.toArray(this.value,rFe);this._gl.uniformMatrix3fv(this._location,!1,e)}};var oFe=new Float32Array(16);function Bie(e,t,n,i){this.name=n,this.value=void 0,this._value=new N,this._gl=e,this._location=i}Bie.prototype.set=function(){if(!N.equalsArray(this.value,this._value,0)){N.clone(this.value,this._value);let e=N.toArray(this.value,oFe);this._gl.uniformMatrix4fv(this._location,!1,e)}};var NR=nFe;function sFe(e,t,n,i){switch(t.type){case e.FLOAT:return new Lie(e,t,n,i);case e.FLOAT_VEC2:return new Nie(e,t,n,i);case e.FLOAT_VEC3:return new Fie(e,t,n,i);case e.FLOAT_VEC4:return new Vie(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new f6(e,t,n,i);case e.INT:case e.BOOL:return new kie(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new Uie(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new zie(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new Hie(e,t,n,i);case e.FLOAT_MAT2:return new Gie(e,t,n,i);case e.FLOAT_MAT3:return new Wie(e,t,n,i);case e.FLOAT_MAT4:return new jie(e,t,n,i);default:throw new fe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function Lie(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r),this._gl=e,this._location=i[0]}Lie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let r=0;r<t;++r){let o=e[r];o!==n[r]&&(n[r]=o,i=!0)}i&&this._gl.uniform1fv(this._location,n)};function Nie(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*2),this._gl=e,this._location=i[0]}Nie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];W.equalsArray(s,n,r)||(W.pack(s,n,r),i=!0),r+=2}i&&this._gl.uniform2fv(this._location,n)};function Fie(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*3),this._gl=e,this._location=i[0]}Fie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];l(s.red)?(s.red!==n[r]||s.green!==n[r+1]||s.blue!==n[r+2])&&(n[r]=s.red,n[r+1]=s.green,n[r+2]=s.blue,i=!0):l(s.x)&&(h.equalsArray(s,n,r)||(h.pack(s,n,r),i=!0)),r+=3}i&&this._gl.uniform3fv(this._location,n)};function Vie(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*4),this._gl=e,this._location=i[0]}Vie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];l(s.red)?z.equalsArray(s,n,r)||(z.pack(s,n,r),i=!0):l(s.x)&&(se.equalsArray(s,n,r)||(se.pack(s,n,r),i=!0)),r+=4}i&&this._gl.uniform4fv(this._location,n)};function f6(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}f6.prototype.set=function(){let e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,n=this.value,i=n.length;for(let r=0;r<i;++r){let o=n[r];e.activeTexture(t+r),e.bindTexture(o._target,o._texture)}};f6.prototype._setSampler=function(e){this.textureUnitIndex=e;let t=this._locations,n=t.length;for(let i=0;i<n;++i){let r=e+i;this._gl.uniform1i(t[i],r)}return e+n};function kie(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Int32Array(r),this._gl=e,this._location=i[0]}kie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let r=0;r<t;++r){let o=e[r];o!==n[r]&&(n[r]=o,i=!0)}i&&this._gl.uniform1iv(this._location,n)};function Uie(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Int32Array(r*2),this._gl=e,this._location=i[0]}Uie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];W.equalsArray(s,n,r)||(W.pack(s,n,r),i=!0),r+=2}i&&this._gl.uniform2iv(this._location,n)};function zie(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Int32Array(r*3),this._gl=e,this._location=i[0]}zie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];h.equalsArray(s,n,r)||(h.pack(s,n,r),i=!0),r+=3}i&&this._gl.uniform3iv(this._location,n)};function Hie(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Int32Array(r*4),this._gl=e,this._location=i[0]}Hie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];se.equalsArray(s,n,r)||(se.pack(s,n,r),i=!0),r+=4}i&&this._gl.uniform4iv(this._location,n)};function Gie(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*4),this._gl=e,this._location=i[0]}Gie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];Ri.equalsArray(s,n,r)||(Ri.pack(s,n,r),i=!0),r+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function Wie(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*9),this._gl=e,this._location=i[0]}Wie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];Q.equalsArray(s,n,r)||(Q.pack(s,n,r),i=!0),r+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function jie(e,t,n,i){let r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r*16),this._gl=e,this._location=i[0]}jie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,r=0;for(let o=0;o<t;++o){let s=e[o];N.equalsArray(s,n,r)||(N.pack(s,n,r),i=!0),r+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var FR=sFe;var aFe=0;function up(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));let i=cFe(t,n);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=aFe++}up.fromCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.getShaderProgram(e)};up.replaceCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(up.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return VR(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return VR(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return VR(this),this._uniformsByName}}});function qie(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r].trim(),s=o.slice(o.lastIndexOf(" ")+1);t.push(s)}}return t}function cFe(e,t){let n={};if(!Bt.highpFloatSupported||!Bt.highpIntSupported){let i,r,o,s,a=qie(e),c=qie(t),u=a.length,f=c.length;for(i=0;i<u;i++)for(r=0;r<f;r++)if(a[i]===c[r]){o=a[i],s=`czm_mediump_${o}`;let d=new RegExp(`${o}\\b`,"g");t=t.replace(d,s),n[s]=o}}return{fragmentShaderText:t,duplicateUniformNames:n}}var Zu="[Cesium WebGL] ";function lFe(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,n),e.compileShader(r);let o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,i),e.compileShader(o);let s=e.createProgram();e.attachShader(s,r),e.attachShader(s,o),e.deleteShader(r),e.deleteShader(o);let a=t._attributeLocations;if(l(a))for(let f in a)a.hasOwnProperty(f)&&e.bindAttribLocation(s,a[f],f);e.linkProgram(s);let c;if(!e.getProgramParameter(s,e.LINK_STATUS)){let f=t._debugShaders;if(!e.getShaderParameter(o,e.COMPILE_STATUS)){if(c=e.getShaderInfoLog(o),console.error(`${Zu}Fragment shader compile log: ${c}`),l(f)){let d=f.getTranslatedShaderSource(o);console.error(d!==""?`${Zu}Translated fragment shader source:
- ${d}`:`${Zu}Fragment shader translation failed.`)}throw e.deleteProgram(s),new fe(`Fragment shader failed to compile. Compile log: ${c}`)}if(!e.getShaderParameter(r,e.COMPILE_STATUS)){if(c=e.getShaderInfoLog(r),console.error(`${Zu}Vertex shader compile log: ${c}`),l(f)){let d=f.getTranslatedShaderSource(r);console.error(d!==""?`${Zu}Translated vertex shader source:
- ${d}`:`${Zu}Vertex shader translation failed.`)}throw e.deleteProgram(s),new fe(`Vertex shader failed to compile. Compile log: ${c}`)}throw c=e.getProgramInfoLog(s),console.error(`${Zu}Shader program link log: ${c}`),l(f)&&(console.error(`${Zu}Translated vertex shader source:
- ${f.getTranslatedShaderSource(r)}`),console.error(`${Zu}Translated fragment shader source:
- ${f.getTranslatedShaderSource(o)}`)),e.deleteProgram(s),new fe(`Program failed to link. Link log: ${c}`)}let u=t._logShaderCompilation;return u&&(c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${Zu}Vertex shader compile log: ${c}`)),u&&(c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${Zu}Fragment shader compile log: ${c}`)),u&&(c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${Zu}Shader program link log: ${c}`)),s}function uFe(e,t,n){let i={};for(let r=0;r<n;++r){let o=e.getActiveAttrib(t,r),s=e.getAttribLocation(t,o.name);i[o.name]={name:o.name,type:o.type,index:s}}return i}function fFe(e,t){let n={},i=[],r=[],o=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<o;++s){let a=e.getActiveUniform(t,s),c="[0]",u=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(u.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let d=NR(e,a,u,f);n[u]=d,i.push(d),d._setSampler&&r.push(d)}}else{let f,d,p,g,m=u.indexOf("[");if(m>=0){if(f=n[u.slice(0,m)],!l(f))continue;d=f._locations,d.length<=1&&(p=f.value,g=e.getUniformLocation(t,u),g!==null&&(d.push(g),p.push(e.getUniform(t,g))))}else{d=[];for(let x=0;x<a.size;++x)g=e.getUniformLocation(t,`${u}[${x}]`),g!==null&&d.push(g);f=FR(e,a,u,d),n[u]=f,i.push(f),f._setSampler&&r.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:r}}function dFe(e,t){let n=[],i=[];for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=r,a=e._duplicateUniformNames[s];l(a)&&(o.name=a,s=a);let c=dg[s];l(c)?n.push({uniform:o,automaticUniform:c}):i.push(o)}return{automaticUniforms:n,manualUniforms:i}}function hFe(e,t,n){e.useProgram(t);let i=0,r=n.length;for(let o=0;o<r;++o)i=n[o]._setSampler(i);return e.useProgram(null),i}function VR(e){l(e._program)||Yie(e)}function Yie(e){let t=e._program,n=e._gl,i=lFe(n,e,e._debugShaders),r=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),o=fFe(n,i),s=dFe(e,o.uniformsByName);e._program=i,e._numberOfVertexAttributes=r,e._vertexAttributes=uFe(n,i,r),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=hFe(n,i,o.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,u,f){let d=e._vertexShaderText,p=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=a.replace(g," != "),e._fragmentShaderText=c.replace(g," != ");try{Yie(e),u(e._program)}catch(m){e._vertexShaderText=d,e._fragmentShaderText=p;let C=/(?:Compile|Link) error: ([^]*)/.exec(m.message);f(C?C[1]:m.message)}})}up.prototype._bind=function(){VR(this),this._gl.useProgram(this._program)};up.prototype._setUniforms=function(e,t,n){let i,r;if(l(e)){let a=this._manualUniforms;for(i=a.length,r=0;r<i;++r){let c=a[r];c.value=e[c.name]()}}let o=this._automaticUniforms;for(i=o.length,r=0;r<i;++r){let a=o[r];a.uniform.value=a.automaticUniform.getValue(t)}let s=this._uniforms;for(i=s.length,r=0;r<i;++r)s[r].set();if(n){let a=this._gl,c=this._program;a.validateProgram(c)}};up.prototype.isDestroyed=function(){return!1};up.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};up.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),ue(this)};var Wt=up;function mFe(e,t){let n=/#define OUTPUT_DECLARATION/,i=e.split(`
- `);if(/#version 300 es/g.test(e))return e;let r=-1,o,s;for(o=0;o<i.length;++o)if(s=i[o],n.test(s)){r=o;break}if(r===-1)throw new ye("Could not find a #define OUTPUT_DECLARATION!");let a=[];for(o=0;o<10;o++){let x=`gl_FragData\\[${o}\\]`,C=`czm_out${o}`;new RegExp(x,"g").test(e)&&(Xie(C,a),Uh(x,C,i),i.splice(r,0,`layout(location = ${o}) out vec4 ${C};`),r+=1)}let c="czm_fragColor";_Fe("gl_FragColor",i)&&(Xie(c,a),Uh("gl_FragColor",c,i),i.splice(r,0,"layout(location = 0) out vec4 czm_fragColor;"),r+=1);let u=yFe(a,i),f={};for(o=0;o<i.length;o++){s=i[o];for(let x in u)u.hasOwnProperty(x)&&new RegExp(`(layout)[^]+(out)[^]+(${x})[^]+`,"g").test(s)&&(f[s]=x)}for(let x in f)if(f.hasOwnProperty(x)){let C=f[x],A=i.indexOf(x),b=u[C],T=b.length;for(let S=0;S<T;S++)i.splice(A,0,b[S]);A+=T+1;for(let S=T-1;S>=0;S--)i.splice(A,0,`#endif //${b[S]}`)}let d="WEBGL_2",p=`#define ${d}`,g="#version 300 es",m=!1;for(o=0;o<i.length;o++)if(/#version/.test(i[o])){i[o]=g,m=!0;break}return m||i.splice(0,0,g),i.splice(1,0,p),d6("EXT_draw_buffers",d,i),d6("EXT_frag_depth",d,i),d6("OES_standard_derivatives",d,i),Uh("texture2D","texture",i),Uh("texture3D","texture",i),Uh("textureCube","texture",i),Uh("gl_FragDepthEXT","gl_FragDepth",i),t?Uh("varying","in",i):(Uh("attribute","in",i),Uh("varying","out",i)),gFe(i)}function Uh(e,t,n){let i=`(^|[^\\w])(${e})($|[^\\w])`,r=new RegExp(i,"g"),o=n.length;for(let s=0;s<o;++s){let a=n[s];n[s]=a.replace(r,`$1${t}$3`)}}function pFe(e,t,n){let i=n.length;for(let r=0;r<i;++r){let o=n[r];n[r]=o.replace(e,t)}}function _Fe(e,t){let n=`(^|[^\\w])(${e})($|[^\\w])`,i=new RegExp(n,"g"),r=t.length;for(let o=0;o<r;++o){let s=t[o];if(i.test(s))return!0}return!1}function gFe(e){let t="",n=e.length;for(let i=0;i<n;++i)t+=`${e[i]}
- `;return t}function Xie(e,t){t.indexOf(e)===-1&&t.push(e)}function yFe(e,t){let n={},i=e.length,r=[];for(let o=0;o<t.length;++o){let s=t[o],a=/(#ifdef|#if)/g.test(s),c=/#else/g.test(s),u=/#endif/g.test(s);if(a)r.push(s);else if(c){let d=r[r.length-1].replace("ifdef","ifndef");/if/g.test(d)&&(d=d.replace(/(#if\s+)(\S*)([^]*)/,"$1!($2)$3")),r.pop(),r.push(d)}else if(u)r.pop();else if(!/layout/g.test(s))for(let f=0;f<i;++f){let d=e[f];s.indexOf(d)!==-1&&(l(n[d])?n[d]=n[d].filter(function(p){return r.indexOf(p)>=0}):n[d]=r.slice())}}return n}function d6(e,t,n){let i=`#extension\\s+GL_${e}\\s+:\\s+[a-zA-Z0-9]+\\s*$`;pFe(new RegExp(i,"g"),"",n),Uh(`GL_${e}`,t,n)}var kR=mFe;var UR=`const float czm_degreesPerRadian = 57.29577951308232;
- `;var zR=`const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);
- `;var HR=`const float czm_epsilon1 = 0.1;
- `;var GR=`const float czm_epsilon2 = 0.01;
- `;var WR=`const float czm_epsilon3 = 0.001;
- `;var jR=`const float czm_epsilon4 = 0.0001;
- `;var qR=`const float czm_epsilon5 = 0.00001;
- `;var YR=`const float czm_epsilon6 = 0.000001;
- `;var XR=`const float czm_epsilon7 = 0.0000001;
- `;var KR=`const float czm_infinity = 5906376272000.0;
- `;var $R=`const float czm_oneOverPi = 0.3183098861837907;
- `;var ZR=`const float czm_oneOverTwoPi = 0.15915494309189535;
- `;var JR=`const float czm_passCesium3DTile = 4.0;
- `;var QR=`const float czm_passCesium3DTileClassification = 5.0;
- `;var eM=`const float czm_passCesium3DTileClassificationIgnoreShow = 6.0;
- `;var tM=`const float czm_passClassification = 7.0;
- `;var nM=`const float czm_passCompute = 1.0;
- `;var iM=`const float czm_passEnvironment = 0.0;
- `;var rM=`const float czm_passGlobe = 2.0;
- `;var oM=`const float czm_passOpaque = 7.0;
- `;var sM=`const float czm_passOverlay = 9.0;
- `;var aM=`const float czm_passTerrainClassification = 3.0;
- `;var cM=`const float czm_passTranslucent = 8.0;
- `;var lM=`const float czm_pi = 3.141592653589793;
- `;var uM=`const float czm_piOverFour = 0.7853981633974483;
- `;var fM=`const float czm_piOverSix = 0.5235987755982988;
- `;var dM=`const float czm_piOverThree = 1.0471975511965976;
- `;var hM=`const float czm_piOverTwo = 1.5707963267948966;
- `;var mM=`const float czm_radiansPerDegree = 0.017453292519943295;
- `;var pM=`const float czm_sceneMode2D = 2.0;
- `;var _M=`const float czm_sceneMode3D = 3.0;
- `;var gM=`const float czm_sceneModeColumbusView = 1.0;
- `;var yM=`const float czm_sceneModeMorphing = 0.0;
- `;var xM=`const float czm_solarRadius = 695500000.0;
- `;var CM=`const float czm_threePiOver2 = 4.71238898038469;
- `;var AM=`const float czm_twoPi = 6.283185307179586;
- `;var TM=`const float czm_webMercatorMaxLatitude = 1.4844222297453324;
- `;var bM=`struct czm_depthRangeStruct
- {
- float near;
- float far;
- };
- `;var EM=`struct czm_material
- {
- vec3 diffuse;
- float specular;
- float shininess;
- vec3 normal;
- vec3 emission;
- float alpha;
- };
- `;var SM=`struct czm_materialInput
- {
- float s;
- vec2 st;
- vec3 str;
- vec3 normalEC;
- mat3 tangentToEyeMatrix;
- vec3 positionToEyeEC;
- float height;
- float slope;
- float aspect;
- };
- `;var wM=`struct czm_modelMaterial {
- vec3 diffuse;
- float alpha;
- vec3 specular;
- float roughness;
- vec3 normalEC;
- float occlusion;
- vec3 emissive;
- };
- `;var vM=`struct czm_modelVertexOutput {
- vec3 positionMC;
- float pointSize;
- };
- `;var DM=`struct czm_pbrParameters
- {
- vec3 diffuseColor;
- float roughness;
- vec3 f0;
- };
- `;var PM=`struct czm_ray
- {
- vec3 origin;
- vec3 direction;
- };
- `;var IM=`struct czm_raySegment
- {
- float start;
- float stop;
- };
- const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);
- const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);
- `;var OM=`struct czm_shadowParameters
- {
- #ifdef USE_CUBE_MAP_SHADOW
- vec3 texCoords;
- #else
- vec2 texCoords;
- #endif
- float depthBias;
- float depth;
- float nDotL;
- vec2 texelStepSize;
- float normalShadingSmooth;
- float darkness;
- };
- `;var RM=`vec3 czm_acesTonemapping(vec3 color) {
- float g = 0.985;
- float a = 0.065;
- float b = 0.0001;
- float c = 0.433;
- float d = 0.238;
- color = (color * (color + a) - b) / (color * (g * color + c) + d);
- color = clamp(color, 0.0, 1.0);
- return color;
- }
- `;var MM=`float czm_alphaWeight(float a)
- {
- float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];
- return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0))));
- }
- `;var BM=`vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)
- {
- float val1 = clamp(dist / fuzzFactor, 0.0, 1.0);
- float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);
- val1 = val1 * (1.0 - val2);
- val1 = val1 * val1 * (3.0 - (2.0 * val1));
- val1 = pow(val1, 0.5);
- vec4 midColor = (color1 + color2) * 0.5;
- return mix(midColor, currentColor, val1);
- }
- vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)
- {
- return czm_antialias(color1, color2, currentColor, dist, 0.1);
- }
- `;var LM=`vec2 czm_approximateSphericalCoordinates(vec3 normal) {
- float latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z);
- float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y);
- return vec2(latitudeApproximation, longitudeApproximation);
- }
- `;var NM=`bool czm_backFacing()
- {
- return gl_FrontFacing == false;
- }
- `;var FM=`float czm_branchFreeTernary(bool comparison, float a, float b) {
- float useA = float(comparison);
- return a * useA + b * (1.0 - useA);
- }
- vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) {
- float useA = float(comparison);
- return a * useA + b * (1.0 - useA);
- }
- vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) {
- float useA = float(comparison);
- return a * useA + b * (1.0 - useA);
- }
- vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) {
- float useA = float(comparison);
- return a * useA + b * (1.0 - useA);
- }
- `;var VM=`vec4 czm_cascadeColor(vec4 weights)
- {
- return vec4(1.0, 0.0, 0.0, 1.0) * weights.x +
- vec4(0.0, 1.0, 0.0, 1.0) * weights.y +
- vec4(0.0, 0.0, 1.0, 1.0) * weights.z +
- vec4(1.0, 0.0, 1.0, 1.0) * weights.w;
- }
- `;var kM=`uniform vec4 shadowMap_cascadeDistances;
- float czm_cascadeDistance(vec4 weights)
- {
- return dot(shadowMap_cascadeDistances, weights);
- }
- `;var UM=`uniform mat4 shadowMap_cascadeMatrices[4];
- mat4 czm_cascadeMatrix(vec4 weights)
- {
- return shadowMap_cascadeMatrices[0] * weights.x +
- shadowMap_cascadeMatrices[1] * weights.y +
- shadowMap_cascadeMatrices[2] * weights.z +
- shadowMap_cascadeMatrices[3] * weights.w;
- }
- `;var zM=`uniform vec4 shadowMap_cascadeSplits[2];
- vec4 czm_cascadeWeights(float depthEye)
- {
- vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));
- vec4 far = step(depthEye, shadowMap_cascadeSplits[1]);
- return near * far;
- }
- `;var HM=`vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)
- {
- vec3 p = mix(position2D.xyz, position3D.xyz, time);
- return vec4(p, 1.0);
- }
- `;var GM=`vec4 czm_computePosition();
- `;var WM=`vec2 cordic(float angle)
- {
- vec2 vector = vec2(6.0725293500888267e-1, 0.0);
- float sense = (angle < 0.0) ? -1.0 : 1.0;
- mat2 rotation = mat2(1.0, sense, -sense, 1.0);
- vector = rotation * vector;
- angle -= sense * 7.8539816339744828e-1;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- float factor = sense * 5.0e-1;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- angle -= sense * 4.6364760900080609e-1;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- factor = sense * 2.5e-1;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- angle -= sense * 2.4497866312686414e-1;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- factor = sense * 1.25e-1;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- angle -= sense * 1.2435499454676144e-1;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- factor = sense * 6.25e-2;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- angle -= sense * 6.2418809995957350e-2;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- factor = sense * 3.125e-2;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- angle -= sense * 3.1239833430268277e-2;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- factor = sense * 1.5625e-2;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- angle -= sense * 1.5623728620476831e-2;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- factor = sense * 7.8125e-3;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- angle -= sense * 7.8123410601011111e-3;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- factor = sense * 3.90625e-3;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- angle -= sense * 3.9062301319669718e-3;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- factor = sense * 1.953125e-3;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- angle -= sense * 1.9531225164788188e-3;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- factor = sense * 9.765625e-4;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- angle -= sense * 9.7656218955931946e-4;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- factor = sense * 4.8828125e-4;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- angle -= sense * 4.8828121119489829e-4;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- factor = sense * 2.44140625e-4;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- angle -= sense * 2.4414062014936177e-4;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- factor = sense * 1.220703125e-4;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- angle -= sense * 1.2207031189367021e-4;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- factor = sense * 6.103515625e-5;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- angle -= sense * 6.1035156174208773e-5;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- factor = sense * 3.0517578125e-5;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- angle -= sense * 3.0517578115526096e-5;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- factor = sense * 1.52587890625e-5;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- angle -= sense * 1.5258789061315762e-5;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- factor = sense * 7.62939453125e-6;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- angle -= sense * 7.6293945311019700e-6;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- factor = sense * 3.814697265625e-6;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- angle -= sense * 3.8146972656064961e-6;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- factor = sense * 1.9073486328125e-6;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- angle -= sense * 1.9073486328101870e-6;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- factor = sense * 9.5367431640625e-7;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- angle -= sense * 9.5367431640596084e-7;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- factor = sense * 4.76837158203125e-7;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- angle -= sense * 4.7683715820308884e-7;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- factor = sense * 2.384185791015625e-7;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- angle -= sense * 2.3841857910155797e-7;
- sense = (angle < 0.0) ? -1.0 : 1.0;
- factor = sense * 1.1920928955078125e-7;
- rotation[0][1] = factor;
- rotation[1][0] = -factor;
- vector = rotation * vector;
- return vector;
- }
- vec2 czm_cosineAndSine(float angle)
- {
- if (angle < -czm_piOverTwo || angle > czm_piOverTwo)
- {
- if (angle < 0.0)
- {
- return -cordic(angle + czm_pi);
- }
- else
- {
- return -cordic(angle - czm_pi);
- }
- }
- else
- {
- return cordic(angle);
- }
- }
- `;var jM=`vec2 czm_decompressTextureCoordinates(float encoded)
- {
- float temp = encoded / 4096.0;
- float xZeroTo4095 = floor(temp);
- float stx = xZeroTo4095 / 4095.0;
- float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;
- return vec2(stx, sty);
- }
- `;var qM=`czm_pbrParameters czm_defaultPbrMaterial()
- {
- czm_pbrParameters results;
- results.diffuseColor = vec3(1.0);
- results.roughness = 1.0;
- const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);
- results.f0 = REFLECTANCE_DIELECTRIC;
- return results;
- }
- `;var YM=`#if defined(GL_EXT_frag_depth) && !defined(LOG_DEPTH)
- varying float v_WindowZ;
- #endif
- vec4 czm_depthClamp(vec4 coords)
- {
- #ifndef LOG_DEPTH
- #ifdef GL_EXT_frag_depth
- v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w;
- coords.z = 0.0;
- #else
- coords.z = min(coords.z, coords.w);
- #endif
- #endif
- return coords;
- }
- `;var XM=`mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)
- {
- vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));
- vec3 tangentEC = normalize(czm_normal3D * tangentMC);
- vec3 bitangentEC = normalize(cross(normalEC, tangentEC));
- return mat3(
- tangentEC.x, tangentEC.y, tangentEC.z,
- bitangentEC.x, bitangentEC.y, bitangentEC.z,
- normalEC.x, normalEC.y, normalEC.z);
- }
- `;var KM=`bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point)
- {
- vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;
- return (dot(scaled, scaled) <= 1.0);
- }
- `;var $M=`vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)
- {
- return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);
- }
- `;var ZM=`bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {
- return all(lessThanEqual(abs(left - right), vec4(epsilon)));
- }
- bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {
- return all(lessThanEqual(abs(left - right), vec3(epsilon)));
- }
- bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {
- return all(lessThanEqual(abs(left - right), vec2(epsilon)));
- }
- bool czm_equalsEpsilon(float left, float right, float epsilon) {
- return (abs(left - right) <= epsilon);
- }
- `;var JM=`vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)
- {
- vec4 p = positionEC;
- vec4 zEyeOffset = normalize(p) * eyeOffset.z;
- p.xy += eyeOffset.xy + zEyeOffset.xy;
- p.z += zEyeOffset.z;
- return p;
- }
- `;var QM=`vec4 czm_eyeToWindowCoordinates(vec4 positionEC)
- {
- vec4 q = czm_projection * positionEC;
- q.xyz /= q.w;
- q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;
- return q;
- }
- `;var eB=`float czm_fastApproximateAtan(float x) {
- return x * (-0.1784 * x - 0.0663 * x * x + 1.0301);
- }
- float czm_fastApproximateAtan(float x, float y) {
- float t = abs(x);
- float opposite = abs(y);
- float adjacent = max(t, opposite);
- opposite = min(t, opposite);
- t = czm_fastApproximateAtan(opposite / adjacent);
- t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t);
- t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t);
- t = czm_branchFreeTernary(y < 0.0, -t, t);
- return t;
- }
- `;var tB=`vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)
- {
- float scalar = distanceToCamera * czm_fogDensity;
- float fog = 1.0 - exp(-(scalar * scalar));
- return mix(color, fogColor, fog);
- }
- vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant)
- {
- float scalar = distanceToCamera * czm_fogDensity;
- float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant))));
- return mix(color, fogColor, fog);
- }
- `;var nB=`vec3 czm_gammaCorrect(vec3 color) {
- #ifdef HDR
- color = pow(color, vec3(czm_gamma));
- #endif
- return color;
- }
- vec4 czm_gammaCorrect(vec4 color) {
- #ifdef HDR
- color.rgb = pow(color.rgb, vec3(czm_gamma));
- #endif
- return color;
- }
- `;var iB=`vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)
- {
- return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);
- }
- `;var rB=`czm_material czm_getDefaultMaterial(czm_materialInput materialInput)
- {
- czm_material material;
- material.diffuse = vec3(0.0);
- material.specular = 0.0;
- material.shininess = 1.0;
- material.normal = materialInput.normalEC;
- material.emission = vec3(0.0);
- material.alpha = 1.0;
- return material;
- }
- `;var oB=`float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)
- {
- return max(dot(lightDirectionEC, normalEC), 0.0);
- }
- `;var sB=`float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)
- {
- vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);
- float specular = max(dot(toReflectedLight, toEyeEC), 0.0);
- return pow(specular, max(shininess, czm_epsilon2));
- }
- `;var aB=`vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)
- {
- float cosAngle = cos(angleInRadians);
- float sinAngle = sin(angleInRadians);
- vec2 s0 = vec2(1.0/17.0, 0.0);
- vec2 s1 = vec2(-1.0/29.0, 0.0);
- vec2 s2 = vec2(1.0/101.0, 1.0/59.0);
- vec2 s3 = vec2(-1.0/109.0, -1.0/57.0);
- s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));
- s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));
- s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));
- s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));
- vec2 uv0 = (uv/103.0) + (time * s0);
- vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);
- vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);
- vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);
- uv0 = fract(uv0);
- uv1 = fract(uv1);
- uv2 = fract(uv2);
- uv3 = fract(uv3);
- vec4 noise = (texture2D(normalMap, uv0)) +
- (texture2D(normalMap, uv1)) +
- (texture2D(normalMap, uv2)) +
- (texture2D(normalMap, uv3));
- return ((noise / 4.0) - 0.5) * 2.0;
- }
- `;var cB=`const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
- vec3 czm_HSBToRGB(vec3 hsb)
- {
- vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);
- return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y);
- }
- `;var lB=`vec3 hueToRGB(float hue)
- {
- float r = abs(hue * 6.0 - 3.0) - 1.0;
- float g = 2.0 - abs(hue * 6.0 - 2.0);
- float b = 2.0 - abs(hue * 6.0 - 4.0);
- return clamp(vec3(r, g, b), 0.0, 1.0);
- }
- vec3 czm_HSLToRGB(vec3 hsl)
- {
- vec3 rgb = hueToRGB(hsl.x);
- float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;
- return (rgb - 0.5) * c + hsl.z;
- }
- `;var uB=`vec3 czm_hue(vec3 rgb, float adjustment)
- {
- const mat3 toYIQ = mat3(0.299, 0.587, 0.114,
- 0.595716, -0.274453, -0.321263,
- 0.211456, -0.522591, 0.311135);
- const mat3 toRGB = mat3(1.0, 0.9563, 0.6210,
- 1.0, -0.2721, -0.6474,
- 1.0, -1.107, 1.7046);
- vec3 yiq = toYIQ * rgb;
- float hue = atan(yiq.z, yiq.y) + adjustment;
- float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);
- vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));
- return toRGB * color;
- }
- `;var fB=`vec3 czm_inverseGamma(vec3 color) {
- return pow(color, vec3(1.0 / czm_gamma));
- }
- `;var dB=`bool czm_isEmpty(czm_raySegment interval)
- {
- return (interval.stop < 0.0);
- }
- `;var hB=`bool czm_isFull(czm_raySegment interval)
- {
- return (interval.start == 0.0 && interval.stop == czm_infinity);
- }
- `;var mB=`float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)
- {
- float sinLatitude = sin(latitude);
- float mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));
- return (mercatorY - southMercatorY) * oneOverMercatorHeight;
- }
- `;var pB=`vec3 czm_linearToSrgb(vec3 linearIn)
- {
- return pow(linearIn, vec3(1.0/2.2));
- }
- vec4 czm_linearToSrgb(vec4 linearIn)
- {
- vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2));
- return vec4(srgbOut, linearIn.a);
- }
- `;var _B=`float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) {
- return abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1);
- }
- `;var gB=`float czm_luminance(vec3 rgb)
- {
- const vec3 W = vec3(0.2125, 0.7154, 0.0721);
- return dot(rgb, W);
- }
- `;var yB=`float czm_metersPerPixel(vec4 positionEC, float pixelRatio)
- {
- float width = czm_viewport.z;
- float height = czm_viewport.w;
- float pixelWidth;
- float pixelHeight;
- float top = czm_frustumPlanes.x;
- float bottom = czm_frustumPlanes.y;
- float left = czm_frustumPlanes.z;
- float right = czm_frustumPlanes.w;
- if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0)
- {
- float frustumWidth = right - left;
- float frustumHeight = top - bottom;
- pixelWidth = frustumWidth / width;
- pixelHeight = frustumHeight / height;
- }
- else
- {
- float distanceToPixel = -positionEC.z;
- float inverseNear = 1.0 / czm_currentFrustum.x;
- float tanTheta = top * inverseNear;
- pixelHeight = 2.0 * distanceToPixel * tanTheta / height;
- tanTheta = right * inverseNear;
- pixelWidth = 2.0 * distanceToPixel * tanTheta / width;
- }
- return max(pixelWidth, pixelHeight) * pixelRatio;
- }
- float czm_metersPerPixel(vec4 positionEC)
- {
- return czm_metersPerPixel(positionEC, czm_pixelRatio);
- }
- `;var xB=`vec4 czm_modelToWindowCoordinates(vec4 position)
- {
- vec4 q = czm_modelViewProjection * position;
- q.xyz /= q.w;
- q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;
- return q;
- }
- `;var CB=`vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)
- {
- const vec3 W = vec3(0.2125, 0.7154, 0.0721);
- vec3 target = left * right;
- float leftLuminance = dot(left, W);
- float rightLuminance = dot(right, W);
- float targetLuminance = dot(target, W);
- return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;
- }
- `;var AB=`float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)
- {
- float valueAtMin = nearFarScalar.y;
- float valueAtMax = nearFarScalar.w;
- float nearDistanceSq = nearFarScalar.x * nearFarScalar.x;
- float farDistanceSq = nearFarScalar.z * nearFarScalar.z;
- float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);
- t = pow(clamp(t, 0.0, 1.0), 0.2);
- return mix(valueAtMin, valueAtMax, t);
- }
- `;var TB=`vec3 czm_octDecode(vec2 encoded, float range)
- {
- if (encoded.x == 0.0 && encoded.y == 0.0) {
- return vec3(0.0, 0.0, 0.0);
- }
- encoded = encoded / range * 2.0 - 1.0;
- vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));
- if (v.z < 0.0)
- {
- v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);
- }
- return normalize(v);
- }
- vec3 czm_octDecode(vec2 encoded)
- {
- return czm_octDecode(encoded, 255.0);
- }
- vec3 czm_octDecode(float encoded)
- {
- float temp = encoded / 256.0;
- float x = floor(temp);
- float y = (temp - x) * 256.0;
- return czm_octDecode(vec2(x, y));
- }
- void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)
- {
- float temp = encoded.x / 65536.0;
- float x = floor(temp);
- float encodedFloat1 = (temp - x) * 65536.0;
- temp = encoded.y / 65536.0;
- float y = floor(temp);
- float encodedFloat2 = (temp - y) * 65536.0;
- vector1 = czm_octDecode(encodedFloat1);
- vector2 = czm_octDecode(encodedFloat2);
- vector3 = czm_octDecode(vec2(x, y));
- }
- `;var bB=`vec4 czm_packDepth(float depth)
- {
- vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;
- enc = fract(enc);
- enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);
- return enc;
- }
- `;var EB=`vec3 lambertianDiffuse(vec3 diffuseColor)
- {
- return diffuseColor / czm_pi;
- }
- vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH)
- {
- return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0);
- }
- float smithVisibilityG1(float NdotV, float roughness)
- {
- float k = (roughness + 1.0) * (roughness + 1.0) / 8.0;
- return NdotV / (NdotV * (1.0 - k) + k);
- }
- float smithVisibilityGGX(float roughness, float NdotL, float NdotV)
- {
- return (
- smithVisibilityG1(NdotL, roughness) *
- smithVisibilityG1(NdotV, roughness)
- );
- }
- float GGX(float roughness, float NdotH)
- {
- float roughnessSquared = roughness * roughness;
- float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;
- return roughnessSquared / (czm_pi * f * f);
- }
- vec3 czm_pbrLighting(
- vec3 positionEC,
- vec3 normalEC,
- vec3 lightDirectionEC,
- vec3 lightColorHdr,
- czm_pbrParameters pbrParameters
- )
- {
- vec3 v = -normalize(positionEC);
- vec3 l = normalize(lightDirectionEC);
- vec3 h = normalize(v + l);
- vec3 n = normalEC;
- float NdotL = clamp(dot(n, l), 0.001, 1.0);
- float NdotV = abs(dot(n, v)) + 0.001;
- float NdotH = clamp(dot(n, h), 0.0, 1.0);
- float LdotH = clamp(dot(l, h), 0.0, 1.0);
- float VdotH = clamp(dot(v, h), 0.0, 1.0);
- vec3 f0 = pbrParameters.f0;
- float reflectance = max(max(f0.r, f0.g), f0.b);
- vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));
- vec3 F = fresnelSchlick2(f0, f90, VdotH);
- float alpha = pbrParameters.roughness;
- float G = smithVisibilityGGX(alpha, NdotL, NdotV);
- float D = GGX(alpha, NdotH);
- vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV);
- vec3 diffuseColor = pbrParameters.diffuseColor;
- vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);
- return (diffuseContribution + specularContribution) * NdotL * lightColorHdr;
- }
- `;var SB=`czm_pbrParameters czm_pbrMetallicRoughnessMaterial(
- vec3 baseColor,
- float metallic,
- float roughness
- )
- {
- czm_pbrParameters results;
- roughness = clamp(roughness, 0.0, 1.0);
- results.roughness = roughness * roughness;
- metallic = clamp(metallic, 0.0, 1.0);
- const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);
- vec3 f0 = mix(REFLECTANCE_DIELECTRIC, baseColor, metallic);
- results.f0 = f0;
- results.diffuseColor = baseColor * (1.0 - f0) * (1.0 - metallic);
- return results;
- }
- `;var wB=`czm_pbrParameters czm_pbrSpecularGlossinessMaterial(
- vec3 diffuse,
- vec3 specular,
- float glossiness
- )
- {
- czm_pbrParameters results;
- float roughness = 1.0 - glossiness;
- results.roughness = roughness * roughness;
- results.diffuseColor = diffuse * (1.0 - max(max(specular.r, specular.g), specular.b));
- results.f0 = specular;
- return results;
- }
- `;var vB=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)
- {
- return czm_getLambertDiffuse(lightDirectionEC, material.normal);
- }
- float czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)
- {
- return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);
- }
- vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
- {
- float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);
- if (czm_sceneMode == czm_sceneMode3D) {
- diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);
- }
- float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);
- vec3 materialDiffuse = material.diffuse * 0.5;
- vec3 ambient = materialDiffuse;
- vec3 color = ambient + material.emission;
- color += materialDiffuse * diffuse * czm_lightColor;
- color += material.specular * specular * czm_lightColor;
- return vec4(color, material.alpha);
- }
- vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
- {
- float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material);
- float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);
- vec3 ambient = vec3(0.0);
- vec3 color = ambient + material.emission;
- color += material.diffuse * diffuse * czm_lightColor;
- color += material.specular * specular * czm_lightColor;
- return vec4(color, material.alpha);
- }
- `;var DB=`float czm_planeDistance(vec4 plane, vec3 point) {
- return (dot(plane.xyz, point) + plane.w);
- }
- float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) {
- return (dot(planeNormal, point) + planeDistance);
- }
- `;var PB=`vec3 czm_pointAlongRay(czm_ray ray, float time)
- {
- return ray.origin + (time * ray.direction);
- }
- `;var IB=`czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii)
- {
- vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;
- vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;
- q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz;
- float q2 = dot(q, q);
- float qw = dot(q, w);
- if (q2 > 1.0)
- {
- if (qw >= 0.0)
- {
- return czm_emptyRaySegment;
- }
- else
- {
- float qw2 = qw * qw;
- float difference = q2 - 1.0;
- float w2 = dot(w, w);
- float product = w2 * difference;
- if (qw2 < product)
- {
- return czm_emptyRaySegment;
- }
- else if (qw2 > product)
- {
- float discriminant = qw * qw - product;
- float temp = -qw + sqrt(discriminant);
- float root0 = temp / w2;
- float root1 = difference / temp;
- if (root0 < root1)
- {
- czm_raySegment i = czm_raySegment(root0, root1);
- return i;
- }
- else
- {
- czm_raySegment i = czm_raySegment(root1, root0);
- return i;
- }
- }
- else
- {
- float root = sqrt(difference / w2);
- czm_raySegment i = czm_raySegment(root, root);
- return i;
- }
- }
- }
- else if (q2 < 1.0)
- {
- float difference = q2 - 1.0;
- float w2 = dot(w, w);
- float product = w2 * difference;
- float discriminant = qw * qw - product;
- float temp = -qw + sqrt(discriminant);
- czm_raySegment i = czm_raySegment(0.0, temp / w2);
- return i;
- }
- else
- {
- if (qw < 0.0)
- {
- float w2 = dot(w, w);
- czm_raySegment i = czm_raySegment(0.0, -qw / w2);
- return i;
- }
- else
- {
- return czm_emptyRaySegment;
- }
- }
- }
- `;var OB=`czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius)
- {
- vec3 o = ray.origin;
- vec3 d = ray.direction;
- vec3 oc = o - center;
- float a = dot(d, d);
- float b = 2.0 * dot(d, oc);
- float c = dot(oc, oc) - (radius * radius);
- float det = (b * b) - (4.0 * a * c);
- if (det < 0.0) {
- return czm_emptyRaySegment;
- }
- float sqrtDet = sqrt(det);
- float t0 = (-b - sqrtDet) / (2.0 * a);
- float t1 = (-b + sqrtDet) / (2.0 * a);
- czm_raySegment result = czm_raySegment(t0, t1);
- return result;
- }
- `;var RB=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords)
- {
- return czm_reverseLogDepth(texture2D(depthTexture, texCoords).r);
- }
- `;var MB=`float czm_readNonPerspective(float value, float oneOverW) {
- return value * oneOverW;
- }
- vec2 czm_readNonPerspective(vec2 value, float oneOverW) {
- return value * oneOverW;
- }
- vec3 czm_readNonPerspective(vec3 value, float oneOverW) {
- return value * oneOverW;
- }
- vec4 czm_readNonPerspective(vec4 value, float oneOverW) {
- return value * oneOverW;
- }
- `;var BB=`float czm_reverseLogDepth(float logZ)
- {
- #ifdef LOG_DEPTH
- float near = czm_currentFrustum.x;
- float far = czm_currentFrustum.y;
- float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne;
- float depthFromNear = pow(2.0, log2Depth) - 1.0;
- return far * (1.0 - near / (depthFromNear + near)) / (far - near);
- #endif
- return logZ;
- }
- `;var LB=`const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
- vec3 czm_RGBToHSB(vec3 rgb)
- {
- vec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g));
- vec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r));
- float d = q.x - min(q.w, q.y);
- return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);
- }
- `;var NB=`vec3 RGBtoHCV(vec3 rgb)
- {
- vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0);
- vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx);
- float c = q.x - min(q.w, q.y);
- float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z);
- return vec3(h, c, q.x);
- }
- vec3 czm_RGBToHSL(vec3 rgb)
- {
- vec3 hcv = RGBtoHCV(rgb);
- float l = hcv.z - hcv.y * 0.5;
- float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7);
- return vec3(hcv.x, s, l);
- }
- `;var FB=`vec3 czm_RGBToXYZ(vec3 rgb)
- {
- const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,
- 0.3576, 0.7152, 0.1192,
- 0.1805, 0.0722, 0.9505);
- vec3 xyz = RGB2XYZ * rgb;
- vec3 Yxy;
- Yxy.r = xyz.g;
- float temp = dot(vec3(1.0), xyz);
- Yxy.gb = xyz.rg / temp;
- return Yxy;
- }
- `;var VB=`float czm_round(float value) {
- return floor(value + 0.5);
- }
- vec2 czm_round(vec2 value) {
- return floor(value + 0.5);
- }
- vec3 czm_round(vec3 value) {
- return floor(value + 0.5);
- }
- vec4 czm_round(vec4 value) {
- return floor(value + 0.5);
- }
- `;var kB=`vec3 czm_sampleOctahedralProjectionWithFiltering(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod)
- {
- direction /= dot(vec3(1.0), abs(direction));
- vec2 rev = abs(direction.zx) - vec2(1.0);
- vec2 neg = vec2(direction.x < 0.0 ? rev.x : -rev.x,
- direction.z < 0.0 ? rev.y : -rev.y);
- vec2 uv = direction.y < 0.0 ? neg : direction.xz;
- vec2 coord = 0.5 * uv + vec2(0.5);
- vec2 pixel = 1.0 / textureSize;
- if (lod > 0.0)
- {
- float scale = 1.0 / pow(2.0, lod);
- float offset = ((textureSize.y + 1.0) / textureSize.x);
- coord.x *= offset;
- coord *= scale;
- coord.x += offset + pixel.x;
- coord.y += (1.0 - (1.0 / pow(2.0, lod - 1.0))) + pixel.y * (lod - 1.0) * 2.0;
- }
- else
- {
- coord.x *= (textureSize.y / textureSize.x);
- }
- #ifndef OES_texture_float_linear
- vec3 color1 = texture2D(projectedMap, coord + vec2(0.0, pixel.y)).rgb;
- vec3 color2 = texture2D(projectedMap, coord + vec2(pixel.x, 0.0)).rgb;
- vec3 color3 = texture2D(projectedMap, coord + pixel).rgb;
- vec3 color4 = texture2D(projectedMap, coord).rgb;
- vec2 texturePosition = coord * textureSize;
- float fu = fract(texturePosition.x);
- float fv = fract(texturePosition.y);
- vec3 average1 = mix(color4, color2, fu);
- vec3 average2 = mix(color1, color3, fu);
- vec3 color = mix(average1, average2, fv);
- #else
- vec3 color = texture2D(projectedMap, coord).rgb;
- #endif
- return color;
- }
- vec3 czm_sampleOctahedralProjection(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod, float maxLod) {
- float currentLod = floor(lod + 0.5);
- float nextLod = min(currentLod + 1.0, maxLod);
- vec3 colorCurrentLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, currentLod);
- vec3 colorNextLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, nextLod);
- return mix(colorNextLod, colorCurrentLod, nextLod - lod);
- }
- `;var UB=`vec3 czm_saturation(vec3 rgb, float adjustment)
- {
- const vec3 W = vec3(0.2125, 0.7154, 0.0721);
- vec3 intensity = vec3(dot(rgb, W));
- return mix(intensity, rgb, adjustment);
- }
- `;var zB=`float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d)
- {
- return czm_unpackDepth(textureCube(shadowMap, d));
- }
- float czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv)
- {
- #ifdef USE_SHADOW_DEPTH_TEXTURE
- return texture2D(shadowMap, uv).r;
- #else
- return czm_unpackDepth(texture2D(shadowMap, uv));
- #endif
- }
- float czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)
- {
- return step(depth, czm_sampleShadowMap(shadowMap, uv));
- }
- float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)
- {
- return step(depth, czm_sampleShadowMap(shadowMap, uv));
- }
- `;var HB=`float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)
- {
- #ifdef USE_NORMAL_SHADING
- #ifdef USE_NORMAL_SHADING_SMOOTH
- float strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);
- #else
- float strength = step(0.0, nDotL);
- #endif
- visibility *= strength;
- #endif
- visibility = max(visibility, darkness);
- return visibility;
- }
- #ifdef USE_CUBE_MAP_SHADOW
- float czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)
- {
- float depthBias = shadowParameters.depthBias;
- float depth = shadowParameters.depth;
- float nDotL = shadowParameters.nDotL;
- float normalShadingSmooth = shadowParameters.normalShadingSmooth;
- float darkness = shadowParameters.darkness;
- vec3 uvw = shadowParameters.texCoords;
- depth -= depthBias;
- float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);
- return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);
- }
- #else
- float czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)
- {
- float depthBias = shadowParameters.depthBias;
- float depth = shadowParameters.depth;
- float nDotL = shadowParameters.nDotL;
- float normalShadingSmooth = shadowParameters.normalShadingSmooth;
- float darkness = shadowParameters.darkness;
- vec2 uv = shadowParameters.texCoords;
- depth -= depthBias;
- #ifdef USE_SOFT_SHADOWS
- vec2 texelStepSize = shadowParameters.texelStepSize;
- float radius = 1.0;
- float dx0 = -texelStepSize.x * radius;
- float dy0 = -texelStepSize.y * radius;
- float dx1 = texelStepSize.x * radius;
- float dy1 = texelStepSize.y * radius;
- float visibility = (
- czm_shadowDepthCompare(shadowMap, uv, depth) +
- czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +
- czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +
- czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +
- czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +
- czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +
- czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +
- czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +
- czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)
- ) * (1.0 / 9.0);
- #else
- float visibility = czm_shadowDepthCompare(shadowMap, uv, depth);
- #endif
- return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);
- }
- #endif
- `;var GB=`float czm_signNotZero(float value)
- {
- return value >= 0.0 ? 1.0 : -1.0;
- }
- vec2 czm_signNotZero(vec2 value)
- {
- return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));
- }
- vec3 czm_signNotZero(vec3 value)
- {
- return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));
- }
- vec4 czm_signNotZero(vec4 value)
- {
- return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));
- }
- `;var WB=`vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9])
- {
- vec3 L00 = coefficients[0];
- vec3 L1_1 = coefficients[1];
- vec3 L10 = coefficients[2];
- vec3 L11 = coefficients[3];
- vec3 L2_2 = coefficients[4];
- vec3 L2_1 = coefficients[5];
- vec3 L20 = coefficients[6];
- vec3 L21 = coefficients[7];
- vec3 L22 = coefficients[8];
- float x = normal.x;
- float y = normal.y;
- float z = normal.z;
- return
- L00
- + L1_1 * y
- + L10 * z
- + L11 * x
- + L2_2 * (y * x)
- + L2_1 * (y * z)
- + L20 * (3.0 * z * z - 1.0)
- + L21 * (z * x)
- + L22 * (x * x - y * y);
- }
- `;var jB=`vec3 czm_srgbToLinear(vec3 srgbIn)
- {
- return pow(srgbIn, vec3(2.2));
- }
- vec4 czm_srgbToLinear(vec4 srgbIn)
- {
- vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));
- return vec4(linearOut, srgbIn.a);
- }
- `;var qB=`mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)
- {
- vec3 normal = normalize(normalEC);
- vec3 tangent = normalize(tangentEC);
- vec3 bitangent = normalize(bitangentEC);
- return mat3(tangent.x , tangent.y , tangent.z,
- bitangent.x, bitangent.y, bitangent.z,
- normal.x , normal.y , normal.z);
- }
- `;var YB=`vec4 czm_transformPlane(vec4 plane, mat4 transform) {
- vec4 transformedPlane = transform * plane;
- float normalMagnitude = length(transformedPlane.xyz);
- return transformedPlane / normalMagnitude;
- }
- `;var XB=`vec4 czm_translateRelativeToEye(vec3 high, vec3 low)
- {
- vec3 highDifference = high - czm_encodedCameraPositionMCHigh;
- vec3 lowDifference = low - czm_encodedCameraPositionMCLow;
- return vec4(highDifference + lowDifference, 1.0);
- }
- `;var KB=`vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
- {
- float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);
- if (czm_sceneMode == czm_sceneMode3D) {
- diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);
- }
- diffuse = clamp(diffuse, 0.0, 1.0);
- float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess);
- vec3 materialDiffuse = material.diffuse * 0.5;
- vec3 ambient = materialDiffuse;
- vec3 color = ambient + material.emission;
- color += materialDiffuse * diffuse * czm_lightColor;
- color += material.specular * specular * czm_lightColor;
- return vec4(color, material.alpha);
- }
- `;var $B=`mat2 czm_transpose(mat2 matrix)
- {
- return mat2(
- matrix[0][0], matrix[1][0],
- matrix[0][1], matrix[1][1]);
- }
- mat3 czm_transpose(mat3 matrix)
- {
- return mat3(
- matrix[0][0], matrix[1][0], matrix[2][0],
- matrix[0][1], matrix[1][1], matrix[2][1],
- matrix[0][2], matrix[1][2], matrix[2][2]);
- }
- mat4 czm_transpose(mat4 matrix)
- {
- return mat4(
- matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],
- matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],
- matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],
- matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);
- }
- `;var ZB=`float czm_unpackDepth(vec4 packedDepth)
- {
- return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));
- }
- `;var JB=`float czm_unpackFloat(vec4 packedFloat)
- {
- packedFloat = floor(packedFloat * 255.0 + 0.5);
- float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0;
- float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0;
- if (exponent == -127.0)
- {
- return 0.0;
- }
- float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000);
- float result = sign * exp2(exponent - 23.0) * mantissa;
- return result;
- }
- `;var QB=`int czm_unpackUint(float packedValue) {
- float rounded = czm_round(packedValue * 255.0);
- return int(rounded);
- }
- int czm_unpackUint(vec2 packedValue) {
- vec2 rounded = czm_round(packedValue * 255.0);
- return int(dot(rounded, vec2(1.0, 256.0)));
- }
- int czm_unpackUint(vec3 packedValue) {
- vec3 rounded = czm_round(packedValue * 255.0);
- return int(dot(rounded, vec3(1.0, 256.0, 65536.0)));
- }
- int czm_unpackUint(vec4 packedValue) {
- vec4 rounded = czm_round(packedValue * 255.0);
- return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0)));
- }
- `;var eL=`float czm_valueTransform(float offset, float scale, float value) {
- return scale * value + offset;
- }
- vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) {
- return scale * value + offset;
- }
- vec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) {
- return scale * value + offset;
- }
- vec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) {
- return scale * value + offset;
- }
- mat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) {
- return matrixCompMult(scale, value) + offset;
- }
- mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) {
- return matrixCompMult(scale, value) + offset;
- }
- mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) {
- return matrixCompMult(scale, value) + offset;
- }
- `;var tL=`#ifdef LOG_DEPTH
- varying float v_depthFromNearPlusOne;
- #ifdef SHADOW_MAP
- varying vec3 v_logPositionEC;
- #endif
- #endif
- vec4 czm_updatePositionDepth(vec4 coords) {
- #if defined(LOG_DEPTH)
- #ifdef SHADOW_MAP
- vec3 logPositionEC = (czm_inverseProjection * coords).xyz;
- v_logPositionEC = logPositionEC;
- #endif
- coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w;
- #endif
- return coords;
- }
- void czm_vertexLogDepth()
- {
- #ifdef LOG_DEPTH
- v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0;
- gl_Position = czm_updatePositionDepth(gl_Position);
- #endif
- }
- void czm_vertexLogDepth(vec4 clipCoords)
- {
- #ifdef LOG_DEPTH
- v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0;
- czm_updatePositionDepth(clipCoords);
- #endif
- }
- `;var nL=`vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)
- {
- float x = 2.0 * (fragmentCoordinate.x - czm_viewport.x) / czm_viewport.z - 1.0;
- float y = 2.0 * (fragmentCoordinate.y - czm_viewport.y) / czm_viewport.w - 1.0;
- float z = (fragmentCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];
- vec4 q = vec4(x, y, z, 1.0);
- q /= fragmentCoordinate.w;
- if (!(czm_inverseProjection == mat4(0.0)))
- {
- q = czm_inverseProjection * q;
- }
- else
- {
- float top = czm_frustumPlanes.x;
- float bottom = czm_frustumPlanes.y;
- float left = czm_frustumPlanes.z;
- float right = czm_frustumPlanes.w;
- float near = czm_currentFrustum.x;
- float far = czm_currentFrustum.y;
- q.x = (q.x * (right - left) + left + right) * 0.5;
- q.y = (q.y * (top - bottom) + bottom + top) * 0.5;
- q.z = (q.z * (near - far) - near - far) * 0.5;
- q.w = 1.0;
- }
- return q;
- }
- vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth)
- {
- #ifdef LOG_DEPTH
- float near = czm_currentFrustum.x;
- float far = czm_currentFrustum.y;
- float log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne;
- float depthFromNear = pow(2.0, log2Depth) - 1.0;
- float depthFromCamera = depthFromNear + near;
- vec4 windowCoord = vec4(fragmentCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0);
- vec4 eyeCoordinate = czm_windowToEyeCoordinates(windowCoord);
- eyeCoordinate.w = 1.0 / depthFromCamera;
- return eyeCoordinate;
- #else
- vec4 windowCoord = vec4(fragmentCoordinateXY, depthOrLogDepth, 1.0);
- vec4 eyeCoordinate = czm_windowToEyeCoordinates(windowCoord);
- #endif
- return eyeCoordinate;
- }
- `;var iL=`#if defined(GL_EXT_frag_depth) && !defined(LOG_DEPTH)
- varying float v_WindowZ;
- #endif
- void czm_writeDepthClamp()
- {
- #if defined(GL_EXT_frag_depth) && !defined(LOG_DEPTH)
- gl_FragDepthEXT = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0);
- #endif
- }
- `;var rL=`#ifdef LOG_DEPTH
- varying float v_depthFromNearPlusOne;
- #ifdef POLYGON_OFFSET
- uniform vec2 u_polygonOffset;
- #endif
- #endif
- void czm_writeLogDepth(float depth)
- {
- #if defined(GL_EXT_frag_depth) && defined(LOG_DEPTH)
- if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) {
- discard;
- }
- #ifdef POLYGON_OFFSET
- float factor = u_polygonOffset[0];
- float units = u_polygonOffset[1];
- #ifdef GL_OES_standard_derivatives
- float x = dFdx(depth);
- float y = dFdy(depth);
- float m = sqrt(x * x + y * y);
- depth += m * factor;
- #endif
- #endif
- gl_FragDepthEXT = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne;
- #ifdef POLYGON_OFFSET
- gl_FragDepthEXT += czm_epsilon7 * units;
- #endif
- #endif
- }
- void czm_writeLogDepth() {
- #ifdef LOG_DEPTH
- czm_writeLogDepth(v_depthFromNearPlusOne);
- #endif
- }
- `;var oL=`float czm_writeNonPerspective(float value, float w) {
- return value * w;
- }
- vec2 czm_writeNonPerspective(vec2 value, float w) {
- return value * w;
- }
- vec3 czm_writeNonPerspective(vec3 value, float w) {
- return value * w;
- }
- vec4 czm_writeNonPerspective(vec4 value, float w) {
- return value * w;
- }
- `;var sL=`vec3 czm_XYZToRGB(vec3 Yxy)
- {
- const mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,
- -1.5371, 1.8760, -0.2040,
- -0.4985, 0.0416, 1.0572);
- vec3 xyz;
- xyz.r = Yxy.r * Yxy.g / Yxy.b;
- xyz.g = Yxy.r;
- xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;
- return XYZ2RGB * xyz;
- }
- `;var aL=`vec3 czm_fromCartesian(vec3 position) {
- vec3 wgs84OneOverRadii = vec3(0.0000001567855942887398, 0.0000001567855942887398, 0.0000001573130351105623);
- vec3 wgs84OneOverRadiiSquared = vec3(0.00000000000002458172257647332, 0.00000000000002458172257647332, 0.000000000000024747391015697002);
- float centerToleranceSquared = 0.1;
- vec3 p = czm_scaleToGeodeticSurface(position, wgs84OneOverRadii, wgs84OneOverRadiiSquared);
- vec3 n = czm_multiplyComponents(p,wgs84OneOverRadiiSquared);
- n = normalize(n);
- vec3 h = p - position;
- float longitude = atan(n.y, n.x);
- float latitude = asin(n.z);
- float dotNum = dot(h, position);
- float height = czm_magnitude(h);
- vec3 result;
- result.x = longitude;
- result.y = latitude;
- result.z = height;
- return result;
- }
- `;var cL=`mat3 czm_getFloodRect(mat4 ypx,mat4 ypy,mat4 ypz,float minx,float miny,float minz,float maxx,float maxy,float maxz,int yp_max_index){
- for(int i=0;i<=16;i++){
- mat3 xyxy = czm_getIndexMat(i,ypx,ypy,ypz,yp_max_index);
- if(xyxy[0][0]!=0.0&&xyxy[0][1]!=0.0){
- if(xyxy[0][0]<minx){
- minx = xyxy[0][0];
- }
- if(xyxy[0][0]>maxx){
- maxx = xyxy[0][0];
- }
- if(xyxy[0][1]<miny){
- miny = xyxy[0][1];
- }
- if(xyxy[0][1]>maxy){
- maxy = xyxy[0][1];
- }
- if(xyxy[0][2]<minz){
- minz = xyxy[0][2];
- }
- if(xyxy[0][2]>maxz){
- maxz = xyxy[0][2];
- }
- }
- }
- return mat3(minx-999.0,miny-999.0,minz-999.0,maxx+999.0,maxy+999.0,maxz+999.0,0.0,0.0,0.0);
- }
- `;var lL=`mat3 czm_getIndexMat(int index,mat4 ypx,mat4 ypy,mat4 ypz,int yp_max_index){
- vec3 val = czm_getMaxIndexVal (ypx,ypy,ypz,yp_max_index-1);
- if(index==0){
- return mat3(ypx[0][0],ypy[0][0],ypz[0][0],val.x,val.y,val.z,0.0,0.0,0.0);
- }
- if(index==1){
- return mat3(ypx[0][1],ypy[0][1],ypz[0][1], ypx[0][0],ypy[0][0],ypz[0][0],0.0,0.0,0.0);
- }
- if(index==2){
- return mat3(ypx[0][2],ypy[0][2],ypz[0][2], ypx[0][1],ypy[0][1],ypz[0][1],0.0,0.0,0.0);
- }
- if(index==3){
- return mat3(ypx[0][3],ypy[0][3],ypz[0][3], ypx[0][2],ypy[0][2],ypz[0][2],0.0,0.0,0.0);
- }
- if(index==4){
- return mat3(ypx[1][0],ypy[1][0],ypz[1][0], ypx[0][3],ypy[0][3],ypz[0][3],0.0,0.0,0.0);
- }
- if(index==5){
- return mat3(ypx[1][1],ypy[1][1],ypz[1][1], ypx[1][0],ypy[1][0],ypz[1][0],0.0,0.0,0.0);
- }
- if(index==6){
- return mat3(ypx[1][2],ypy[1][2],ypz[1][2], ypx[1][1],ypy[1][1],ypz[1][1],0.0,0.0,0.0);
- }
- if(index==7){
- return mat3(ypx[1][3],ypy[1][3],ypz[1][3], ypx[1][2],ypy[1][2],ypz[1][2],0.0,0.0,0.0);
- }
- if(index==8){
- return mat3(ypx[2][0],ypy[2][0],ypz[2][0], ypx[1][3],ypy[1][3],ypz[1][3],0.0,0.0,0.0);
- }
- if(index==9){
- return mat3(ypx[2][1],ypy[2][1],ypz[2][1], ypx[2][0],ypy[2][0],ypz[2][0],0.0,0.0,0.0);
- }
- if(index==10){
- return mat3(ypx[2][2],ypy[2][2],ypz[2][2], ypx[2][1],ypy[2][1],ypz[2][1],0.0,0.0,0.0);
- }
- if(index==11){
- return mat3(ypx[2][3],ypy[2][3],ypz[2][3], ypx[2][2],ypy[2][2],ypz[2][2],0.0,0.0,0.0);
- }
- if(index==12){
- return mat3(ypx[3][0],ypy[3][0],ypz[3][0], ypx[2][3],ypy[2][3],ypz[2][3],0.0,0.0,0.0);
- }
- if(index==13){
- return mat3(ypx[3][1],ypy[3][1],ypz[3][1], ypx[3][0],ypy[3][0],ypz[3][0],0.0,0.0,0.0);
- }
- if(index==14){
- return mat3(ypx[3][2],ypy[3][2],ypz[3][2], ypx[3][1],ypy[3][1],ypz[3][1],0.0,0.0,0.0);
- }
- if(index==15){
- return mat3(ypx[3][3],ypy[3][3],ypz[3][3], ypx[3][2],ypy[3][2],ypz[3][2],0.0,0.0,0.0);
- }
- }
- `;var uL=`int czm_getMaxIndex(mat4 yp_mat_x){
- if(yp_mat_x[3][3]!=0.0){
- return 16;
- }
- if(yp_mat_x[3][2]!=0.0){
- return 15;
- }
- if(yp_mat_x[3][1]!=0.0){
- return 14;
- }
- if(yp_mat_x[3][0]!=0.0){
- return 15;
- }
- if(yp_mat_x[2][3]!=0.0){
- return 12;
- }
- if(yp_mat_x[2][2]!=0.0){
- return 11;
- }
- if(yp_mat_x[2][1]!=0.0){
- return 10;
- }
- if(yp_mat_x[2][0]!=0.0){
- return 9;
- }
- if(yp_mat_x[1][3]!=0.0){
- return 8;
- }
- if(yp_mat_x[1][2]!=0.0){
- return 7;
- }
- if(yp_mat_x[1][1]!=0.0){
- return 6;
- }
- if(yp_mat_x[1][0]!=0.0){
- return 5;
- }
- if(yp_mat_x[0][3]!=0.0){
- return 4;
- }
- if(yp_mat_x[0][2]!=0.0){
- return 3;
- }
- if(yp_mat_x[0][1]!=0.0){
- return 2;
- }
- if(yp_mat_x[0][0]!=0.0){
- return 1;
- }
- }
- `;var fL=`vec3 czm_getMaxIndexVal(mat4 ypx,mat4 ypy,mat4 ypz,int yp_max_index){
- if(yp_max_index==0){
- return vec3(ypx[0][0],ypy[0][0],ypz[0][0]);
- }
- if(yp_max_index==1){
- return vec3(ypx[0][1],ypy[0][1],ypz[0][1]);
- }
- if(yp_max_index==2){
- return vec3(ypx[0][2],ypy[0][2],ypz[0][2]);
- }
- if(yp_max_index==3){
- return vec3(ypx[0][3],ypy[0][3],ypz[0][3]);
- }
- if(yp_max_index==4){
- return vec3(ypx[1][0],ypy[1][0],ypz[1][0]);
- }
- if(yp_max_index==5){
- return vec3(ypx[1][1],ypy[1][1],ypz[1][1]);
- }
- if(yp_max_index==6){
- return vec3(ypx[1][2],ypy[1][2],ypz[1][2]);
- }
- if(yp_max_index==7){
- return vec3(ypx[1][3],ypy[1][3],ypz[1][3]);
- }
- if(yp_max_index==8){
- return vec3(ypx[2][0],ypy[2][0],ypz[2][0]);
- }
- if(yp_max_index==9){
- return vec3(ypx[2][1],ypy[2][1],ypz[2][1]);
- }
- if(yp_max_index==10){
- return vec3(ypx[2][2],ypy[2][2],ypz[2][2]);
- }
- if(yp_max_index==11){
- return vec3(ypx[2][3],ypy[2][3],ypz[2][3]);
- }
- if(yp_max_index==12){
- return vec3(ypx[3][0],ypy[3][0],ypz[3][0]);
- }
- if(yp_max_index==13){
- return vec3(ypx[3][1],ypy[3][1],ypz[3][1]);
- }
- if(yp_max_index==14){
- return vec3(ypx[3][2],ypy[3][2],ypz[3][2]);
- }
- if(yp_max_index==15){
- return vec3(ypx[3][3],ypy[3][3],ypz[3][3]);
- }
- }
- `;var dL=`bool czm_isInEllipsoid (vec3 position,mat4 ypx,mat4 ypy,mat4 ypz,mat3 rect,int yp_max_index) {
- bool isIn = false;
- float px = position.x;
- float py = position.y;
- float pz = position.z;
- if(px>=rect[0][0] && py>=rect[0][1] && pz>=rect[0][2] && px<=rect[1][0] && py<=rect[1][1] && pz<=rect[1][2]){
- vec3 lonlat = czm_fromCartesian(position);
- px = lonlat.x;
- py = lonlat.y;
- for(int i = 0;i <= 16; i++){
- vec3 currVal = czm_getMaxIndexVal(ypx,ypy,ypz,i);
- mat3 xyzxyz = czm_getIndexMat(i,ypx,ypy,ypz,yp_max_index);
- vec3 pos1 = vec3(xyzxyz[0][0],xyzxyz[0][1],xyzxyz[0][2]);
- vec3 pos2 = vec3(xyzxyz[1][0],xyzxyz[1][1],xyzxyz[1][2]);
- vec3 llh1 = czm_fromCartesian(pos1);
- vec3 llh2 = czm_fromCartesian(pos2);
- float sx = llh1.x;
- float sy = llh1.y;
- float tx = llh2.x;
- float ty = llh2.y;
- if(sx!=0.0&&sy!=0.0&&tx!=0.0&&ty!=0.0){
- if((sx == px && sy == py) || (tx == px && ty == py)) {
- return true;
- }
- if((sy < py && ty >= py) || (sy >= py && ty < py)) {
- float x = sx + (py - sy) * (tx - sx) / (ty - sy);
- if(x == px) {
- return true;
- }
- if(x > px) {
- isIn = !isIn;
- }
- }
- }
- }
- }
- return isIn ? true : false;
- }
- `;var hL=`bool czm_isInObliq(vec3 position,mat4 ypx,mat4 ypy,mat4 ypz,mat3 rect,int yp_max_index) {
- bool isIn = false;
- float px = position.x;
- float py = position.y;
- if(px>=rect[0][0]&&py>=rect[0][1]&&px<=rect[1][0]&&py<=rect[1][1]){
- for(int i = 0;i <= 16; i++){
- vec3 currVal = czm_getMaxIndexVal(ypx,ypy,ypz,i);
- if(currVal.x!=0.0&&currVal.y!=0.0){
- mat3 xyxy = czm_getIndexMat(i,ypx,ypy,ypz,yp_max_index);
- float sx = xyxy[0][0];
- float sy = xyxy[0][1];
- float tx = xyxy[1][0];
- float ty = xyxy[1][1];
- if(sx!=0.0&&sy!=0.0&&tx!=0.0&&ty!=0.0){
- if((sx == px && sy == py) || (tx == px && ty == py)) {
- return true;
- }
- if((sy < py && ty >= py) || (sy >= py && ty < py)) {
- float x = sx + (py - sy) * (tx - sx) / (ty - sy);
- if(x == px) {
- return true;
- }
- if(x > px) {
- isIn = !isIn;
- }
- }
- }
- }
- }
- }
- return isIn ? true : false;
- }
- `;var mL=`float czm_magnitude(vec3 cartesian3) {
- return sqrt(czm_magnitudeSquared(cartesian3));
- }
- `;var pL=`float czm_magnitudeSquared (vec3 cartesian4) {
- return cartesian4.x * cartesian4.x + cartesian4.y * cartesian4.y + cartesian4.z * cartesian4.z;
- }
- `;var _L=`vec3 czm_multiplyComponents(vec3 left, vec3 right) {
- vec3 result;
- result.x = left.x * right.x;
- result.y = left.y * right.y;
- result.z = left.z * right.z;
- return result;
- }
- `;var gL=`vec3 czm_scaleToGeodeticSurface(vec3 cartesian1, vec3 oneOverRadii, vec3 oneOverRadiiSquared) {
- float positionX = cartesian1.x;
- float positionY = cartesian1.y;
- float positionZ = cartesian1.z;
- float oneOverRadiiX = oneOverRadii.x;
- float oneOverRadiiY = oneOverRadii.y;
- float oneOverRadiiZ = oneOverRadii.z;
- float x2 = positionX * positionX * oneOverRadiiX * oneOverRadiiX;
- float y2 = positionY * positionY * oneOverRadiiY * oneOverRadiiY;
- float z2 = positionZ * positionZ * oneOverRadiiZ * oneOverRadiiZ;
- float squaredNorm = x2 + y2 + z2;
- float ratio = sqrt(1.0 / squaredNorm);
- vec3 intersection = cartesian1*ratio;
- float oneOverRadiiSquaredX = oneOverRadiiSquared.x;
- float oneOverRadiiSquaredY = oneOverRadiiSquared.y;
- float oneOverRadiiSquaredZ = oneOverRadiiSquared.z;
- vec3 gradient;
- gradient.x = intersection.x * oneOverRadiiSquaredX * 2.0;
- gradient.y = intersection.y * oneOverRadiiSquaredY * 2.0;
- gradient.z = intersection.z * oneOverRadiiSquaredZ * 2.0;
- float lambda = (1.0 - ratio) * czm_magnitude(cartesian1) / (0.5 * czm_magnitude(gradient));
- float correction = 0.0;
- float func;
- float denominator;
- float xMultiplier;
- float yMultiplier;
- float zMultiplier;
- float xMultiplier2;
- float yMultiplier2;
- float zMultiplier2;
- float xMultiplier3;
- float yMultiplier3;
- float zMultiplier3;
- func = 1.0;
- for(int i=0;i<9;i++){
- if(abs(func) > 0.000000000001){
- lambda -= correction;
- xMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredX);
- yMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredY);
- zMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredZ);
- xMultiplier2 = xMultiplier * xMultiplier;
- yMultiplier2 = yMultiplier * yMultiplier;
- zMultiplier2 = zMultiplier * zMultiplier;
- xMultiplier3 = xMultiplier2 * xMultiplier;
- yMultiplier3 = yMultiplier2 * yMultiplier;
- zMultiplier3 = zMultiplier2 * zMultiplier;
- func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1.0;
- denominator = x2 * xMultiplier3 * oneOverRadiiSquaredX + y2 * yMultiplier3 * oneOverRadiiSquaredY + z2 * zMultiplier3 * oneOverRadiiSquaredZ;
- float derivative = -2.0 * denominator;
- correction = func / derivative;
- }else{
- break;
- }
- }
- vec3 result;
- result.x = positionX * xMultiplier;
- result.y = positionY * yMultiplier;
- result.z = positionZ * zMultiplier;
- return result;
- }
- `;var TT={czm_degreesPerRadian:UR,czm_depthRange:zR,czm_epsilon1:HR,czm_epsilon2:GR,czm_epsilon3:WR,czm_epsilon4:jR,czm_epsilon5:qR,czm_epsilon6:YR,czm_epsilon7:XR,czm_infinity:KR,czm_oneOverPi:$R,czm_oneOverTwoPi:ZR,czm_passCesium3DTile:JR,czm_passCesium3DTileClassification:QR,czm_passCesium3DTileClassificationIgnoreShow:eM,czm_passClassification:tM,czm_passCompute:nM,czm_passEnvironment:iM,czm_passGlobe:rM,czm_passOpaque:oM,czm_passOverlay:sM,czm_passTerrainClassification:aM,czm_passTranslucent:cM,czm_pi:lM,czm_piOverFour:uM,czm_piOverSix:fM,czm_piOverThree:dM,czm_piOverTwo:hM,czm_radiansPerDegree:mM,czm_sceneMode2D:pM,czm_sceneMode3D:_M,czm_sceneModeColumbusView:gM,czm_sceneModeMorphing:yM,czm_solarRadius:xM,czm_threePiOver2:CM,czm_twoPi:AM,czm_webMercatorMaxLatitude:TM,czm_depthRangeStruct:bM,czm_material:EM,czm_materialInput:SM,czm_modelMaterial:wM,czm_modelVertexOutput:vM,czm_pbrParameters:DM,czm_ray:PM,czm_raySegment:IM,czm_shadowParameters:OM,czm_acesTonemapping:RM,czm_alphaWeight:MM,czm_antialias:BM,czm_approximateSphericalCoordinates:LM,czm_backFacing:NM,czm_branchFreeTernary:FM,czm_cascadeColor:VM,czm_cascadeDistance:kM,czm_cascadeMatrix:UM,czm_cascadeWeights:zM,czm_columbusViewMorph:HM,czm_computePosition:GM,czm_cosineAndSine:WM,czm_decompressTextureCoordinates:jM,czm_defaultPbrMaterial:qM,czm_depthClamp:YM,czm_eastNorthUpToEyeCoordinates:XM,czm_ellipsoidContainsPoint:KM,czm_ellipsoidWgs84TextureCoordinates:$M,czm_equalsEpsilon:ZM,czm_eyeOffset:JM,czm_eyeToWindowCoordinates:QM,czm_fastApproximateAtan:eB,czm_fog:tB,czm_gammaCorrect:nB,czm_geodeticSurfaceNormal:iB,czm_getDefaultMaterial:rB,czm_getLambertDiffuse:oB,czm_getSpecular:sB,czm_getWaterNoise:aB,czm_HSBToRGB:cB,czm_HSLToRGB:lB,czm_hue:uB,czm_inverseGamma:fB,czm_isEmpty:dB,czm_isFull:hB,czm_latitudeToWebMercatorFraction:mB,czm_linearToSrgb:pB,czm_lineDistance:_B,czm_luminance:gB,czm_metersPerPixel:yB,czm_modelToWindowCoordinates:xB,czm_multiplyWithColorBalance:CB,czm_nearFarScalar:AB,czm_octDecode:TB,czm_packDepth:bB,czm_pbrLighting:EB,czm_pbrMetallicRoughnessMaterial:SB,czm_pbrSpecularGlossinessMaterial:wB,czm_phong:vB,czm_planeDistance:DB,czm_pointAlongRay:PB,czm_rayEllipsoidIntersectionInterval:IB,czm_raySphereIntersectionInterval:OB,czm_readDepth:RB,czm_readNonPerspective:MB,czm_reverseLogDepth:BB,czm_RGBToHSB:LB,czm_RGBToHSL:NB,czm_RGBToXYZ:FB,czm_round:VB,czm_sampleOctahedralProjection:kB,czm_saturation:UB,czm_shadowDepthCompare:zB,czm_shadowVisibility:HB,czm_signNotZero:GB,czm_sphericalHarmonics:WB,czm_srgbToLinear:jB,czm_tangentToEyeSpaceMatrix:qB,czm_transformPlane:YB,czm_translateRelativeToEye:XB,czm_translucentPhong:KB,czm_transpose:$B,czm_unpackDepth:ZB,czm_unpackFloat:JB,czm_unpackUint:QB,czm_valueTransform:eL,czm_vertexLogDepth:tL,czm_windowToEyeCoordinates:nL,czm_writeDepthClamp:iL,czm_writeLogDepth:rL,czm_writeNonPerspective:oL,czm_XYZToRGB:sL,czm_fromCartesian:aL,czm_getFloodRect:cL,czm_getIndexMat:lL,czm_getMaxIndex:uL,czm_getMaxIndexVal:fL,czm_isInEllipsoid:dL,czm_isInObliq:hL,czm_magnitude:mL,czm_magnitudeSquared:pL,czm_multiplyComponents:_L,czm_scaleToGeodeticSurface:gL};function Kie(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let r=0;r<n;++r)i+=`
- `;return i})}function $ie(e,t,n){let i;for(let r=0;r<n.length;++r)n[r].name===e&&(i=n[r]);return l(i)||(t=Kie(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function Zie(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);l(n)&&n!==null&&(n=n.filter(function(i,r){return n.indexOf(i)===r}),n.forEach(function(i){if(i!==e.name&&Hs._czmBuiltinsAndUniforms.hasOwnProperty(i)){let r=$ie(i,Hs._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(r),r.requiredBy.push(e),Zie(r,t)}}))}function xFe(e){let t=[],n=[];for(;e.length>0;){let r=e.pop();n.push(r),r.requiredBy.length===0&&t.push(r)}for(;t.length>0;){let r=t.shift();e.push(r);for(let o=0;o<r.dependsOn.length;++o){let s=r.dependsOn[o],a=s.requiredBy.indexOf(r);s.requiredBy.splice(a,1),s.requiredBy.length===0&&t.push(s)}}let i=[];for(let r=0;r<n.length;++r)n[r].requiredBy.length!==0&&i.push(n[r])}function CFe(e){let t=[],n=$ie("main",e,t);Zie(n,t),xFe(t);let i="";for(let r=t.length-1;r>=0;--r)i=`${i+t[r].glslSource}
- `;return i.replace(n.glslSource,"")}function Jie(e,t,n){let i,r,o="",s=e.sources;if(l(s))for(i=0,r=s.length;i<r;++i)o+=`
- #line 0
- ${s[i]}`;o=Kie(o);let a;o=o.replace(/#version\s+(.*?)\n/gm,function(g,m){return a=m,`
- `});let c=[];o=o.replace(/#extension.*\n/gm,function(g){return c.push(g),`
- `}),o=o.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let u=e.pickColorQualifier;l(u)&&(o=Hs.createPickFragmentShaderSource(o,u));let f="";l(a)&&(f=`#version ${a}
- `);let d=c.length;for(i=0;i<d;i++)f+=c[i];t&&(f+=`#ifdef GL_FRAGMENT_PRECISION_HIGH
- precision highp float;
- precision highp int;
- #else
- precision mediump float;
- precision mediump int;
- #define highp mediump
- #endif
- `);let p=e.defines;if(l(p))for(i=0,r=p.length;i<r;++i){let g=p[i];g.length!==0&&(f+=`#define ${g}
- `)}return n.webgl2&&(f+=`#define OUTPUT_DECLARATION
- `),n.textureFloatLinear&&(f+=`#define OES_texture_float_linear
- `),n.floatingPointTexture&&(f+=`#define OES_texture_float
- `),e.includeBuiltIns&&(f+=CFe(o)),f+=`
- #line 0
- `,f+=o,n.webgl2&&(f=kR(f,t,!0)),f}function Hs(e){e=y(e,y.EMPTY_OBJECT);let t=e.pickColorQualifier;this.defines=l(e.defines)?e.defines.slice(0):[],this.sources=l(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=y(e.includeBuiltIns,!0)}Hs.prototype.clone=function(){return new Hs({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};Hs.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};Hs.prototype.createCombinedVertexShader=function(e){return Jie(this,!1,e)};Hs.prototype.createCombinedFragmentShader=function(e){return Jie(this,!0,e)};Hs._czmBuiltinsAndUniforms={};for(let e in TT)TT.hasOwnProperty(e)&&(Hs._czmBuiltinsAndUniforms[e]=TT[e]);for(let e in dg)if(dg.hasOwnProperty(e)){let t=dg[e];typeof t.getDeclaration=="function"&&(Hs._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}Hs.createPickVertexShaderSource=function(e){return`${Hs.replaceMain(e,"czm_old_main")}
- attribute vec4 pickColor;
- varying vec4 czm_pickColor;
- void main()
- {
- czm_old_main();
- czm_pickColor = pickColor;
- }`};Hs.createPickFragmentShaderSource=function(e,t){let n=Hs.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor;
- void main()
- {
- czm_old_main();
- if (gl_FragColor.a == 0.0) {
- discard;
- }
- gl_FragColor = czm_pickColor;
- }`;return`${n}
- ${i}`};function AFe(e,t){let n=e.defines,i=n.length;for(let r=0;r<i;++r)if(n[r]===t)return!0;return!1}function Qie(e,t){let n=e.sources,i=n.length;for(let r=0;r<i;++r)if(n[r].indexOf(t)!==-1)return!0;return!1}function ere(e,t){let n=t.length;for(let i=0;i<n;++i){let r=t[i];if(Qie(e,r))return r}}var TFe=["v_normalEC","v_normal"];Hs.findNormalVarying=function(e){return Qie(e,"#ifdef HAS_NORMALS")?AFe(e,"HAS_NORMALS")?"v_normalEC":void 0:ere(e,TFe)};var bFe=["v_positionEC"];Hs.findPositionVarying=function(e){return ere(e,bFe)};var Fe=Hs;var yL=`attribute vec3 position3DHigh;
- attribute vec3 position3DLow;
- attribute float batchId;
- #ifdef EXTRUDED_GEOMETRY
- attribute vec3 extrudeDirection;
- uniform float u_globeMinimumAltitude;
- #endif // EXTRUDED_GEOMETRY
- #ifdef PER_INSTANCE_COLOR
- varying vec4 v_color;
- #endif // PER_INSTANCE_COLOR
- #ifdef TEXTURE_COORDINATES
- #ifdef SPHERICAL
- varying vec4 v_sphericalExtents;
- #else // SPHERICAL
- varying vec2 v_inversePlaneExtents;
- varying vec4 v_westPlane;
- varying vec4 v_southPlane;
- #endif // SPHERICAL
- varying vec3 v_uvMinAndSphericalLongitudeRotation;
- varying vec3 v_uMaxAndInverseDistance;
- varying vec3 v_vMaxAndInverseDistance;
- #endif // TEXTURE_COORDINATES
- void main()
- {
- vec4 position = czm_computePosition();
- #ifdef EXTRUDED_GEOMETRY
- float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));
- delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0;
- position = position + vec4(extrudeDirection * delta, 0.0);
- #endif
- #ifdef TEXTURE_COORDINATES
- #ifdef SPHERICAL
- v_sphericalExtents = czm_batchTable_sphericalExtents(batchId);
- v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId);
- #else // SPHERICAL
- #ifdef COLUMBUS_VIEW_2D
- vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId);
- vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId);
- vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w));
- bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0;
- planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w);
- planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w);
- idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0;
- idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x));
- planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x);
- planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x);
- vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz;
- vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz;
- vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz;
- #else // COLUMBUS_VIEW_2D
- vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz;
- vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner;
- vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner;
- #endif // COLUMBUS_VIEW_2D
- vec3 eastWard = southEastCorner - southWestCorner;
- float eastExtent = length(eastWard);
- eastWard /= eastExtent;
- vec3 northWard = northWestCorner - southWestCorner;
- float northExtent = length(northWard);
- northWard /= northExtent;
- v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner));
- v_southPlane = vec4(northWard, -dot(northWard, southWestCorner));
- v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent);
- #endif // SPHERICAL
- vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId);
- vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId);
- v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z);
- v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w);
- v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy;
- #endif // TEXTURE_COORDINATES
- #ifdef PER_INSTANCE_COLOR
- v_color = czm_batchTable_color(batchId);
- #endif
- gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position);
- }
- `;var Zy=`#ifdef GL_EXT_frag_depth
- #extension GL_EXT_frag_depth : enable
- #endif
- #ifdef VECTOR_TILE
- uniform vec4 u_highlightColor;
- #endif
- void main(void)
- {
- #ifdef VECTOR_TILE
- gl_FragColor = czm_gammaCorrect(u_highlightColor);
- #else
- gl_FragColor = vec4(1.0);
- #endif
- czm_writeDepthClamp();
- }
- `;var tre={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};tre.NUMBER_OF_CLASSIFICATION_TYPES=3;var qn=Object.freeze(tre);var EFe={NEVER:Z.NEVER,LESS:Z.LESS,EQUAL:Z.EQUAL,LESS_OR_EQUAL:Z.LEQUAL,GREATER:Z.GREATER,NOT_EQUAL:Z.NOTEQUAL,GREATER_OR_EQUAL:Z.GEQUAL,ALWAYS:Z.ALWAYS},wc=Object.freeze(EFe);var xL={STREAM_DRAW:Z.STREAM_DRAW,STATIC_DRAW:Z.STATIC_DRAW,DYNAMIC_DRAW:Z.DYNAMIC_DRAW,validate:function(e){return e===xL.STREAM_DRAW||e===xL.STATIC_DRAW||e===xL.DYNAMIC_DRAW}},Ne=Object.freeze(xL);function Ju(e){e=y(e,y.EMPTY_OBJECT);let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,r=e.sizeInBytes,o=e.usage,s=l(i);s&&(r=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:r,o),t.bindBuffer(n,null),this._id=Ln(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=r,this._usage=o,this._buffer=a,this.vertexArrayDestroyable=!0}Ju.createVertexBuffer=function(e){return new Ju({context:e.context,bufferTarget:Z.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Ju.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Le.getSizeInBytes(n),r=new Ju({context:t,bufferTarget:Z.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),o=r.sizeInBytes/i;return Object.defineProperties(r,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return o}}}),r};Object.defineProperties(Ju.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Ju.prototype._getBuffer=function(){return this._buffer};Ju.prototype.copyFromArrayView=function(e,t){t=y(t,0);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};Ju.prototype.copyFromBuffer=function(e,t,n,i){let r=Z.COPY_READ_BUFFER,o=Z.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(o,this._buffer),s.bindBuffer(r,e._buffer),s.copyBufferSubData(r,o,t,n,i),s.bindBuffer(o,null),s.bindBuffer(r,null)};Ju.prototype.getBufferData=function(e,t,n,i){t=y(t,0),n=y(n,0);let r=this._gl,o=Z.COPY_READ_BUFFER;r.bindBuffer(o,this._buffer),r.getBufferSubData(o,t,e,n,i),r.bindBuffer(o,null)};Ju.prototype.isDestroyed=function(){return!1};Ju.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ue(this)};var at=Ju;function SFe(e,t,n,i){let r=l(t.vertexBuffer),o=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:y(t.index,n),enabled:y(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:o?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:y(t.componentDatatype,K.FLOAT),normalize:y(t.normalize,!1),offsetInBytes:y(t.offsetInBytes,0),strideInBytes:y(t.strideInBytes,0),instanceDivisor:y(t.instanceDivisor,0)};if(r)a.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function ire(e,t,n){for(let i=0;i<t.length;++i){let r=t[i];r.enabled&&r.vertexAttrib(e)}l(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function fp(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,i=e.attributes,r=e.indexBuffer,o,s=[],a=1,c=!1,u=!1,f=i.length;for(o=0;o<f;++o)SFe(s,i[o],o,t);for(f=s.length,o=0;o<f;++o){let p=s[o];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let g=p.strideInBytes||p.componentsPerAttribute*K.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/g;break}}for(o=0;o<f;++o)s[o].instanceDivisor>0&&(c=!0),l(s[o].value)&&(u=!0);let d;t.vertexArrayObject&&(d=t.glCreateVertexArray(),t.glBindVertexArray(d),ire(n,s,r),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=d,this._attributes=s,this._indexBuffer=r}function nre(e){return e.values.length/e.componentsPerAttribute}function wFe(e){return K.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function vFe(e){let t,n,i,r=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(r.push(n),e[n].componentDatatype===K.DOUBLE&&(e[n].componentDatatype=K.FLOAT,e[n].values=K.createTypedArray(K.FLOAT,e[n].values)));let o,s=r.length;if(s>0)for(o=nre(e[r[0]]),t=1;t<s;++t){let u=nre(e[r[t]]);if(u!==o)throw new fe(`Each attribute list must have the same number of vertices. Attribute ${r[t]} has a different number of vertices (${u.toString()}) than attribute ${r[0]} (${o.toString()}).`)}r.sort(function(u,f){return K.getSizeInBytes(e[f].componentDatatype)-K.getSizeInBytes(e[u].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=r[t],i=e[n],c[n]=a,a+=wFe(i);if(a>0){let u=K.getSizeInBytes(e[r[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let d=o*a,p=new ArrayBuffer(d),g={};for(t=0;t<s;++t){n=r[t];let m=K.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:K.createTypedArray(e[n].componentDatatype,p),index:c[n]/m,strideInComponentType:a/m}}for(t=0;t<o;++t)for(let m=0;m<s;++m){n=r[m],i=e[n];let x=i.values,C=g[n],A=C.pointer,b=i.componentsPerAttribute;for(let T=0;T<b;++T)A[C.index+T]=x[t*b+T];C.index+=C.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}fp.fromGeometry=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=y(e.geometry,y.EMPTY_OBJECT),i=y(e.bufferUsage,Ne.DYNAMIC_DRAW),r=y(e.attributeLocations,y.EMPTY_OBJECT),o=y(e.interleave,!1),s=e.vertexArrayAttributes,a,c,u,f=l(s)?s:[],d=n.attributes;if(o){let m=vFe(d);if(l(m)){u=at.createVertexBuffer({context:t,typedArray:m.buffer,usage:i});let x=m.offsetsInBytes,C=m.vertexSizeInBytes;for(a in d)d.hasOwnProperty(a)&&l(d[a])&&(c=d[a],l(c.values)?f.push({index:r[a],vertexBuffer:u,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:x[a],strideInBytes:C}):f.push({index:r[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in d)if(d.hasOwnProperty(a)&&l(d[a])){c=d[a];let m=c.componentDatatype;m===K.DOUBLE&&(m=K.FLOAT),u=void 0,l(c.values)&&(u=at.createVertexBuffer({context:t,typedArray:K.createTypedArray(m,c.values),usage:i})),f.push({index:r[a],vertexBuffer:u,value:c.value,componentDatatype:m,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize})}let p,g=n.indices;return l(g)&&(ot.computeNumberOfVertices(n)>=M.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=at.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Le.UNSIGNED_INT}):p=at.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Le.UNSIGNED_SHORT})),new fp({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(fp.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});fp.prototype.getAttribute=function(e){return this._attributes[e]};function DFe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,r=e._attributes,o=Bt.maximumVertexAttributes,s;if(n){let a=r.length;for(s=0;s<a;++s){let c=r[s];if(c.enabled){let u=c.instanceDivisor,f=c.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(s=0;s<o;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function PFe(e,t){let n=e._attributes,i=n.length;for(let r=0;r<i;++r){let o=n[r];o.enabled&&l(o.value)&&o.vertexAttrib(t)}}fp.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&DFe(this),this._hasConstantAttributes&&PFe(this,this._gl)):ire(this._gl,this._attributes,this._indexBuffer)};fp.prototype._unBind=function(){if(l(this._vao))this._context.glBindVertexArray(null);else{let e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){let i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}};fp.prototype.isDestroyed=function(){return!1};fp.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;l(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return l(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),l(this._vao)&&this._context.glDeleteVertexArray(this._vao),ue(this)};var Qn=fp;function dp(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=IFe(t),r=e.floatingPointTexture,o=i===qe.FLOAT&&!r,s=OFe(t,o),a=RFe(s,t,o),c=Math.floor(Bt.maximumTextureSize/a),u=Math.min(n,c),f=a*u,d=Math.ceil(n/u),p=1/f,g=p*.5,m=1/d,x=m*.5;this._textureDimensions=new W(f,d),this._textureStep=new se(p,g,m,x),this._pixelDatatype=o?qe.UNSIGNED_BYTE:i,this._packFloats=o,this._offsets=s,this._stride=a,this._texture=void 0;let C=4*f*d;this._batchValues=i===qe.FLOAT&&!o?new Float32Array(C):new Uint8Array(C),this._batchValuesDirty=!1}Object.defineProperties(dp.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function IFe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==K.UNSIGNED_BYTE){t=!0;break}return t?qe.FLOAT:qe.UNSIGNED_BYTE}function ore(e,t){let n=e[t].componentsPerAttribute;return n===2?W:n===3?h:n===4?se:Number}function OFe(e,t){let n=new Array(e.length),i=0,r=e.length;for(let o=0;o<r;++o){let a=e[o].componentDatatype;n[o]=i,a!==K.UNSIGNED_BYTE&&t?i+=4:++i}return n}function RFe(e,t,n){let i=e.length,r=e[i-1];return t[i-1].componentDatatype!==K.UNSIGNED_BYTE&&n?r+4:r+1}var xw=new se;function MFe(e,t,n){let i=se.unpack(e,t,xw),r=se.unpackFloat(i);i=se.unpack(e,t+4,xw);let o=se.unpackFloat(i);i=se.unpack(e,t+8,xw);let s=se.unpackFloat(i);i=se.unpack(e,t+12,xw);let a=se.unpackFloat(i);return se.fromElements(r,o,s,a,n)}function BFe(e,t,n){let i=se.packFloat(e.x,xw);se.pack(i,t,n),i=se.packFloat(e.y,i),se.pack(i,t,n+4),i=se.packFloat(e.z,i),se.pack(i,t,n+8),i=se.packFloat(e.w,i),se.pack(i,t,n+12)}var rre=new se;dp.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,r=this._offsets[t],o=this._stride,s=4*o*e+4*r,a;this._packFloats&&i[t].componentDatatype!==qe.UNSIGNED_BYTE?a=MFe(this._batchValues,s,rre):a=se.unpack(this._batchValues,s,rre);let c=ore(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var LFe=[void 0,void 0,new W,new h,new se],NFe=new se;dp.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,r=LFe[i[t].componentsPerAttribute],o=this.getBatchedAttribute(e,t,r),s=ore(this._attributes,t);if(l(s.equals)?s.equals(o,n):o===n)return;let c=NFe;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;let u=this._offsets[t],f=this._stride,d=4*f*e+4*u;this._packFloats&&i[t].componentDatatype!==qe.UNSIGNED_BYTE?BFe(c,this._batchValues,d):se.pack(c,this._batchValues,d),this._batchValuesDirty=!0};function FFe(e,t){let n=e._textureDimensions;e._texture=new wt({context:t,pixelFormat:ct.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:on.NEAREST,flipY:!1})}function VFe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}dp.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||FFe(this,e.context),VFe(this))};dp.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:rt(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function kFe(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep;
- vec2 computeSt(float batchId)
- {
- float stepX = batchTextureStep.x;
- float centerX = batchTextureStep.y;
- float numberOfAttributes = float(${t});
- return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5);
- }
- `:`uniform vec4 batchTextureStep;
- uniform vec2 batchTextureDimensions;
- vec2 computeSt(float batchId)
- {
- float stepX = batchTextureStep.x;
- float centerX = batchTextureStep.y;
- float stepY = batchTextureStep.z;
- float centerY = batchTextureStep.w;
- float numberOfAttributes = float(${t});
- float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x);
- float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x);
- return vec2(centerX + (xId * stepX), centerY + (yId * stepY));
- }
- `}function UFe(e){return e===1?"float":`vec${e}`}function zFe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function HFe(e,t){let i=e._attributes[t],r=i.componentsPerAttribute,o=i.functionName,s=UFe(r),a=zFe(r),c=e._offsets[t],u=`${s} ${o}(float batchId)
- {
- vec2 st = computeSt(batchId);
- st.x += batchTextureStep.x * float(${c});
- `;return e._packFloats&&i.componentDatatype!==qe.UNSIGNED_BYTE?u+=`vec4 textureValue;
- textureValue.x = czm_unpackFloat(texture2D(batchTexture, st));
- textureValue.y = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x, 0.0)));
- textureValue.z = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0)));
- textureValue.w = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0)));
- `:u+=` vec4 textureValue = texture2D(batchTexture, st);
- `,u+=` ${s} value = textureValue${a};
- `,e._pixelDatatype===qe.UNSIGNED_BYTE&&i.componentDatatype===K.UNSIGNED_BYTE&&!i.normalize?u+=`value *= 255.0;
- `:e._pixelDatatype===qe.FLOAT&&i.componentDatatype===K.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0;
- `),u+=` return value;
- }
- `,u}dp.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture;
- `;t+=`${kFe(this)}
- `;let n=e.length;for(let i=0;i<n;++i)t+=HFe(this,i);return function(i){let r=i.indexOf("void main"),o=i.substring(0,r),s=i.substring(r);return`${o}
- ${t}
- ${s}`}};dp.prototype.isDestroyed=function(){return!1};dp.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var bT=dp;function GFe(e,t,n){let i=!n,r=e.length,o;if(!i&&r>1){let s=e[0].modelMatrix;for(o=1;o<r;++o)if(!N.equals(s,e[o].modelMatrix)){i=!0;break}}if(i)for(o=0;o<r;++o)l(e[o].geometry)&&Bn.transformToWorldCoordinates(e[o]);else N.multiplyTransformation(t,e[0].modelMatrix,t)}function h6(e,t){let n=e.attributes,i=n.position,r=i.values.length/i.componentsPerAttribute;n.batchId=new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let o=n.batchId.values;for(let s=0;s<r;++s)o[s]=t}function WFe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?h6(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(h6(i.westHemisphereGeometry,n),h6(i.eastHemisphereGeometry,n))}}function jFe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,o=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,u,f,d=t.length;for(c=0;c<d;++c)if(l(t[c].geometry)){f=t[c].geometry.primitiveType;break}if(GFe(t,a,r),!r)for(c=0;c<d;++c)l(t[c].geometry)&&Bn.splitLongitude(t[c]);if(WFe(t),o)for(c=0;c<d;++c){let g=t[c];l(g.geometry)?(Bn.reorderForPostVertexCache(g.geometry),Bn.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(Bn.reorderForPostVertexCache(g.westHemisphereGeometry),Bn.reorderForPreVertexCache(g.westHemisphereGeometry),Bn.reorderForPostVertexCache(g.eastHemisphereGeometry),Bn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Bn.combineInstances(t);for(d=p.length,c=0;c<d;++c){u=p[c];let g=u.attributes;if(r)for(let m in g)g.hasOwnProperty(m)&&g[m].componentDatatype===K.DOUBLE&&Bn.encodeAttribute(u,m,`${m}3DHigh`,`${m}3DLow`);else for(let m in g)if(g.hasOwnProperty(m)&&g[m].componentDatatype===K.DOUBLE){let x=`${m}3D`,C=`${m}2D`;Bn.projectTo2D(u,m,x,C,n),l(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=re.fromVertices(u.attributes.position2D.values)),Bn.encodeAttribute(u,x,`${x}High`,`${x}Low`),Bn.encodeAttribute(u,C,`${C}High`,`${C}Low`)}s&&Bn.compressVertices(u)}if(!i){let g=[];for(d=p.length,c=0;c<d;++c)u=p[c],g=g.concat(Bn.fitToUnsignedShortIndices(u));p=g}return p}function m6(e,t,n,i){let r,o,s,a=i.length-1;if(a>=0){let u=i[a];r=u.offset+u.count,s=u.index,o=n[s].indices.length}else r=0,s=0,o=n[s].indices.length;let c=e.length;for(let u=0;u<c;++u){let d=e[u][t];if(!l(d))continue;let p=d.indices.length;r+p>o&&(r=0,o=n[++s].indices.length),i.push({index:s,offset:r,count:p}),r+=p}}function qFe(e,t){let n=[];return m6(e,"geometry",t,n),m6(e,"westHemisphereGeometry",t,n),m6(e,"eastHemisphereGeometry",t,n),n}var hp={};hp.combineGeometry=function(e){let t,n,i=e.instances,r=i.length,o,s,a=!1;r>0&&(t=jFe(e),t.length>0&&(n=Bn.createAttributeLocations(t[0]),e.createPickOffsets&&(o=qFe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(r),a=!0));let c=new Array(r),u=new Array(r);for(let f=0;f<r;++f){let d=i[f],p=d.geometry;l(p)&&(c[f]=p.boundingSphere,u[f]=p.boundingSphereCV,a&&(s[f]=d.geometry.offsetAttribute));let g=d.eastHemisphereGeometry,m=d.westHemisphereGeometry;l(g)&&l(m)&&(l(g.boundingSphere)&&l(m.boundingSphere)&&(c[f]=re.union(g.boundingSphere,m.boundingSphere)),l(g.boundingSphereCV)&&l(m.boundingSphereCV)&&(u[f]=re.union(g.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:o,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:u}};function YFe(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];l(r)&&l(r.values)&&t.push(r.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function XFe(e,t){let n=e.length;for(let i=0;i<n;++i)YFe(e[i],t)}function KFe(e){let t=1,n=e.length;for(let i=0;i<n;i++){let r=e[i];if(++t,!l(r))continue;let o=r.attributes;t+=7+2*re.packedLength+(l(r.indices)?r.indices.length:0);for(let s in o)if(o.hasOwnProperty(s)&&l(o[s])){let a=o[s];t+=5+a.values.length}}return t}hp.packCreateGeometryResults=function(e,t){let n=new Float64Array(KFe(e)),i=[],r={},o=e.length,s=0;n[s++]=o;for(let a=0;a<o;a++){let c=e[a],u=l(c);if(n[s++]=u?1:0,!u)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=y(c.offsetAttribute,-1);let f=l(c.boundingSphere)?1:0;n[s++]=f,f&&re.pack(c.boundingSphere,n,s),s+=re.packedLength;let d=l(c.boundingSphereCV)?1:0;n[s++]=d,d&&re.pack(c.boundingSphereCV,n,s),s+=re.packedLength;let p=c.attributes,g=[];for(let x in p)p.hasOwnProperty(x)&&l(p[x])&&(g.push(x),l(r[x])||(r[x]=i.length,i.push(x)));n[s++]=g.length;for(let x=0;x<g.length;x++){let C=g[x],A=p[C];n[s++]=r[C],n[s++]=A.componentDatatype,n[s++]=A.componentsPerAttribute,n[s++]=A.normalize?1:0,n[s++]=A.values.length,n.set(A.values,s),s+=A.values.length}let m=l(c.indices)?c.indices.length:0;n[s++]=m,m>0&&(n.set(c.indices,s),s+=m)}return t.push(n.buffer),{stringTable:i,packedData:n}};hp.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,r=new Array(n[0]),o=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){r[o++]=void 0;continue}let c=n[s++],u=n[s++],f=n[s++];f===-1&&(f=void 0);let d,p;n[s++]===1&&(d=re.unpack(n,s)),s+=re.packedLength,n[s++]===1&&(p=re.unpack(n,s)),s+=re.packedLength;let x,C,A,b=new dn,T=n[s++];for(i=0;i<T;i++){let w=t[n[s++]],D=n[s++];A=n[s++];let I=n[s++]!==0;x=n[s++],C=K.createTypedArray(D,x);for(let O=0;O<x;O++)C[O]=n[s++];b[w]=new Ee({componentDatatype:D,componentsPerAttribute:A,normalize:I,values:C})}let S;if(x=n[s++],x>0){let w=C.length/A;for(S=Le.createTypedArray(w,x),i=0;i<x;i++)S[i]=n[s++]}r[o++]=new ot({primitiveType:c,geometryType:u,boundingSphere:d,boundingSphereCV:p,indices:S,attributes:b,offsetAttribute:f})}return r};function $Fe(e,t){let n=e.length,i=new Float64Array(1+n*19),r=0;i[r++]=n;for(let o=0;o<n;o++){let s=e[o];if(N.pack(s.modelMatrix,i,r),r+=N.packedLength,l(s.attributes)&&l(s.attributes.offset)){let a=s.attributes.offset.value;i[r]=a[0],i[r+1]=a[1],i[r+2]=a[2]}r+=3}return t.push(i.buffer),i}function ZFe(e){let t=e,n=new Array(t[0]),i=0,r=1;for(;r<t.length;){let o=N.unpack(t,r),s;r+=N.packedLength,l(t[r])&&(s={offset:new nr(t[r],t[r+1],t[r+2])}),r+=3,n[i++]={modelMatrix:o,attributes:s}}return n}hp.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let r=0;r<i;r++)t.push(n[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:$Fe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Ii,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};hp.unpackCombineGeometryParameters=function(e){let t=ZFe(e.packedInstances),n=e.createGeometryResults,i=n.length,r=0;for(let a=0;a<i;a++){let c=hp.unpackCreateGeometryResults(n[a]),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=t[r];p.geometry=d,++r}}let o=oe.clone(e.ellipsoid),s=e.isGeographic?new Ii(o):new ji(o);return{instances:t,ellipsoid:o,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:N.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function sre(e){let t=e.length,n=1+(re.packedLength+1)*t,i=new Float32Array(n),r=0;i[r++]=t;for(let o=0;o<t;++o){let s=e[o];l(s)?(i[r++]=1,re.pack(e[o],i,r)):i[r++]=0,r+=re.packedLength}return i}function are(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=re.unpack(e,i)),++n,i+=re.packedLength;return t}hp.packCombineGeometryResults=function(e,t){l(e.geometries)&&XFe(e.geometries,t);let n=sre(e.boundingSpheres),i=sre(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}};hp.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:are(e.boundingSpheres),boundingSpheresCV:are(e.boundingSpheresCV)}};var ET=hp;var JFe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},Lo=Object.freeze(JFe);var CL={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};CL.getMorphTime=function(e){return e===CL.SCENE3D?1:e===CL.MORPHING?void 0:0};var te=Object.freeze(CL);var Wl={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};Wl.NUMBER_OF_SHADOW_MODES=4;Wl.castShadows=function(e){return e===Wl.ENABLED||e===Wl.CAST_ONLY};Wl.receiveShadows=function(e){return e===Wl.ENABLED||e===Wl.RECEIVE_ONLY};Wl.fromCastReceive=function(e,t){return e&&t?Wl.ENABLED:e?Wl.CAST_ONLY:t?Wl.RECEIVE_ONLY:Wl.DISABLED};var Zt=Object.freeze(Wl);function To(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this._modelMatrix=new N,this.show=y(e.show,!0),this._vertexCacheOptimize=y(e.vertexCacheOptimize,!1),this._interleave=y(e.interleave,!1),this._releaseGeometryInstances=y(e.releaseGeometryInstances,!0),this._allowPicking=y(e.allowPicking,!0),this._asynchronous=y(e.asynchronous,!0),this._compressVertices=y(e.compressVertices,!0),this.cull=y(e.cull,!0),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this.shadows=y(e.shadows,Zt.DISABLED),this._translucent=void 0,this._state=Lo.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=[],this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1;let t=this;this._readyPromise=new Promise((n,i)=>{t._completeLoad=(r,o,s)=>{this._error=s,this._state=o,r.afterRender.push(function(){t._ready=t._state===Lo.COMPLETE||t._state===Lo.FAILED,l(s)?i(s):n(t)})}}),this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(To.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}}});function QFe(e){let t=e.length,n=[],i=e[0].attributes,r;for(r in i)if(i.hasOwnProperty(r)&&l(i[r])){let o=i[r],s=!0;for(let a=1;a<t;++a){let c=e[a].attributes[r];if(!l(c)||o.componentDatatype!==c.componentDatatype||o.componentsPerAttribute!==c.componentsPerAttribute||o.normalize!==c.normalize){s=!1;break}}s&&n.push(r)}return n}var e2e=new W,t2e=new h,_re=new se;function gre(e){let t=e.length;if(t===1)return e[0];if(t===2)return W.unpack(e,0,e2e);if(t===3)return h.unpack(e,0,t2e);if(t===4)return se.unpack(e,0,_re)}function n2e(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],r=i.length;if(r===0)return;let o=QFe(i),s=o.length,a=[],c={},u={},f,p=i[0].attributes,g,m,x;for(g=0;g<s;++g)m=o[g],x=p[m],c[m]=g,a.push({functionName:`czm_batchTable_${m}`,componentDatatype:x.componentDatatype,componentsPerAttribute:x.componentsPerAttribute,normalize:x.normalize});o.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:K.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:K.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:K.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:K.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:K.FLOAT,componentsPerAttribute:1}),u.center3DHigh=a.length-5,u.center3DLow=a.length-4,u.center2DHigh=a.length-3,u.center2DLow=a.length-2,u.radius=a.length-1),o.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:K.FLOAT,componentsPerAttribute:3}),f=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let C=a.length,A=new bT(t,a,r);for(g=0;g<r;++g){let b=i[g];p=b.attributes;for(let I=0;I<s;++I){m=o[I],x=p[m];let O=gre(x.value),B=c[m];A.setBatchedAttribute(g,B,O)}let T={primitive:y(b.pickPrimitive,e)};l(b.id)&&(T.id=b.id);let S=t.createPickId(T);e._pickIds.push(S);let w=S.color,D=_re;D.x=z.floatToByte(w.red),D.y=z.floatToByte(w.green),D.z=z.floatToByte(w.blue),D.w=z.floatToByte(w.alpha),A.setBatchedAttribute(g,C-1,D)}e._batchTable=A,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function i2e(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Ee({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function r2e(e){let t=e.attributes,n=new dn;for(let r in t)t.hasOwnProperty(r)&&l(t[r])&&(n[r]=i2e(t[r]));let i;if(l(e.indices)){let r=e.indices;Array.isArray(r)?i=r.slice(0):i=new r.constructor(r)}return new ot({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:re.clone(e.boundingSphere)})}function o2e(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:N.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var s2e=/attribute\s+vec(?:3|4)\s+(.*)3DHigh;/g;To._modifyShaderPosition=function(e,t,n){let i,r="",o="",s="";for(;(i=s2e.exec(t))!==null;){let a=i[1],c=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(r+=`${c};
- `),l(e.rtcCenter)?(t=t.replace(/attribute\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/attribute\s+vec(?:3|4)\s+position3DLow;/g,""),r+=`uniform mat4 u_modifiedModelView;
- `,o+=`attribute vec4 position;
- `,s+=`${c}
- {
- return u_modifiedModelView * position;
- }
- `,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?s+=`${c}
- {
- return czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow);
- }
- `:(o+=`attribute vec3 ${a}2DHigh;
- attribute vec3 ${a}2DLow;
- `,s+=`${c}
- {
- vec4 p;
- if (czm_morphTime == 1.0)
- {
- p = czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow);
- }
- else if (czm_morphTime == 0.0)
- {
- p = czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy);
- }
- else
- {
- p = czm_columbusViewMorph(
- czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy),
- czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow),
- czm_morphTime);
- }
- return p;
- }
- `)}return[r,o,t,s].join(`
- `)};To._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${Fe.replaceMain(t,"czm_non_show_main")}
- void main()
- {
- czm_non_show_main();
- gl_Position *= czm_batchTable_show(batchId);
- }`:t};To._updateColorAttribute=function(e,t,n){if(!l(e._batchTableAttributeIndices.color)&&!l(e._batchTableAttributeIndices.depthFailColor)||t.search(/attribute\s+vec4\s+color;/g)===-1)return t;let i=t;return i=i.replace(/attribute\s+vec4\s+color;/g,""),n?i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i};function cre(e){return`${Fe.replaceMain(e,"czm_non_pick_main")}
- varying vec4 v_pickColor;
- void main()
- {
- czm_non_pick_main();
- v_pickColor = czm_batchTable_pickColor(batchId);
- }`}function lre(e){return`varying vec4 v_pickColor;
- ${e}`}To._updatePickColorAttribute=function(e){let t=e.replace(/attribute\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2"),t};To._appendOffsetToShader=function(e,t){if(!l(e._batchTableAttributeIndices.offset))return t;let n=`attribute float batchId;
- `;n+="attribute float applyOffset;";let i=t.replace(/attribute\s+float\s+batchId;/g,n),r=`vec4 $1 = czm_computePosition();
- `;return r+=` if (czm_sceneMode == czm_sceneMode3D)
- `,r+=` {
- `,r+=" $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",r+=` }
- `,r+=` else
- `,r+=` {
- `,r+=" $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",r+=` }
- `,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,r),i};To._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=Fe.replaceMain(t,"czm_non_distanceDisplayCondition_main"),r=`void main()
- {
- czm_non_distanceDisplayCondition_main();
- vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);
- vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId);
- vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId);
- float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);
- `;return n?r+=` vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);
- `:r+=` vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);
- vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);
- vec4 centerRTE;
- if (czm_morphTime == 1.0)
- {
- centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);
- }
- else if (czm_morphTime == 0.0)
- {
- centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy);
- }
- else
- {
- centerRTE = czm_columbusViewMorph(
- czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy),
- czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow),
- czm_morphTime);
- }
- `,r+=` float radiusSq = boundingSphereRadius * boundingSphereRadius;
- float distanceSq;
- if (czm_sceneMode == czm_sceneMode2D)
- {
- distanceSq = czm_eyeHeight2D.y - radiusSq;
- }
- else
- {
- distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq;
- }
- distanceSq = max(distanceSq, 0.0);
- float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;
- float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;
- float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0;
- gl_Position *= show;
- }`,`${i}
- ${r}`};function ure(e,t){if(!e.compressVertices)return t;let n=t.search(/attribute\s+vec3\s+normal;/g)!==-1,i=t.search(/attribute\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let r=t.search(/attribute\s+vec3\s+tangent;/g)!==-1,o=t.search(/attribute\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=r||o?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",u=`attribute ${a} ${c};`,f="",d="";i&&(f+=`vec2 st;
- `,d+=` st = czm_decompressTextureCoordinates(${s>1?`${c}.x`:c});
- `),n&&r&&o?(f+=`vec3 normal;
- vec3 tangent;
- vec3 bitangent;
- `,d+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent);
- `):(n&&(f+=`vec3 normal;
- `,d+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""});
- `),r&&(f+=`vec3 tangent;
- `,d+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"});
- `),o&&(f+=`vec3 bitangent;
- `,d+=` bitangent = czm_octDecode(${c}.${i&&n?"z":"y"});
- `));let p=t;p=p.replace(/attribute\s+vec3\s+normal;/g,""),p=p.replace(/attribute\s+vec2\s+st;/g,""),p=p.replace(/attribute\s+vec3\s+tangent;/g,""),p=p.replace(/attribute\s+vec3\s+bitangent;/g,""),p=Fe.replaceMain(p,"czm_non_compressed_main");let g=`void main()
- {
- ${d} czm_non_compressed_main();
- }`;return[u,f,p,g].join(`
- `)}function a2e(e){let t=Fe.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
- czm_non_depth_clamp_main();
- gl_Position = czm_depthClamp(gl_Position);}
- `,t}function c2e(e){let t=Fe.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
- czm_non_depth_clamp_main();
- #if defined(GL_EXT_frag_depth)
- #if defined(LOG_DEPTH)
- czm_writeLogDepth();
- #else
- czm_writeDepthClamp();
- #endif
- #endif
- }
- `,t=`#ifdef GL_EXT_frag_depth
- #extension GL_EXT_frag_depth : enable
- #endif
- ${t}`,t}function fre(e,t){let n=e.vertexAttributes}function l2e(e,t){return function(){return e[t]}}var p6=Math.max(Et.hardwareConcurrency-1,1),AL,u2e=new Mi("combineGeometry");function f2e(e,t){let n,i,r,o,s=e._instanceIds;if(e._state===Lo.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],u=[];for(r=0;r<a;++r)i=n[r].geometry,s.push(n[r].id),u.push({moduleName:i._workerName,geometry:i});if(!l(AL))for(AL=new Array(p6),r=0;r<p6;r++)AL[r]=new Mi("createGeometry");let f;for(u=JO(u,p6),r=0;r<u.length;r++){let d=0,p=u[r],g=p.length;for(o=0;o<g;++o)f=p[o],i=f.geometry,l(i.constructor.pack)&&(f.offset=d,d+=y(i.constructor.packedLength,i.packedLength));let m;if(d>0){let x=new Float64Array(d);for(m=[x.buffer],o=0;o<g;++o)f=p[o],i=f.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,x,f.offset),f.geometry=x)}c.push(AL[r].scheduleTask({subTasks:u[r]},m))}e._state=Lo.CREATING,Promise.all(c).then(function(d){e._createGeometryResults=d,e._state=Lo.CREATED}).catch(function(d){Aw(e,t,Lo.FAILED,d)})}else if(e._state===Lo.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=u2e.scheduleTask(ET.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=Lo.COMBINING,Promise.resolve(f).then(function(d){let p=ET.unpackCombineGeometryResults(d);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=N.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Lo.COMBINED):Aw(e,t,Lo.FAILED,void 0)}).catch(function(d){Aw(e,t,Lo.FAILED,d)})}}function d2e(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,r=new Array(i),o=e._instanceIds,s,a,c=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,g;l(p.attributes)&&l(p.primitiveType)?g=r2e(p):g=p.constructor.createGeometry(p),r[c++]=o2e(s,g),o.push(s.id)}r.length=c;let u=t.scene3DOnly,f=t.mapProjection,d=ET.combineGeometry({instances:r,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=d.geometries,e._attributeLocations=d.attributeLocations,e.modelMatrix=N.clone(d.modelMatrix,e.modelMatrix),e._pickOffsets=d.pickOffsets,e._offsetInstanceExtend=d.offsetInstanceExtend,e._instanceBoundingSpheres=d.boundingSpheres,e._instanceBoundingSpheresCV=d.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Lo.COMBINED):Aw(e,t,Lo.FAILED,void 0)}function h2e(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,r=e._offsetInstanceExtend,o=e._instanceBoundingSpheres,s=o.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new re;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let x=a[i],C=e._batchTable.getBatchedAttribute(i,n,new h);x=o[i].clone(x),Are(x,C,r[i])}let c=[],u=[],f=[];for(i=0;i<s;++i){let x=a[i];x.center.x-x.radius>0||re.intersectPlane(x,an.ORIGIN_ZX_PLANE)!==Jt.INTERSECTING?c.push(x):(u.push(x),f.push(x))}let d=c[0],p=f[0],g=u[0];for(i=1;i<c.length;i++)d=re.union(d,c[i]);for(i=1;i<f.length;i++)p=re.union(p,f[i]);for(i=1;i<u.length;i++)g=re.union(g,u[i]);let m=[];for(l(d)&&m.push(d),l(p)&&m.push(p),l(g)&&m.push(g),i=0;i<m.length;i++){let x=m[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=x,e._boundingSphereCV[i]=re.projectTo2D(x,t.mapProjection,e._boundingSphereCV[i])}To._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var dre=new zn,yre=new me,xre=new h,Cre=new re;function m2e(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,r=i.center3DHigh,o=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,u=t.mapProjection,f=u.ellipsoid,d=e._batchTable,p=e._instanceBoundingSpheres,g=p.length;for(let m=0;m<g;++m){let x=p[m];if(!l(x))continue;let C=e.modelMatrix;l(C)&&(x=re.transform(x,C,Cre));let A=x.center,b=x.radius,T=zn.fromCartesian(A,dre);if(d.setBatchedAttribute(m,r,T.high),d.setBatchedAttribute(m,o,T.low),!t.scene3DOnly){let S=f.cartesianToCartographic(A,yre),w=u.project(S,xre);T=zn.fromCartesian(w,dre),d.setBatchedAttribute(m,s,T.high),d.setBatchedAttribute(m,a,T.low)}d.setBatchedAttribute(m,c,b)}e._batchTableBoundingSpheresUpdated=!0}var _6=new h,p2e=new h;function hre(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,r=t.mapProjection,o=r.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let u=0;u<c;++u){let f=a[u];if(!l(f))continue;let d=s.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(h.equals(d,h.ZERO)){s.setBatchedAttribute(u,i,h.ZERO);continue}let p=e.modelMatrix;l(p)&&(f=re.transform(f,p,Cre));let g=f.center;g=o.scaleToGeodeticSurface(g,p2e);let m=o.cartesianToCartographic(g,yre),x=r.project(m,xre),C=h.add(d,g,_6);m=o.cartesianToCartographic(C,m);let A=r.project(m,_6),b=h.subtract(A,x,_6),T=b.x;b.x=b.z,b.z=b.y,b.y=T,s.setBatchedAttribute(u,i,b)}e._batchTableOffsetsUpdated=!0}function _2e(e,t){let n=e._attributeLocations,i=e._geometries,r=t.scene3DOnly,o=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let u=i[c];if(s.push(Qn.fromGeometry({context:o,geometry:u,attributeLocations:n,bufferUsage:Ne.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(re.clone(u.boundingSphere)),e._boundingSphereWC.push(new re),!r){let f=u.boundingSphereCV.center,d=f.x,p=f.y,g=f.z;f.x=g,f.y=d,f.z=p,e._boundingSphereCV.push(re.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new re),e._boundingSphereMorph.push(new re)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,Aw(e,t,Lo.COMPLETE,void 0)}function g2e(e,t,n,i){let r=n.getRenderState(),o;i?(o=$e(r,!1),o.cull={enabled:!0,face:Yi.BACK},e._frontFaceRS=Ve.fromCache(o),o.cull.face=Yi.FRONT,e._backFaceRS=Ve.fromCache(o)):(e._frontFaceRS=Ve.fromCache(r),e._backFaceRS=e._frontFaceRS),o=$e(r,!1),l(e._depthFailAppearance)&&(o.depthTest.enabled=!1),l(e._depthFailAppearance)&&(r=e._depthFailAppearance.getRenderState(),o=$e(r,!1),o.depthTest.func=wc.GREATER,i?(o.cull={enabled:!0,face:Yi.BACK},e._frontFaceDepthFailRS=Ve.fromCache(o),o.cull.face=Yi.FRONT,e._backFaceDepthFailRS=Ve.fromCache(o)):(e._frontFaceDepthFailRS=Ve.fromCache(o),e._backFaceDepthFailRS=e._frontFaceRS))}function y2e(e,t,n){let i=t.context,r=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);o=To._appendOffsetToShader(e,o),o=To._appendShowToShader(e,o),o=To._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=cre(o),o=To._updateColorAttribute(e,o,!1),o=ure(e,o),o=To._modifyShaderPosition(e,o,t.scene3DOnly);let s=n.getFragmentShaderSource();s=lre(s),e._sp=Wt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),fre(e._sp,r),l(e._depthFailAppearance)&&(o=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),o=To._appendShowToShader(e,o),o=To._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=cre(o),o=To._updateColorAttribute(e,o,!0),o=ure(e,o),o=To._modifyShaderPosition(e,o,t.scene3DOnly),o=a2e(o),s=e._depthFailAppearance.getFragmentShaderSource(),s=lre(s),s=c2e(s),e._spDepthFail=Wt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),fre(e._spDepthFail,r))}var Cw=new N,mre=new h;function pre(e,t,n,i){let r=l(n)?n._uniforms:void 0,o={},s=t.uniforms;if(l(s))for(let c in s)s.hasOwnProperty(c)&&(o[c]=l2e(s,c));let a=rt(o,r);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return N.multiply(c,e._modelMatrix,Cw),N.multiplyByPoint(Cw,e.rtcCenter,mre),N.setTranslation(Cw,mre,Cw),Cw}),a}function x2e(e,t,n,i,r,o,s,a){let c=pre(e,t,n,a),u;l(e._depthFailAppearance)&&(u=pre(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let f=i?Ce.TRANSLUCENT:Ce.OPAQUE,d=r?2:1;d*=l(e._depthFailAppearance)?2:1,o.length=e._va.length*d;let p=o.length,g=0;for(let m=0;m<p;++m){let x;r&&(x=o[m],l(x)||(x=o[m]=new Ze({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._backFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=f,++m),x=o[m],l(x)||(x=o[m]=new Ze({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._frontFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=f,l(e._depthFailAppearance)&&(r&&(++m,x=o[m],l(x)||(x=o[m]=new Ze({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._backFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=u,x.pass=f),++m,x=o[m],l(x)||(x=o[m]=new Ze({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._frontFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=u,x.pass=f),++g}}To._updateBoundingVolumes=function(e,t,n,i){let r,o,s;if(i||!N.equals(n,e._modelMatrix))for(N.clone(n,e._modelMatrix),o=e._boundingSpheres.length,r=0;r<o;++r)s=e._boundingSpheres[r],l(s)&&(e._boundingSphereWC[r]=re.transform(s,n,e._boundingSphereWC[r]),t.scene3DOnly||(e._boundingSphere2D[r]=re.clone(e._boundingSphereCV[r],e._boundingSphere2D[r]),e._boundingSphere2D[r].center.x=0,e._boundingSphereMorph[r]=re.union(e._boundingSphereWC[r],e._boundingSphereCV[r])));let a=e.appearance.pixelSize;if(l(a))for(o=e._boundingSpheres.length,r=0;r<o;++r){s=e._boundingSpheres[r];let c=e._boundingSphereWC[r],f=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+f}};function C2e(e,t,n,i,r,o,s,a){To._updateBoundingVolumes(e,t,r);let c;t.mode===te.SCENE3D?c=e._boundingSphereWC:t.mode===te.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===te.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let d=e.allowPicking,p=Zt.castShadows(e.shadows),g=Zt.receiveShadows(e.shadows),m=n.length,x=a?2:1;x*=l(e._depthFailAppearance)?2:1;for(let C=0;C<m;++C){let A=Math.floor(C/x),b=n[C];b.modelMatrix=r,b.boundingVolume=c[A],b.cull=o,b.debugShowBoundingVolume=s,b.castShadows=p,b.receiveShadows=g,d?b.pickId="v_pickColor":b.pickId=void 0,u.push(b)}}}To.prototype.update=function(e){if(!l(this.geometryInstances)&&this._va.length===0||l(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!l(this.appearance)||e.mode!==te.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===Lo.FAILED)return;let t=e.context;if(l(this._batchTable)||n2e(this,t),this._batchTable.attributes.length>0){if(Bt.maximumVertexTextureImageUnits===0)throw new fe("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==Lo.COMPLETE&&this._state!==Lo.COMBINED&&(this.asynchronous?f2e(this,e):d2e(this,e)),this._state===Lo.COMBINED&&(m2e(this,e),hre(this,e),_2e(this,e)),!this.show||this._state!==Lo.COMPLETE)return;this._batchTableOffsetsUpdated||hre(this,e),this._recomputeBoundingSpheres&&h2e(this,e);let n=this.appearance,i=n.material,r=!1,o=!1;this._appearance!==n?(this._appearance=n,this._material=i,r=!0,o=!0):this._material!==i&&(this._material=i,o=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,r=!0,o=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,o=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,r=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;r&&y(this._createRenderStatesFunction,g2e)(this,t,n,u),o&&y(this._createShaderProgramFunction,y2e)(this,e,n),(r||o)&&y(this._createCommandsFunction,x2e)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),y(this._updateAndQueueCommandsFunction,C2e)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var A2e=new re,T2e=new re;function Are(e,t,n){if(n===nn.TOP){let i=re.clone(e,A2e),r=re.clone(e,T2e);r.center=h.add(r.center,t,r.center),e=re.union(i,r,e)}else n===nn.ALL&&(e.center=h.add(e.center,t,e.center));return e}function b2e(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),r=e.attributes[n],o=r.componentsPerAttribute,s=K.createTypedArray(r.componentDatatype,o);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function E2e(e,t,n,i,r){return function(o){let s=gre(o);e.setBatchedAttribute(t,n,s),r==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var S2e=new h;function w2e(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let r=e.modelMatrix,o=t.offset;l(o)&&Are(i,h.fromArray(o.get(),0,S2e),e._offsetInstanceExtend[n]),l(r)&&(i=re.transform(i,r))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function v2e(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}To.prototype.getGeometryInstanceAttributes=function(e){let t=-1,n=this._lastPerInstanceAttributeIndex,i=this._instanceIds,r=i.length;for(let u=0;u<r;++u){let f=(n+u)%r;if(e===i[f]){t=f;break}}if(t===-1)return;let o=this._perInstanceAttributeCache[t];if(l(o))return o;let s=this._batchTable,a=this._batchTableAttributeIndices;o={};let c={};for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];c[u]={get:b2e(s,t,f),set:E2e(s,t,f,this,u)}}return w2e(this,c,t),v2e(this,c,t),Object.defineProperties(o,c),this._lastPerInstanceAttributeIndex=t,this._perInstanceAttributeCache[t]=o,o};To.prototype.isDestroyed=function(){return!1};To.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();let n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;let i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,ue(this)};function Aw(e,t,n,i){e._completeLoad(t,n,i)}var Tn=To;var Tw=`#ifdef GL_EXT_frag_depth
- #extension GL_EXT_frag_depth : enable
- #endif
- #ifdef TEXTURE_COORDINATES
- #ifdef SPHERICAL
- varying vec4 v_sphericalExtents;
- #else // SPHERICAL
- varying vec2 v_inversePlaneExtents;
- varying vec4 v_westPlane;
- varying vec4 v_southPlane;
- #endif // SPHERICAL
- varying vec3 v_uvMinAndSphericalLongitudeRotation;
- varying vec3 v_uMaxAndInverseDistance;
- varying vec3 v_vMaxAndInverseDistance;
- #endif // TEXTURE_COORDINATES
- #ifdef PER_INSTANCE_COLOR
- varying vec4 v_color;
- #endif
- #ifdef NORMAL_EC
- vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) {
- vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth);
- return eyeCoordinate.xyz / eyeCoordinate.w;
- }
- vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) {
- vec2 glFragCoordXY = gl_FragCoord.xy;
- float upOrRightLogDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw));
- float downOrLeftLogDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw));
- bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw);
- float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y);
- float useDownOrLeft = float(useUpOrRight == 0.0);
- vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth);
- vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth);
- return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft;
- }
- #endif // NORMAL_EC
- void main(void)
- {
- #ifdef REQUIRES_EC
- float logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw));
- vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
- #endif
- #ifdef REQUIRES_WC
- vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;
- vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;
- #endif
- #ifdef TEXTURE_COORDINATES
- vec2 uv;
- #ifdef SPHERICAL
- vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate);
- sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z;
- sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);
- uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w;
- uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z;
- #else // SPHERICAL
- uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x;
- uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y;
- #endif // SPHERICAL
- #endif // TEXTURE_COORDINATES
- #ifdef PICK
- #ifdef CULL_FRAGMENTS
- if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) {
- gl_FragColor.a = 1.0;
- czm_writeDepthClamp();
- }
- #else // CULL_FRAGMENTS
- gl_FragColor.a = 1.0;
- #endif // CULL_FRAGMENTS
- #else // PICK
- #ifdef CULL_FRAGMENTS
- if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) {
- discard;
- }
- #endif
- #ifdef NORMAL_EC
- vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0));
- vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0));
- vec3 normalEC = normalize(cross(leftRight, downUp));
- #endif
- #ifdef PER_INSTANCE_COLOR
- vec4 color = czm_gammaCorrect(v_color);
- #ifdef FLAT
- gl_FragColor = color;
- #else // FLAT
- czm_materialInput materialInput;
- materialInput.normalEC = normalEC;
- materialInput.positionToEyeEC = -eyeCoordinate.xyz;
- czm_material material = czm_getDefaultMaterial(materialInput);
- material.diffuse = color.rgb;
- material.alpha = color.a;
- gl_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);
- #endif // FLAT
- gl_FragColor.rgb *= gl_FragColor.a;
- #else // PER_INSTANCE_COLOR
- czm_materialInput materialInput;
- #ifdef USES_NORMAL_EC
- materialInput.normalEC = normalEC;
- #endif
- #ifdef USES_POSITION_TO_EYE_EC
- materialInput.positionToEyeEC = -eyeCoordinate.xyz;
- #endif
- #ifdef USES_TANGENT_TO_EYE
- materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC);
- #endif
- #ifdef USES_ST
- materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z;
- materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z;
- #endif
- czm_material material = czm_getMaterial(materialInput);
- #ifdef FLAT
- gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);
- #else // FLAT
- gl_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);
- #endif // FLAT
- gl_FragColor.rgb *= gl_FragColor.a;
- #endif // PER_INSTANCE_COLOR
- czm_writeDepthClamp();
- #endif // PICK
- }
- `;function Qu(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new g6;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let r=new g6;if(r.requiresTextureCoordinates=e,n instanceof rn)i.requiresNormalEC=!n.flat;else{let o=`${n.material.shaderSource}
- ${n.fragmentShaderSource}`;i.normalEC=o.indexOf("materialInput.normalEC")!==-1||o.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=o.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=o.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=o.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=r,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}Qu.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof rn&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let r="";return t instanceof rn||(r=t.material.shaderSource),new Fe({defines:i,sources:[r,Tw]})};Qu.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new Fe({defines:n,sources:[Tw],pickColorQualifier:"varying"})};Qu.prototype.createVertexShader=function(e,t,n,i){return Pre(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Qu.prototype.createPickVertexShader=function(e,t,n,i){return Pre(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var Tre=new h,bre=new me,Ere={high:0,low:0};function Pre(e,t,n,i,r,o,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=bre;u.longitude=M.PI,u.latitude=0,u.height=0;let f=s.project(u,Tre),d=zn.encode(f.x,Ere);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`;let p=bre;p.longitude=-M.PI,p.latitude=0,p.height=0;let g=s.project(p,Tre);d=zn.encode(g.x,Ere),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(o)&&o instanceof rn&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new Fe({defines:c,sources:[r]})}function g6(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(g6.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function Sre(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/W.distance(t,e)}var D2e=[new W,new W,new W,new W];function Ire(e,t){let n=D2e,i=W.unpack(t,0,n[0]),r=W.unpack(t,2,n[1]),o=W.unpack(t,4,n[2]);e.uMaxVmax=new Ac({componentDatatype:K.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r.x,r.y,o.x,o.y]});let s=1/Sre(i,r,o),a=1/Sre(i,o,r);e.uvMinAndExtents=new Ac({componentDatatype:K.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var Ore=new me,Rre=new h,P2e=new h,I2e=new h,TL={high:0,low:0};function Mre(e,t,n){let i=Ore;i.height=0,i.longitude=e.west,i.latitude=e.south;let r=t.project(i,Rre);i.latitude=e.north;let o=t.project(i,P2e);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,I2e),a=[0,0,0,0],c=[0,0,0,0],u=zn.encode(r.x,TL);a[0]=u.high,c[0]=u.low,u=zn.encode(r.y,TL),a[1]=u.high,c[1]=u.low,u=zn.encode(o.y,TL),a[2]=u.high,c[2]=u.low,u=zn.encode(s.x,TL),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new Ac({componentDatatype:K.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new Ac({componentDatatype:K.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var O2e=new N,R2e=new N,wre=new h,M2e=new me,B2e=[new me,new me,new me,new me,new me,new me,new me,new me];function L2e(e,t,n,i,r,o){let s=he.center(e,M2e);s.height=n;let a=me.toCartesian(s,t,wre),c=yt.eastNorthUpToFixedFrame(a,t,O2e),u=N.inverse(c,R2e),f=e.west,d=e.east,p=e.north,g=e.south,m=B2e;m[0].latitude=g,m[0].longitude=f,m[1].latitude=p,m[1].longitude=f,m[2].latitude=p,m[2].longitude=d,m[3].latitude=g,m[3].longitude=d;let x=(f+d)*.5,C=(p+g)*.5;m[4].latitude=g,m[4].longitude=x,m[5].latitude=p,m[5].longitude=x,m[6].latitude=C,m[6].longitude=f,m[7].latitude=C,m[7].longitude=d;let A=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY;for(let O=0;O<8;O++){m[O].height=n;let B=me.toCartesian(m[O],t,wre);N.multiplyByPoint(u,B,B),B.z=0,A=Math.min(A,B.x),b=Math.max(b,B.x),T=Math.min(T,B.y),S=Math.max(S,B.y)}let w=i;w.x=A,w.y=T,w.z=0,N.multiplyByPoint(c,w,w);let D=r;D.x=b,D.y=T,D.z=0,N.multiplyByPoint(c,D,D),h.subtract(D,w,r);let I=o;I.x=A,I.y=S,I.z=0,N.multiplyByPoint(c,I,I),h.subtract(I,w,o)}var N2e=new h,F2e=new h,V2e=new zn;Qu.getPlanarTextureCoordinateAttributes=function(e,t,n,i,r){let o=Rre,s=N2e,a=F2e;L2e(e,n,y(r,0),o,s,a);let c={};Ire(c,t);let u=zn.fromCartesian(o,V2e);return c.southWest_HIGH=new Ac({componentDatatype:K.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.high,[0,0,0])}),c.southWest_LOW=new Ac({componentDatatype:K.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.low,[0,0,0])}),c.eastward=new Ac({componentDatatype:K.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),c.northward=new Ac({componentDatatype:K.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),Mre(e,i,c),c};var k2e=new h;function vre(e,t,n,i){let r=Ore;r.latitude=e,r.longitude=t,r.height=0;let o=me.toCartesian(r,n,k2e),s=Math.sqrt(o.x*o.x+o.y*o.y),a=M.fastApproximateAtan2(s,o.z),c=M.fastApproximateAtan2(o.x,o.y);return i.x=a,i.y=c,i}var Dre=new W;Qu.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let r=vre(e.south,e.west,n,Dre),o=r.x,s=r.y,a=vre(e.north,e.east,n,Dre),c=a.x,u=a.y,f=0;s>u&&(f=M.PI-s,s=-M.PI,u+=f),o-=M.EPSILON5,s-=M.EPSILON5,c+=M.EPSILON5,u+=M.EPSILON5;let d=1/(u-s),p=1/(c-o),g={sphericalExtents:new Ac({componentDatatype:K.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o,s,p,d]}),longitudeRotation:new Ac({componentDatatype:K.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return Ire(g,t),Mre(e,i,g),g};Qu.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};Qu.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function U2e(e){return Math.max(e.width,e.height)>Qu.MAX_WIDTH_FOR_PLANAR_EXTENTS}Qu.shouldUseSphericalCoordinates=function(e){return U2e(e)};Qu.MAX_WIDTH_FOR_PLANAR_EXTENTS=M.toRadians(1);var ef=Qu;var z2e={NEVER:Z.NEVER,LESS:Z.LESS,EQUAL:Z.EQUAL,LESS_OR_EQUAL:Z.LEQUAL,GREATER:Z.GREATER,NOT_EQUAL:Z.NOTEQUAL,GREATER_OR_EQUAL:Z.GEQUAL,ALWAYS:Z.ALWAYS},yi=Object.freeze(z2e);var H2e={ZERO:Z.ZERO,KEEP:Z.KEEP,REPLACE:Z.REPLACE,INCREMENT:Z.INCR,DECREMENT:Z.DECR,INVERT:Z.INVERT,INCREMENT_WRAP:Z.INCR_WRAP,DECREMENT_WRAP:Z.DECR_WRAP},Ft=Object.freeze(H2e);var bL={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};bL.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:yi.ALWAYS,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.REPLACE},backFunction:yi.ALWAYS,backOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.REPLACE},reference:bL.CESIUM_3D_TILE_MASK,mask:bL.CESIUM_3D_TILE_MASK}};var tn=Object.freeze(bL);function Jy(e){e=y(e,y.EMPTY_OBJECT);let t=e.geometryInstances;this.geometryInstances=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,qn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=y(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1;let n=this;this._readyPromise=new Promise((i,r)=>{n._completeLoad=()=>{if(this._ready)return;this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let o=this._error;l(o)?r(o):i(this)}}),this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(Jy.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});Jy.isSupported=function(e){return e.context.stencilBuffer};function ST(e,t){let n=t?yi.EQUAL:yi.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:Ft.KEEP,zFail:Ft.DECREMENT_WRAP,zPass:Ft.KEEP},backFunction:n,backOperation:{fail:Ft.KEEP,zFail:Ft.INCREMENT_WRAP,zPass:Ft.KEEP},reference:tn.CESIUM_3D_TILE_MASK,mask:tn.CESIUM_3D_TILE_MASK},stencilMask:tn.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:wc.LESS_OR_EQUAL},depthMask:!1}}function x6(e){return{stencilTest:{enabled:e,frontFunction:yi.NOT_EQUAL,frontOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},backFunction:yi.NOT_EQUAL,backOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},reference:0,mask:tn.CLASSIFICATION_MASK},stencilMask:tn.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:hn.PRE_MULTIPLIED_ALPHA_BLEND}}var G2e={stencilTest:{enabled:!0,frontFunction:yi.NOT_EQUAL,frontOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},backFunction:yi.NOT_EQUAL,backOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},reference:0,mask:tn.CLASSIFICATION_MASK},stencilMask:tn.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function W2e(e,t,n,i){if(l(e._rsStencilDepthPass))return;let r=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ve.fromCache(ST(r,!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(ST(r,!0)),e._rsColorPass=Ve.fromCache(x6(r,!1)),e._rsPickPass=Ve.fromCache(G2e)}function j2e(e,t){if(!e.compressVertices)return t;if(t.search(/attribute\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`attribute vec2 ${n};`,r=`vec3 extrudeDirection;
- `,o=` extrudeDirection = czm_octDecode(${n}, 65535.0);
- `,s=t;s=s.replace(/attribute\s+vec3\s+extrudeDirection;/g,""),s=Fe.replaceMain(s,"czm_non_compressed_main");let a=`void main()
- {
- ${o} czm_non_compressed_main();
- }`;return[i,r,s,a].join(`
- `)}}function q2e(e,t){let n=t.context,i=e._primitive,r=yL;r=e._primitive._batchTable.getVertexShaderCallback()(r),r=Tn._appendDistanceDisplayConditionToShader(i,r),r=Tn._modifyShaderPosition(e,r,t.scene3DOnly),r=Tn._updateColorAttribute(i,r);let o=e._hasPlanarExtentsAttributes,s=o||e._hasSphericalExtentsAttribute;e._extruded&&(r=j2e(i,r));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Fe({defines:[a],sources:[r]}),u=new Fe({sources:[Zy]}),f=e._primitive._attributeLocations,d=new ef(s,o,e.appearance);if(e._spStencil=Wt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=Fe.createPickVertexShaderSource(r);m=Tn._appendShowToShader(i,m),m=Tn._updatePickColorAttribute(m);let x=d.createPickFragmentShader(!1),C=d.createPickVertexShader([a],m,!1,t.mapProjection);if(e._spPick=Wt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:C,fragmentShaderSource:x,attributeLocations:f}),s){let A=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(A)){let b=d.createPickFragmentShader(!0),T=d.createPickVertexShader([a],m,!0,t.mapProjection);A=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:T,fragmentShaderSource:b,attributeLocations:f})}e._spPick2D=A}}else e._spPick=Wt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});r=Tn._appendShowToShader(i,r),c=new Fe({defines:[a],sources:[r]}),e._sp=Wt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=d.createFragmentShader(!1),g=d.createVertexShader([a],r,!1,t.mapProjection);if(e._spColor=Wt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:f}),s){let m=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(m)){let x=d.createFragmentShader(!0),C=d.createVertexShader([a],r,!0,t.mapProjection);m=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:C,fragmentShaderSource:x,attributeLocations:f})}e._spColor2D=m}}function Y2e(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let r,o,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(r=0;r<i;r+=2){let g=n._va[a++];o=t[r],l(o)||(o=t[r]=new Ze({owner:e,primitiveType:n._primitiveType})),o.vertexArray=g,o.renderState=e._rsStencilDepthPass,o.shaderProgram=e._sp,o.uniformMap=c,o.pass=Ce.TERRAIN_CLASSIFICATION,s=Ze.shallowClone(o,o.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=Ce.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=s,o=t[r+1],l(o)||(o=t[r+1]=new Ze({owner:e,primitiveType:n._primitiveType})),o.vertexArray=g,o.renderState=e._rsColorPass,o.shaderProgram=e._spColor,o.pass=Ce.TERRAIN_CLASSIFICATION;let x=e.appearance.material;if(l(x)&&(c=rt(c,x._uniforms)),o.uniformMap=c,s=Ze.shallowClone(o,o.derivedCommands.tileset),s.pass=Ce.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=s,u){let C=Ze.shallowClone(o,o.derivedCommands.appearance2D);C.shaderProgram=e._spColor2D,o.derivedCommands.appearance2D=C,C=Ze.shallowClone(s,s.derivedCommands.appearance2D),C.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=C}}let f=e._commandsIgnoreShow,d=e._spStencil,p=0;i=f.length=i/2;for(let g=0;g<i;++g){let m=f[g]=Ze.shallowClone(t[p],f[g]);m.shaderProgram=d,m.pass=Ce.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function X2e(e,t){let n=e._usePickOffsets,i=e._primitive,r=i._va.length*2,o,s=0,a;n&&(o=i._pickOffsets,r=o.length*2),t.length=r;let c,u,f,d=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(c=0;c<r;c+=2){let m=i._va[d++];if(n&&(a=o[s++],m=i._va[a.index]),u=t[c],l(u)||(u=t[c]=new Ze({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=Ce.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=Ze.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=Ce.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[c+1],l(u)||(u=t[c+1]=new Ze({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=Ce.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=Ze.shallowClone(u,u.derivedCommands.tileset),f.pass=Ce.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,g){let x=Ze.shallowClone(u,u.derivedCommands.pick2D);x.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=x,x=Ze.shallowClone(f,f.derivedCommands.pick2D),x.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=x}}}function K2e(e,t,n,i,r,o,s){Y2e(e,o),X2e(e,s)}function Bre(e,t){return Math.floor(e%t/2)}function y6(e,t,n,i,r,o){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,e.debugShowBoundingVolume=o,t.commandList.push(e)}function Lre(e,t,n,i,r){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,t.commandList.push(e)}function $2e(e,t,n,i,r,o,s,a){let c=e._primitive;Tn._updateBoundingVolumes(c,t,r);let u;t.mode===te.SCENE3D?u=c._boundingSphereWC:t.mode===te.COLUMBUS_VIEW?u=c._boundingSphereCV:t.mode===te.SCENE2D&&l(c._boundingSphere2D)?u=c._boundingSphere2D:l(c._boundingSphereMorph)&&(u=c._boundingSphereMorph);let f=e.classificationType,d=f!==qn.CESIUM_3D_TILE,p=f!==qn.TERRAIN,g=t.passes,m,x,C;if(g.render){let A=n.length;for(m=0;m<A;++m)x=u[Bre(m,A)],d&&(C=n[m],y6(C,t,r,o,x,s)),p&&(C=n[m].derivedCommands.tileset,y6(C,t,r,o,x,s));if(t.invertClassification){let b=e._commandsIgnoreShow,T=b.length;for(m=0;m<T;++m)x=u[m],C=b[m],y6(C,t,r,o,x,s)}}if(g.pick){let A=i.length,b=c._pickOffsets;for(m=0;m<A;++m){let T=b[Bre(m,A)];x=u[T.index],d&&(C=i[m],Lre(C,t,r,o,x)),p&&(C=i[m].derivedCommands.tileset,Lre(C,t,r,o,x))}}}Jy.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!l(this._primitive)){let r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,s,a,c,u=!1,f=!0,d,p=!1,g=!1;for(o>0&&(c=r[0].attributes,p=ef.hasAttributesForSphericalExtents(c),g=ef.hasAttributesForTextureCoordinatePlanes(c),d=c.color),s=0;s<o;s++){a=r[s];let x=a.attributes.color;l(x)&&(u=!0),f=f&&l(x)&&Ot.equals(d,x)}if(!f&&!p&&!g)throw new ye("All GeometryInstances must have the same color attribute except via GroundPrimitives");u&&!l(t)&&(t=new rn({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=u;let m=new Array(o);for(s=0;s<o;++s)a=r[s],m[s]=new pt({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:y(this._pickPrimitive,n)});i.appearance=t,i.geometryInstances=m,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(x,C){n._createBoundingVolumeFunction(x,C)}),i._createRenderStatesFunction=function(x,C,A,b){W2e(n,C)},i._createShaderProgramFunction=function(x,C,A){q2e(n,C)},i._createCommandsFunction=function(x,C,A,b,T,S,w){K2e(n,void 0,void 0,!0,!1,S,w)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(x,C,A,b,T,S,w,D){n._updateAndQueueCommandsFunction(x,C,A,b,T,S,w,D)}:i._updateAndQueueCommandsFunction=function(x,C,A,b,T,S,w,D){$2e(n,C,A,b,T,S,w,D)},this._primitive=new Tn(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ve.fromCache(ST(!1,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(ST(!1,!0)),this._rsColorPass=Ve.fromCache(x6(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ve.fromCache(ST(!0,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(ST(!0,!0)),this._rsColorPass=Ve.fromCache(x6(!0))),this._primitive.appearance!==t&&(this._primitive.appearance=t),this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{l(this._primitive)&&this._primitive.ready&&this._completeLoad()})};Jy.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Jy.prototype.isDestroyed=function(){return!1};Jy.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,ue(this)};var bw=Jy;var Z2e={u_globeMinimumAltitude:function(){return 55e3}};function fl(e){e=y(e,y.EMPTY_OBJECT);let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let o=Array.isArray(n)?n:[n],s=o.length;for(let a=0;a<s;a++){let c=o[a].attributes;if(l(c)&&l(c.color)){t=new rn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,qn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1;let i=this;this._readyPromise=new Promise((o,s)=>{i._completeLoad=()=>{if(this._ready)return;this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let a=this._error;l(a)?s(a):o(this)}}),this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=fi._defaultMaxTerrainHeight,this._minTerrainHeight=fi._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let r=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:r,_extruded:!0,_uniformMap:Z2e}}Object.defineProperties(fl.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}}});fl.isSupported=bw.isSupported;function Nre(e){return function(t,n){let i=n.maximumRadius,r=i/Math.cos(t*.5)-i;return e._maxHeight+r}}function Fre(e){return function(t,n){return e._minHeight}}var J2e=new h,Q2e=new h,e3e=new h,t3e=new me,n3e=new he;function EL(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,r=t.attributes.position3DLow.values,o=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let d=0;d<o;d+=3){let p=h.unpack(i,d,J2e),g=h.unpack(r,d,Q2e),m=h.add(p,g,e3e),x=n.cartesianToCartographic(m,t3e),C=x.latitude,A=x.longitude;s=Math.min(s,C),a=Math.min(a,A),c=Math.max(c,C),u=Math.max(u,A)}let f=n3e;return f.north=c,f.south=s,f.east=u,f.west=a,f}function i3e(e,t,n){let i=fi.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function r3e(e,t,n){let i=t.mapProjection.ellipsoid,r=EL(t,n),o=Ai.fromRectangle(r,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(o),!t.scene3DOnly){let s=t.mapProjection,a=re.fromRectangleWithHeights2D(r,s,e._maxHeight,e._minHeight);h.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function C6(e,t){return Math.floor(e%t/2)}function A6(e,t,n,i,r,o,s){let a=e._primitive;n.mode!==te.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=s,n.commandList.push(t)}function Vre(e,t,n,i,r,o){let s=e._primitive;n.mode!==te.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,n.commandList.push(t)}function o3e(e,t,n,i,r,o,s,a){let c;t.mode===te.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let u=e.classificationType,f=u!==qn.CESIUM_3D_TILE,d=u!==qn.TERRAIN,p=t.passes,g=e._primitive,m,x,C;if(p.render){let A=n.length;for(m=0;m<A;++m)x=c[C6(m,A)],f&&(C=n[m],A6(e,C,t,r,o,x,s)),d&&(C=n[m].derivedCommands.tileset,A6(e,C,t,r,o,x,s));if(t.invertClassification){let b=g._commandsIgnoreShow,T=b.length;for(m=0;m<T;++m)x=c[m],C=b[m],A6(e,C,t,r,o,x,s)}}if(p.pick){let A=i.length,b;for(e._useFragmentCulling||(b=g._primitive._pickOffsets),m=0;m<A;++m){if(x=c[C6(m,A)],!e._useFragmentCulling){let T=b[C6(m,A)];x=c[T.index]}f&&(C=i[m],Vre(e,C,t,r,o,x)),d&&(C=i[m].derivedCommands.tileset,Vre(e,C,t,r,o,x))}}}fl.initializeTerrainHeights=function(){return fi.initialize()};fl.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!fi.initialized){fl.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,r,o,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,u=new Array(c),f,d;for(f=0;f<c;++f){r=a[f],o=r.geometry;let x=EL(e,o);l(d)?l(x)&&he.union(d,x,d):d=he.clone(x);let C=r.id;if(l(C)&&l(x)){let A=fi.getBoundingSphere(x,i);this._boundingSpheresKeys.push(C),this._boundingSpheres.push(A)}s=o.constructor,!l(s)||l(s.createShadowVolume)}i3e(this,d,i);let p=e.terrainExaggeration,g=e.terrainExaggerationRelativeHeight;this._minHeight=el.getHeight(this._minTerrainHeight,p,g),this._maxHeight=el.getHeight(this._maxTerrainHeight,p,g);let m=fl._supportsMaterials(e.context);if(this._useFragmentCulling=m,m){let x,C=!0;for(f=0;f<c;++f)if(r=a[f],o=r.geometry,d=EL(e,o),ef.shouldUseSphericalCoordinates(d)){C=!1;break}for(f=0;f<c;++f){r=a[f],o=r.geometry,s=o.constructor;let A=EL(e,o),b=o.textureCoordinateRotationPoints;C?x=ef.getPlanarTextureCoordinateAttributes(A,b,i,e.mapProjection,this._maxHeight):x=ef.getSphericalExtentGeometryInstanceAttributes(A,b,i,e.mapProjection);let T=r.attributes;for(let S in T)T.hasOwnProperty(S)&&(x[S]=T[S]);u[f]=new pt({geometry:s.createShadowVolume(o,Fre(this),Nre(this)),attributes:x,id:r.id})}}else for(f=0;f<c;++f)r=a[f],o=r.geometry,s=o.constructor,u[f]=new pt({geometry:s.createShadowVolume(o,Fre(this),Nre(this)),attributes:r.attributes,id:r.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(x,C){r3e(t,x,C)},n._updateAndQueueCommandsFunction=function(x,C,A,b,T,S,w,D){o3e(t,C,A,b,T,S,w,D)},this._primitive=new bw(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{l(this._primitive)&&this._primitive.ready&&this._completeLoad()})};fl.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};fl.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};fl.prototype.isDestroyed=function(){return!1};fl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};fl._supportsMaterials=function(e){return e.depthTexture};fl.supportsMaterials=function(e){return fl._supportsMaterials(e.frameState.context)};var dl=fl;function wT(){ye.throwInstantiationError()}Object.defineProperties(wT.prototype,{isConstant:{get:ye.throwInstantiationError},definitionChanged:{get:ye.throwInstantiationError}});wT.prototype.getType=ye.throwInstantiationError;wT.prototype.getValue=ye.throwInstantiationError;wT.prototype.equals=ye.throwInstantiationError;wT.getValue=function(e,t,n){let i;return l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=cr.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==cr.ColorType)&&(n=cr.fromType(cr.ColorType)),z.clone(z.WHITE,n.uniforms.color),n)};var lo=wT;function Qy(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}Qy.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!Y.getValueOrDefault(t.show,n,!0)};Qy.prototype._setOptions=ye.throwInstantiationError;Qy.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,r=this._orderedGroundPrimitives;n?r.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let o=this._entity,s=o[this._geometryUpdater._geometryPropertyName];if(this._setOptions(o,s,e),this._isHidden(o,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Dt,d,p=t._getIsClosed(c);if(f)d=new rn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=lo.getValue(e,u,this._material);this._material=g,d=new lr({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=rn.VERTEX_FORMAT,this._primitive=r.add(new dl({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:d,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),Y.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=d.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(d.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new Tn({geometryInstances:g,appearance:d,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=Y.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new Tn({geometryInstances:u,appearance:new rn({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};Qy.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,r;return l(n)&&n.show&&n.ready&&(r=n.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(re.clone(r.boundingSphere,e),st.DONE):l(i)&&i.show&&i.ready&&(r=i.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(re.clone(r.boundingSphere,e),st.DONE):l(n)&&!n.ready||l(i)&&!i.ready?st.PENDING:st.FAILED};Qy.prototype.isDestroyed=function(){return!1};Qy.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),ue(this)};var ai=Qy;var SL=`#ifdef GL_EXT_frag_depth
- #extension GL_EXT_frag_depth : enable
- #endif
- varying vec4 v_startPlaneNormalEcAndHalfWidth;
- varying vec4 v_endPlaneNormalEcAndBatchId;
- varying vec4 v_rightPlaneEC;
- varying vec4 v_endEcAndStartEcX;
- varying vec4 v_texcoordNormalizationAndStartEcYZ;
- #ifdef PER_INSTANCE_COLOR
- varying vec4 v_color;
- #endif
- void main(void)
- {
- float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture2D(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));
- vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw);
- if (logDepthOrDepth == 0.0) {
- #ifdef DEBUG_SHOW_VOLUME
- gl_FragColor = vec4(1.0, 0.0, 0.0, 0.5);
- return;
- #else // DEBUG_SHOW_VOLUME
- discard;
- #endif // DEBUG_SHOW_VOLUME
- }
- vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
- eyeCoordinate /= eyeCoordinate.w;
- float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);
- float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);
- float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz);
- float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz);
- if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {
- #ifdef DEBUG_SHOW_VOLUME
- gl_FragColor = vec4(1.0, 0.0, 0.0, 0.5);
- return;
- #else // DEBUG_SHOW_VOLUME
- discard;
- #endif // DEBUG_SHOW_VOLUME
- }
- vec3 alignedPlaneNormal;
- alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz);
- alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));
- distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz);
- alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz);
- alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));
- distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz);
- #ifdef PER_INSTANCE_COLOR
- gl_FragColor = czm_gammaCorrect(v_color);
- #else // PER_INSTANCE_COLOR
- float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0);
- s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y;
- float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth);
- czm_materialInput materialInput;
- materialInput.s = s;
- materialInput.st = vec2(s, t);
- materialInput.str = vec3(s, t, 0.0);
- czm_material material = czm_getMaterial(materialInput);
- gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);
- #endif // PER_INSTANCE_COLOR
- gl_FragColor.rgb *= gl_FragColor.a;
- czm_writeDepthClamp();
- }
- `;var wL=`varying vec3 v_forwardDirectionEC;
- varying vec3 v_texcoordNormalizationAndHalfWidth;
- varying float v_batchId;
- #ifdef PER_INSTANCE_COLOR
- varying vec4 v_color;
- #else
- varying vec2 v_alignedPlaneDistances;
- varying float v_texcoordT;
- #endif
- float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) {
- return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction);
- }
- void main(void)
- {
- vec4 eyeCoordinate = gl_FragCoord;
- eyeCoordinate /= eyeCoordinate.w;
- #ifdef PER_INSTANCE_COLOR
- gl_FragColor = czm_gammaCorrect(v_color);
- #else // PER_INSTANCE_COLOR
- float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x);
- float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y);
- distanceFromStart = max(0.0, distanceFromStart);
- distanceFromEnd = max(0.0, distanceFromEnd);
- float s = distanceFromStart / (distanceFromStart + distanceFromEnd);
- s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y;
- czm_materialInput materialInput;
- materialInput.s = s;
- materialInput.st = vec2(s, v_texcoordT);
- materialInput.str = vec3(s, v_texcoordT, 0.0);
- czm_material material = czm_getMaterial(materialInput);
- gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);
- #endif // PER_INSTANCE_COLOR
- }
- `;var vL=`attribute vec3 position3DHigh;
- attribute vec3 position3DLow;
- attribute vec4 startHiAndForwardOffsetX;
- attribute vec4 startLoAndForwardOffsetY;
- attribute vec4 startNormalAndForwardOffsetZ;
- attribute vec4 endNormalAndTextureCoordinateNormalizationX;
- attribute vec4 rightNormalAndTextureCoordinateNormalizationY;
- attribute vec4 startHiLo2D;
- attribute vec4 offsetAndRight2D;
- attribute vec4 startEndNormals2D;
- attribute vec2 texcoordNormalization2D;
- attribute float batchId;
- varying vec3 v_forwardDirectionEC;
- varying vec3 v_texcoordNormalizationAndHalfWidth;
- varying float v_batchId;
- #ifdef WIDTH_VARYING
- varying float v_width;
- #endif
- #ifdef ANGLE_VARYING
- varying float v_polylineAngle;
- #endif
- #ifdef PER_INSTANCE_COLOR
- varying vec4 v_color;
- #else
- varying vec2 v_alignedPlaneDistances;
- varying float v_texcoordT;
- #endif
- void main()
- {
- v_batchId = batchId;
- vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw));
- vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz);
- vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);
- vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;
- vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;
- vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;
- vec4 startPlane2D;
- vec4 startPlane3D;
- startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);
- startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;
- startPlane2D.w = -dot(startPlane2D.xyz, posEc2D);
- startPlane3D.w = -dot(startPlane3D.xyz, posEc3D);
- vec4 rightPlane2D;
- vec4 rightPlane3D;
- rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);
- rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;
- rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D);
- rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D);
- posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0);
- posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0);
- posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);
- posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;
- posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;
- vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;
- vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w));
- vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy));
- vec4 endPlane2D;
- vec4 endPlane3D;
- endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);
- endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;
- endPlane2D.w = -dot(endPlane2D.xyz, posEc2D);
- endPlane3D.w = -dot(endPlane3D.xyz, posEc3D);
- v_forwardDirectionEC = normalize(endEC - startEC);
- vec2 cleanTexcoordNormalization2D;
- cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x);
- cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y));
- vec2 cleanTexcoordNormalization3D;
- cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w);
- cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w;
- cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y));
- v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime);
- #ifdef PER_INSTANCE_COLOR
- v_color = czm_batchTable_color(batchId);
- #else // PER_INSTANCE_COLOR
- v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC);
- v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC);
- #endif // PER_INSTANCE_COLOR
- #ifdef WIDTH_VARYING
- float width = czm_batchTable_width(batchId);
- float halfWidth = width * 0.5;
- v_width = width;
- v_texcoordNormalizationAndHalfWidth.z = halfWidth;
- #else
- float halfWidth = 0.5 * czm_batchTable_width(batchId);
- v_texcoordNormalizationAndHalfWidth.z = halfWidth;
- #endif
- vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow);
- float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz));
- float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz));
- vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz);
- vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection));
- vec3 normalEC = normalize(cross(planeDirection, upOrDown));
- vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D));
- geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0);
- geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
- positionEc3D.xyz += geodeticSurfaceNormal;
- normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);
- positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC;
- vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);
- absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz));
- absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz));
- planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz);
- upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection));
- normalEC = normalize(cross(planeDirection, upOrDown));
- geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D));
- geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0);
- geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
- positionEc2D.xyz += geodeticSurfaceNormal;
- normalEC *= sign(texcoordNormalization2D.x);
- #ifndef PER_INSTANCE_COLOR
- v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0);
- #endif
- positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC;
- gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime);
- #ifdef ANGLE_VARYING
- vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y));
- approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);
- v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);
- #endif
- }
- `;var DL=`attribute vec3 position3DHigh;
- attribute vec3 position3DLow;
- #ifndef COLUMBUS_VIEW_2D
- attribute vec4 startHiAndForwardOffsetX;
- attribute vec4 startLoAndForwardOffsetY;
- attribute vec4 startNormalAndForwardOffsetZ;
- attribute vec4 endNormalAndTextureCoordinateNormalizationX;
- attribute vec4 rightNormalAndTextureCoordinateNormalizationY;
- #else
- attribute vec4 startHiLo2D;
- attribute vec4 offsetAndRight2D;
- attribute vec4 startEndNormals2D;
- attribute vec2 texcoordNormalization2D;
- #endif
- attribute float batchId;
- varying vec4 v_startPlaneNormalEcAndHalfWidth;
- varying vec4 v_endPlaneNormalEcAndBatchId;
- varying vec4 v_rightPlaneEC;
- varying vec4 v_endEcAndStartEcX;
- varying vec4 v_texcoordNormalizationAndStartEcYZ;
- #ifdef WIDTH_VARYING
- varying float v_width;
- #endif
- #ifdef ANGLE_VARYING
- varying float v_polylineAngle;
- #endif
- #ifdef PER_INSTANCE_COLOR
- varying vec4 v_color;
- #endif
- void main()
- {
- #ifdef COLUMBUS_VIEW_2D
- vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz;
- vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy);
- vec3 ecEnd = forwardDirectionEC + ecStart;
- forwardDirectionEC = normalize(forwardDirectionEC);
- v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);
- v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);
- vec4 startPlaneEC;
- startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);
- startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);
- vec4 endPlaneEC;
- endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);
- endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);
- v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x);
- v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y;
- #else // COLUMBUS_VIEW_2D
- vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz;
- vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w);
- vec3 ecEnd = ecStart + offset;
- vec3 forwardDirectionEC = normalize(offset);
- vec4 startPlaneEC;
- startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;
- startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);
- vec4 endPlaneEC;
- endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;
- endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);
- v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;
- v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);
- v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w);
- v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w;
- #endif // COLUMBUS_VIEW_2D
- v_endEcAndStartEcX.xyz = ecEnd;
- v_endEcAndStartEcX.w = ecStart.x;
- v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz;
- #ifdef PER_INSTANCE_COLOR
- v_color = czm_batchTable_color(batchId);
- #endif // PER_INSTANCE_COLOR
- vec4 positionRelativeToEye = czm_computePosition();
- vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye;
- float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz));
- float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz));
- vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz);
- vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection));
- vec3 normalEC = normalize(cross(planeDirection, upOrDown));
- upOrDown = cross(forwardDirectionEC, normalEC);
- upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown;
- upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown;
- upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown;
- positionEC.xyz += upOrDown;
- v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y));
- float width = czm_batchTable_width(batchId);
- #ifdef WIDTH_VARYING
- v_width = width;
- #endif
- v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz;
- v_startPlaneNormalEcAndHalfWidth.w = width * 0.5;
- v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz;
- v_endPlaneNormalEcAndBatchId.w = batchId;
- width = width * max(0.0, czm_metersPerPixel(positionEC));
- width = width / dot(normalEC, v_rightPlaneEC.xyz);
- #ifdef COLUMBUS_VIEW_2D
- normalEC *= sign(texcoordNormalization2D.x);
- #else
- normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);
- #endif
- positionEC.xyz += width * normalEC;
- gl_Position = czm_depthClamp(czm_projection * positionEC);
- #ifdef ANGLE_VARYING
- vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y));
- approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);
- v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);
- #endif
- }
- `;var PL=`attribute vec3 position3DHigh;
- attribute vec3 position3DLow;
- attribute vec3 prevPosition3DHigh;
- attribute vec3 prevPosition3DLow;
- attribute vec3 nextPosition3DHigh;
- attribute vec3 nextPosition3DLow;
- attribute vec2 expandAndWidth;
- attribute vec4 color;
- attribute float batchId;
- varying vec4 v_color;
- void main()
- {
- float expandDir = expandAndWidth.x;
- float width = abs(expandAndWidth.y) + 0.5;
- bool usePrev = expandAndWidth.y < 0.0;
- vec4 p = czm_computePosition();
- vec4 prev = czm_computePrevPosition();
- vec4 next = czm_computeNextPosition();
- float angle;
- vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);
- gl_Position = czm_viewportOrthographic * positionWC;
- v_color = color;
- }
- `;var tf=`void clipLineSegmentToNearPlane(
- vec3 p0,
- vec3 p1,
- out vec4 positionWC,
- out bool clipped,
- out bool culledByNearPlane,
- out vec4 clippedPositionEC)
- {
- culledByNearPlane = false;
- clipped = false;
- vec3 p0ToP1 = p1 - p0;
- float magnitude = length(p0ToP1);
- vec3 direction = normalize(p0ToP1);
- float endPoint0Distance = czm_currentFrustum.x + p0.z;
- float denominator = -direction.z;
- if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7)
- {
- culledByNearPlane = true;
- }
- else if (endPoint0Distance > 0.0)
- {
- float t = endPoint0Distance / denominator;
- if (t < 0.0 || t > magnitude)
- {
- culledByNearPlane = true;
- }
- else
- {
- p0 = p0 + t * direction;
- p0.z = min(p0.z, -czm_currentFrustum.x);
- clipped = true;
- }
- }
- clippedPositionEC = vec4(p0, 1.0);
- positionWC = czm_eyeToWindowCoordinates(clippedPositionEC);
- }
- vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle)
- {
- #ifdef POLYLINE_DASH
- vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);
- vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);
- vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);
- vec2 lineDir;
- if (usePrevious) {
- lineDir = normalize(positionWindow.xy - previousWindow.xy);
- }
- else {
- lineDir = normalize(nextWindow.xy - positionWindow.xy);
- }
- angle = atan(lineDir.x, lineDir.y) - 1.570796327;
- angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour;
- #endif
- vec4 clippedPrevWC, clippedPrevEC;
- bool prevSegmentClipped, prevSegmentCulled;
- clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC);
- vec4 clippedNextWC, clippedNextEC;
- bool nextSegmentClipped, nextSegmentCulled;
- clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC);
- bool segmentClipped, segmentCulled;
- vec4 clippedPositionWC, clippedPositionEC;
- clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC);
- if (segmentCulled)
- {
- return vec4(0.0, 0.0, 0.0, 1.0);
- }
- vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy);
- vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy);
- if (prevSegmentCulled)
- {
- directionToPrevWC = -directionToNextWC;
- }
- else if (nextSegmentCulled)
- {
- directionToNextWC = -directionToPrevWC;
- }
- vec2 thisSegmentForwardWC, otherSegmentForwardWC;
- if (usePrevious)
- {
- thisSegmentForwardWC = -directionToPrevWC;
- otherSegmentForwardWC = directionToNextWC;
- }
- else
- {
- thisSegmentForwardWC = directionToNextWC;
- otherSegmentForwardWC = -directionToPrevWC;
- }
- vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x);
- vec2 leftWC = thisSegmentLeftWC;
- float expandWidth = width * 0.5;
- if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1))
- {
- vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x);
- vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC;
- float leftSumLength = length(leftSumWC);
- leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength);
- vec2 u = -thisSegmentForwardWC;
- vec2 v = leftWC;
- float sinAngle = abs(u.x * v.y - u.y * v.x);
- expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);
- }
- vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio;
- return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w;
- }
- vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle)
- {
- vec4 positionEC = czm_modelViewRelativeToEye * position;
- vec4 prevEC = czm_modelViewRelativeToEye * previous;
- vec4 nextEC = czm_modelViewRelativeToEye * next;
- return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle);
- }
- `;var T6=`${tf}
- ${PL}`,s3e=CT;Et.isInternetExplorer()||(T6=`#define CLIP_POLYLINE
- ${T6}`);function ex(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=ex.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,T6),this._fragmentShaderSource=y(e.fragmentShaderSource,s3e),this._renderState=ar.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(ex.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});ex.VERTEX_FORMAT=Pe.POSITION_ONLY;ex.prototype.getFragmentShaderSource=ar.prototype.getFragmentShaderSource;ex.prototype.isTranslucent=ar.prototype.isTranslucent;ex.prototype.getRenderState=ar.prototype.getRenderState;var os=ex;var IL=`attribute vec3 position3DHigh;
- attribute vec3 position3DLow;
- attribute vec3 prevPosition3DHigh;
- attribute vec3 prevPosition3DLow;
- attribute vec3 nextPosition3DHigh;
- attribute vec3 nextPosition3DLow;
- attribute vec2 expandAndWidth;
- attribute vec2 st;
- attribute float batchId;
- varying float v_width;
- varying vec2 v_st;
- varying float v_polylineAngle;
- void main()
- {
- float expandDir = expandAndWidth.x;
- float width = abs(expandAndWidth.y) + 0.5;
- bool usePrev = expandAndWidth.y < 0.0;
- vec4 p = czm_computePosition();
- vec4 prev = czm_computePrevPosition();
- vec4 next = czm_computeNextPosition();
- float angle;
- vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);
- gl_Position = czm_viewportOrthographic * positionWC;
- v_width = width;
- v_st.s = st.s;
- v_st.t = czm_writeNonPerspective(st.t, gl_Position.w);
- v_polylineAngle = angle;
- }
- `;var vT=`#ifdef VECTOR_TILE
- uniform vec4 u_highlightColor;
- #endif
- varying vec2 v_st;
- void main()
- {
- czm_materialInput materialInput;
- vec2 st = v_st;
- st.t = czm_readNonPerspective(st.t, gl_FragCoord.w);
- materialInput.s = st.s;
- materialInput.st = st;
- materialInput.str = vec3(st, 0.0);
- czm_material material = czm_getMaterial(materialInput);
- gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);
- #ifdef VECTOR_TILE
- gl_FragColor *= u_highlightColor;
- #endif
- czm_writeLogDepth();
- }
- `;var b6=`${tf}
- ${IL}`,a3e=vT;Et.isInternetExplorer()||(b6=`#define CLIP_POLYLINE
- ${b6}`);function tx(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=tx.VERTEX_FORMAT;this.material=l(e.material)?e.material:cr.fromType(cr.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,b6),this._fragmentShaderSource=y(e.fragmentShaderSource,a3e),this._renderState=ar.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(tx.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/varying\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH
- ${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});tx.VERTEX_FORMAT=Pe.POSITION_AND_ST;tx.prototype.getFragmentShaderSource=ar.prototype.getFragmentShaderSource;tx.prototype.isTranslucent=ar.prototype.isTranslucent;tx.prototype.getRenderState=ar.prototype.getRenderState;var pa=tx;function mp(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new pa),this.appearance=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,qn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1;let n=this;this._readyPromise=new Promise((i,r)=>{n._completeLoad=()=>{this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let o=this._error;l(o)?r(o):i(this)}}),this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=kre(!1),this._renderState3DTiles=kre(!0),this._renderStateMorph=Ve.fromCache({cull:{enabled:!0,face:Yi.FRONT},depthTest:{enabled:!0},blending:hn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(mp.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});mp.initializeTerrainHeights=function(){return fi.initialize()};function c3e(e,t,n){let i=t.context,r=e._primitive,o=r._attributeLocations,s=r._batchTable.getVertexShaderCallback()(DL);s=Tn._appendShowToShader(r,s),s=Tn._appendDistanceDisplayConditionToShader(r,s),s=Tn._modifyShaderPosition(e,s,t.scene3DOnly);let a=r._batchTable.getVertexShaderCallback()(vL);a=Tn._appendShowToShader(r,a),a=Tn._appendDistanceDisplayConditionToShader(r,a),a=Tn._modifyShaderPosition(e,a,t.scene3DOnly);let c=r._batchTable.getVertexShaderCallback()(SL),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",d="";l(n.material)?(d=l(n.material)?n.material.shaderSource:"",d.search(/varying\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),d.search(/varying\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],g=new Fe({defines:u,sources:[s]}),m=new Fe({defines:p,sources:[d,c]});e._sp=Wt.replaceCache({context:i,shaderProgram:r._sp,vertexShaderSource:g,fragmentShaderSource:m,attributeLocations:o});let x=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(x)){let A=new Fe({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});x=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:A,fragmentShaderSource:m,attributeLocations:o})}e._sp2D=x;let C=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(C)){let A=new Fe({defines:u.concat([`MAX_TERRAIN_HEIGHT ${fi._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=r._batchTable.getVertexShaderCallback()(wL);let b=new Fe({defines:p,sources:[d,c]});C=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:A,fragmentShaderSource:b,attributeLocations:o})}e._spMorph=C}function kre(e){return Ve.fromCache({cull:{enabled:!0},blending:hn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:yi.EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:yi.EQUAL,backOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},reference:tn.CESIUM_3D_TILE_MASK,mask:tn.CESIUM_3D_TILE_MASK}})}function l3e(e,t,n,i,r,o){let s=e._primitive,a=s._va.length;r.length=a,o.length=a;let u=t instanceof os?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let d=0;d<a;d++){let p=s._va[d],g=r[d];l(g)||(g=r[d]=new Ze({owner:e,primitiveType:s._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=f,g.pass=Ce.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let m=Ze.shallowClone(g,g.derivedCommands.tileset);m.renderState=e._renderState3DTiles,m.pass=Ce.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=m;let x=Ze.shallowClone(g,g.derivedCommands.color2D);x.shaderProgram=e._sp2D,g.derivedCommands.color2D=x;let C=Ze.shallowClone(m,m.derivedCommands.color2D);C.shaderProgram=e._sp2D,m.derivedCommands.color2D=C;let A=Ze.shallowClone(g,g.derivedCommands.colorMorph);A.renderState=e._renderStateMorph,A.shaderProgram=e._spMorph,A.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=A}}function Ure(e,t,n,i,r,o,s){n.mode===te.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==te.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=s,n.commandList.push(t)}function u3e(e,t,n,i,r,o,s){let a=e._primitive;Tn._updateBoundingVolumes(a,t,r);let c;t.mode===te.SCENE3D?c=a._boundingSphereWC:t.mode===te.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===te.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let u=t.mode===te.MORPHING,f=e.classificationType,d=f!==qn.CESIUM_3D_TILE,p=f!==qn.TERRAIN&&!u,g,m=t.passes;if(m.render||m.pick&&a.allowPicking){let x=n.length;for(let C=0;C<x;++C){let A=c[C];d&&(g=n[C],Ure(e,g,t,r,o,A,s)),p&&(g=n[C].derivedCommands.tileset,Ure(e,g,t,r,o,A,s))}}}mp.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!fi.initialized){mp.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,s=new Array(o),a;for(t=0;t<o;++t)if(a=r[t].attributes,!l(a)||!l(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<o;++t){let c=r[t];a={};let u=c.attributes;for(let f in u)u.hasOwnProperty(f)&&(a[f]=u[f]);l(a.width)||(a.width=new Ac({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,qA.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new pt({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,u,f){c3e(n,u,f)},i._createCommandsFunction=function(c,u,f,d,p,g,m){l3e(n,u,f,d,g,m)},i._updateAndQueueCommandsFunction=function(c,u,f,d,p,g,m,x){u3e(n,u,f,d,p,g,m)},this._primitive=new Tn(i),this._primitive.readyPromise.then(this._completeLoad)}if(this.appearance instanceof os&&!this._hasPerInstanceColors)throw new ye("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e)};mp.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};mp.isSupported=function(e){return e.frameState.context.depthTexture};mp.prototype.isDestroyed=function(){return!1};mp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,ue(this)};var zh=mp;var f3e=new W(1,1),d3e=!1,h3e=z.WHITE;function DT(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new ge,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(DT.prototype,{isConstant:{get:function(){return Y.isConstant(this._image)&&Y.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:le("image"),repeat:le("repeat"),color:le("color"),transparent:le("transparent")});DT.prototype.getType=function(e){return"Image"};DT.prototype.getValue=function(e,t){return l(t)||(t={}),t.image=Y.getValueOrUndefined(this._image,e),t.repeat=Y.getValueOrClonedDefault(this._repeat,e,f3e,t.repeat),t.color=Y.getValueOrClonedDefault(this._color,e,h3e,t.color),Y.getValueOrDefault(this._transparent,e,d3e)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};DT.prototype.equals=function(e){return this===e||e instanceof DT&&Y.equals(this._image,e._image)&&Y.equals(this._repeat,e._repeat)&&Y.equals(this._color,e._color)&&Y.equals(this._transparent,e._transparent)};var nx=DT;function m3e(e){if(e instanceof z)return new Dt(e);if(typeof e=="string"||e instanceof De||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new nx;return t.image=e,t}}function p3e(e,t){return le(e,t,m3e)}var kr=p3e;function Ew(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Ew.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),dimensions:le("dimensions"),heightReference:le("heightReference"),fill:le("fill"),material:kr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});Ew.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Ew(this)};Ew.prototype.merge=function(e){this.show=y(this.show,e.show),this.dimensions=y(this.dimensions,e.dimensions),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var PT=Ew;function IT(){ye.throwInstantiationError()}Object.defineProperties(IT.prototype,{isConstant:{get:ye.throwInstantiationError},definitionChanged:{get:ye.throwInstantiationError},referenceFrame:{get:ye.throwInstantiationError}});IT.prototype.getValue=ye.throwInstantiationError;IT.prototype.getValueInReferenceFrame=ye.throwInstantiationError;IT.prototype.equals=ye.throwInstantiationError;var E6=new Q;IT.convertToReferenceFrame=function(e,t,n,i,r){if(!l(t))return t;if(l(r)||(r=new h),n===i)return h.clone(t,r);let o=yt.computeIcrfToFixedMatrix(e,E6);if(l(o)||(o=yt.computeTemeToPseudoFixedMatrix(e,E6)),n===sr.INERTIAL)return Q.multiplyByVector(o,t,r);if(n===sr.FIXED)return Q.multiplyByVector(Q.transpose(o,E6),t,r)};var hg=IT;function ix(e,t){this._definitionChanged=new ge,this._value=h.clone(e),this._referenceFrame=y(t,sr.FIXED)}Object.defineProperties(ix.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===sr.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});ix.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,sr.FIXED,t)};ix.prototype.setValue=function(e,t){let n=!1;h.equals(this._value,e)||(n=!0,this._value=h.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};ix.prototype.getValueInReferenceFrame=function(e,t,n){return hg.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};ix.prototype.equals=function(e){return this===e||e instanceof ix&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var hl=ix;function Sw(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Sw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:kr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});Sw.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new Sw(this)};Sw.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var OT=Sw;function _3e(e){return e}function g3e(e,t){return le(e,t,_3e)}var jl=g3e;function ww(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(ww.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),length:le("length"),topRadius:le("topRadius"),bottomRadius:le("bottomRadius"),heightReference:le("heightReference"),fill:le("fill"),material:kr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),slices:le("slices"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});ww.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new ww(this)};ww.prototype.merge=function(e){this.show=y(this.show,e.show),this.length=y(this.length,e.length),this.topRadius=y(this.topRadius,e.topRadius),this.bottomRadius=y(this.bottomRadius,e.bottomRadius),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=y(this.slices,e.slices),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var RT=ww;function vw(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(vw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),semiMajorAxis:le("semiMajorAxis"),semiMinorAxis:le("semiMinorAxis"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:kr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});vw.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new vw(this)};vw.prototype.merge=function(e){this.show=y(this.show,e.show),this.semiMajorAxis=y(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=y(this.semiMinorAxis,e.semiMinorAxis),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var MT=vw;function Dw(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Dw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),radii:le("radii"),innerRadii:le("innerRadii"),minimumClock:le("minimumClock"),maximumClock:le("maximumClock"),minimumCone:le("minimumCone"),maximumCone:le("maximumCone"),heightReference:le("heightReference"),fill:le("fill"),material:kr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),stackPartitions:le("stackPartitions"),slicePartitions:le("slicePartitions"),subdivisions:le("subdivisions"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});Dw.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Dw(this)};Dw.prototype.merge=function(e){this.show=y(this.show,e.show),this.radii=y(this.radii,e.radii),this.innerRadii=y(this.innerRadii,e.innerRadii),this.minimumClock=y(this.minimumClock,e.minimumClock),this.maximumClock=y(this.maximumClock,e.maximumClock),this.minimumCone=y(this.minimumCone,e.minimumCone),this.maximumCone=y(this.maximumCone,e.maximumCone),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.stackPartitions=y(this.stackPartitions,e.stackPartitions),this.slicePartitions=y(this.slicePartitions,e.slicePartitions),this.subdivisions=y(this.subdivisions,e.subdivisions),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var BT=Dw;function Pw(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Pw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),text:le("text"),font:le("font"),style:le("style"),scale:le("scale"),showBackground:le("showBackground"),backgroundColor:le("backgroundColor"),backgroundPadding:le("backgroundPadding"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),fillColor:le("fillColor"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),scaleByDistance:le("scaleByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});Pw.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new Pw(this)};Pw.prototype.merge=function(e){this.show=y(this.show,e.show),this.text=y(this.text,e.text),this.font=y(this.font,e.font),this.style=y(this.style,e.style),this.scale=y(this.scale,e.scale),this.showBackground=y(this.showBackground,e.showBackground),this.backgroundColor=y(this.backgroundColor,e.backgroundColor),this.backgroundPadding=y(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=y(this.pixelOffset,e.pixelOffset),this.eyeOffset=y(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this.verticalOrigin,e.verticalOrigin),this.heightReference=y(this.heightReference,e.heightReference),this.fillColor=y(this.fillColor,e.fillColor),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=y(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var Hh=Pw;var S6=new sp;function Iw(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new ge,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(Iw.prototype,{isConstant:{get:function(){return Y.isConstant(this._translation)&&Y.isConstant(this._rotation)&&Y.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:le("translation"),rotation:le("rotation"),scale:le("scale")});Iw.prototype.getValue=function(e,t){return l(t)||(t=new sp),t.translation=Y.getValueOrClonedDefault(this._translation,e,S6.translation,t.translation),t.rotation=Y.getValueOrClonedDefault(this._rotation,e,S6.rotation,t.rotation),t.scale=Y.getValueOrClonedDefault(this._scale,e,S6.scale,t.scale),t};Iw.prototype.equals=function(e){return this===e||e instanceof Iw&&Y.equals(this._translation,e._translation)&&Y.equals(this._rotation,e._rotation)&&Y.equals(this._scale,e._scale)};var LT=Iw;function pp(e,t){this._propertyNames=[],this._definitionChanged=new ge,l(e)&&this.merge(e,t)}Object.defineProperties(pp.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!Y.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});pp.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function y3e(e){return new Jn(e)}pp.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,le(e,!0,y(n,y3e))),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};pp.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};pp.prototype.getValue=function(e,t){l(t)||(t={});let n=this._propertyNames;for(let i=0,r=n.length;i<r;i++){let o=n[i];t[o]=Y.getValueOrUndefined(this[o],e,t[o])}return t};pp.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let r=0,o=i.length;r<o;r++){let s=i[r],a=this[s],c=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),c!==void 0&&(a!==void 0?l(a)&&l(a.merge)&&a.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[s]=c.clone():this[s]=c)}};function x3e(e,t){let n=e._propertyNames,i=t._propertyNames,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;++o){let s=n[o];if(i.indexOf(s)===-1||!Y.equals(e[s],t[s]))return!1}return!0}pp.prototype.equals=function(e){return this===e||e instanceof pp&&x3e(this,e)};var ql=pp;function zre(e){return new LT(e)}function C3e(e){return new ql(e,zre)}function A3e(e){return new ql(e)}function Ow(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._marsOptions=e&&e.marsOptions||{},this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Ow.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),uri:le("uri"),scale:le("scale"),minimumPixelSize:le("minimumPixelSize"),maximumScale:le("maximumScale"),incrementallyLoadTextures:le("incrementallyLoadTextures"),runAnimations:le("runAnimations"),clampAnimations:le("clampAnimations"),shadows:le("shadows"),heightReference:le("heightReference"),silhouetteColor:le("silhouetteColor"),silhouetteSize:le("silhouetteSize"),color:le("color"),colorBlendMode:le("colorBlendMode"),colorBlendAmount:le("colorBlendAmount"),imageBasedLightingFactor:le("imageBasedLightingFactor"),lightColor:le("lightColor"),distanceDisplayCondition:le("distanceDisplayCondition"),nodeTransformations:le("nodeTransformations",void 0,C3e),articulations:le("articulations",void 0,A3e),clippingPlanes:le("clippingPlanes")});Ow.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e):new Ow(this)};Ow.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.scale=y(this.scale,e.scale),this.minimumPixelSize=y(this.minimumPixelSize,e.minimumPixelSize),this.maximumScale=y(this.maximumScale,e.maximumScale),this.incrementallyLoadTextures=y(this.incrementallyLoadTextures,e.incrementallyLoadTextures),this.runAnimations=y(this.runAnimations,e.runAnimations),this.clampAnimations=y(this.clampAnimations,e.clampAnimations),this.shadows=y(this.shadows,e.shadows),this.heightReference=y(this.heightReference,e.heightReference),this.silhouetteColor=y(this.silhouetteColor,e.silhouetteColor),this.silhouetteSize=y(this.silhouetteSize,e.silhouetteSize),this.color=y(this.color,e.color),this.colorBlendMode=y(this.colorBlendMode,e.colorBlendMode),this.colorBlendAmount=y(this.colorBlendAmount,e.colorBlendAmount),this.imageBasedLightingFactor=y(this.imageBasedLightingFactor,e.imageBasedLightingFactor),this.lightColor=y(this.lightColor,e.lightColor),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.clippingPlanes=y(this.clippingPlanes,e.clippingPlanes);let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new ql(t,zre)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new ql(n)}};var mg=Ow;function Rw(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Rw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),uri:le("uri"),maximumScreenSpaceError:le("maximumScreenSpaceError")});Rw.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new Rw(this)};Rw.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.maximumScreenSpaceError=y(this.maximumScreenSpaceError,e.maximumScreenSpaceError)};var NT=Rw;function Mw(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Mw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),leadTime:le("leadTime"),trailTime:le("trailTime"),width:le("width"),resolution:le("resolution"),material:kr("material"),distanceDisplayCondition:le("distanceDisplayCondition")});Mw.prototype.clone=function(e){return l(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Mw(this)};Mw.prototype.merge=function(e){this.show=y(this.show,e.show),this.leadTime=y(this.leadTime,e.leadTime),this.trailTime=y(this.trailTime,e.trailTime),this.width=y(this.width,e.width),this.resolution=y(this.resolution,e.resolution),this.material=y(this.material,e.material),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var pg=Mw;function Bw(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Bw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),plane:le("plane"),dimensions:le("dimensions"),fill:le("fill"),material:kr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});Bw.prototype.clone=function(e){return l(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Bw(this)};Bw.prototype.merge=function(e){this.show=y(this.show,e.show),this.plane=y(this.plane,e.plane),this.dimensions=y(this.dimensions,e.dimensions),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var OL=Bw;function Lw(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Lw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),pixelSize:le("pixelSize"),heightReference:le("heightReference"),color:le("color"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),scaleByDistance:le("scaleByDistance"),translucencyByDistance:le("translucencyByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});Lw.prototype.clone=function(e){return l(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new Lw(this)};Lw.prototype.merge=function(e){this.show=y(this.show,e.show),this.pixelSize=y(this.pixelSize,e.pixelSize),this.heightReference=y(this.heightReference,e.heightReference),this.color=y(this.color,e.color),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var FT=Lw;function T3e(e){return Array.isArray(e)&&(e=new ul(e)),new Jn(e)}function Nw(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Nw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),hierarchy:le("hierarchy",void 0,T3e),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:kr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),perPositionHeight:le("perPositionHeight"),closeTop:le("closeTop"),closeBottom:le("closeBottom"),arcType:le("arcType"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex"),textureCoordinates:le("textureCoordinates")});Nw.prototype.clone=function(e){return l(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new Nw(this)};Nw.prototype.merge=function(e){this.show=y(this.show,e.show),this.hierarchy=y(this.hierarchy,e.hierarchy),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.perPositionHeight=y(this.perPositionHeight,e.perPositionHeight),this.closeTop=y(this.closeTop,e.closeTop),this.closeBottom=y(this.closeBottom,e.closeBottom),this.arcType=y(this.arcType,e.arcType),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex),this.textureCoordinates=y(this.textureCoordinates,e.textureCoordinates)};var Gh=Nw;function Fw(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Fw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),granularity:le("granularity"),material:kr("material"),depthFailMaterial:kr("depthFailMaterial"),arcType:le("arcType"),clampToGround:le("clampToGround"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});Fw.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new Fw(this)};Fw.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.granularity=y(this.granularity,e.granularity),this.material=y(this.material,e.material),this.depthFailMaterial=y(this.depthFailMaterial,e.depthFailMaterial),this.arcType=y(this.arcType,e.arcType),this.clampToGround=y(this.clampToGround,e.clampToGround),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var vc=Fw;function Vw(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Vw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),shape:le("shape"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:kr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});Vw.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Vw(this)};Vw.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.shape=y(this.shape,e.shape),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var VT=Vw;function kw(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(kw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),coordinates:le("coordinates"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:kr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});kw.prototype.clone=function(e){return l(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new kw(this)};kw.prototype.merge=function(e){this.show=y(this.show,e.show),this.coordinates=y(this.coordinates,e.coordinates),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var Wh=kw;function Uw(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Uw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),minimumHeights:le("minimumHeights"),maximumHeights:le("maximumHeights"),granularity:le("granularity"),fill:le("fill"),material:kr("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});Uw.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Uw(this)};Uw.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.minimumHeights=y(this.minimumHeights,e.minimumHeights),this.maximumHeights=y(this.maximumHeights,e.maximumHeights),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var _g=Uw;var b3e=new me;function E3e(e){return new hl(e)}function S3e(e){return le(e,void 0,E3e)}function Gs(e,t){return le(e,void 0,function(n){return n instanceof t?n:new t(n)})}function jh(e){e=y(e,y.EMPTY_OBJECT);let t=e.id;l(t)||(t=Ln()),this._availability=void 0,this._id=t,this._definitionChanged=new ge,this._name=e.name,this._show=y(e.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall"],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function w6(e,t,n){let i=t.length;for(let r=0;r<i;r++){let o=t[r],s=o._show;(!n&&s)!==(n&&s)&&w6(o,o._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(jh.prototype,{availability:jl("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:jl("name"),show:{get:function(){return this._show},set:function(e){if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&w6(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},isShowing:{get:function(){return this._show&&(!l(this.entityCollection)||this.entityCollection.show)&&(!l(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let n=this.isShowing;if(l(t)){let r=t._children.indexOf(this);t._children.splice(r,1)}this._parent=e,l(e)&&e._children.push(this);let i=this.isShowing;n!==i&&w6(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Gs("billboard",Ec),box:Gs("box",PT),corridor:Gs("corridor",OT),cylinder:Gs("cylinder",RT),description:le("description"),ellipse:Gs("ellipse",MT),ellipsoid:Gs("ellipsoid",BT),label:Gs("label",Hh),model:Gs("model",mg),tileset:Gs("tileset",NT),orientation:le("orientation"),path:Gs("path",pg),plane:Gs("plane",OL),point:Gs("point",FT),polygon:Gs("polygon",Gh),polyline:Gs("polyline",vc),polylineVolume:Gs("polylineVolume",VT),properties:Gs("properties",ql),position:S3e("position"),rectangle:Gs("rectangle",Wh),viewFrom:le("viewFrom"),wall:Gs("wall",_g)});jh.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};jh.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,jl(e,!0))};jh.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};jh.prototype.merge=function(e){this.name=y(this.name,e.name),this.availability=y(this.availability,e.availability);let t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o==="parent"||o==="name"||o==="availability")continue;let s=this[o],a=e[o];!l(s)&&t.indexOf(o)===-1&&this.addProperty(o),l(a)&&(l(s)?l(s.merge)&&s.merge(a):l(a.merge)&&l(a.clone)?this[o]=a.clone():this[o]=a)}};var Hre=new Q,Gre=new h,Wre=new Re;jh.prototype.computeModelMatrix=function(e,t){let n=Y.getValueOrUndefined(this._position,e,Gre);if(!l(n))return;let i=Y.getValueOrUndefined(this._orientation,e,Wre);return l(i)?t=N.fromRotationTranslation(Q.fromQuaternion(i,Hre),n,t):t=yt.eastNorthUpToFixedFrame(n,void 0,t),t};jh.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,r){let o=Y.getValueOrDefault(t,e,ze.NONE),s=Y.getValueOrUndefined(this._position,e,Gre);if(o===ze.NONE||!l(s)||h.equalsEpsilon(s,h.ZERO,M.EPSILON8))return this.computeModelMatrix(e,r);let a=i.cartesianToCartographic(s,b3e);o===ze.CLAMP_TO_GROUND?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=Y.getValueOrUndefined(this._orientation,e,Wre);return l(c)?r=N.fromRotationTranslation(Q.fromQuaternion(c,Hre),s,r):r=yt.eastNorthUpToFixedFrame(s,void 0,r),r};jh.supportsMaterialsforEntitiesOnTerrain=function(e){return dl.supportsMaterials(e)};jh.supportsPolylinesOnTerrain=function(e){return zh.isSupported(e)};var uo=jh;var w3e=new Dt(z.WHITE),v3e=new Jn(!0),D3e=new Jn(!0),P3e=new Jn(!1),I3e=new Jn(z.BLACK),O3e=new Jn(Zt.DISABLED),R3e=new Jn(new Tt),M3e=new Jn(qn.BOTH);function Dc(e){let t=e.entity,n=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new ge,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=uo.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Dc.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&Y.isConstant(this._showProperty)&&Y.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!l(this._entity.availability)&&Y.isConstant(this._showProperty)&&Y.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}});Dc.prototype.isOutlineVisible=function(e){let t=this._entity,n=this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e);return y(n,!1)};Dc.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e);return y(n,!1)};Dc.prototype.createFillGeometryInstance=ye.throwInstantiationError;Dc.prototype.createOutlineGeometryInstance=ye.throwInstantiationError;Dc.prototype.isDestroyed=function(){return!1};Dc.prototype.destroy=function(){ue(this)};Dc.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(ke.MINIMUM_VALUE)};Dc.prototype._isOnTerrain=function(e,t){return!1};Dc.prototype._getIsClosed=function(e){return!0};Dc.prototype._isDynamic=ye.throwInstantiationError;Dc.prototype._setStaticOptions=ye.throwInstantiationError;Dc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.fill,s=l(o)&&o.isConstant?o.getValue(ke.MINIMUM_VALUE):!0,a=r.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(ke.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=r.show;if(this._isHidden(e,r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=y(r.material,w3e),this._fillProperty=y(o,D3e),this._showProperty=y(u,v3e),this._showOutlineProperty=y(r.outline,P3e),this._outlineColorProperty=c?y(r.outlineColor,I3e):void 0,this._shadowsProperty=y(r.shadows,O3e),this._distanceDisplayConditionProperty=y(r.distanceDisplayCondition,R3e),this._classificationTypeProperty=y(r.classificationType,M3e),this._fillEnabled=s;let f=this._isOnTerrain(e,r)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Dt);if(c&&f&&(Lt(Lt.geometryOutlines),c=!1),this._onTerrain=f,this._outlineEnabled=c,this._isDynamic(e,r))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,r),this._isClosed=this._getIsClosed(this._options);let d=r.outlineWidth;this._outlineWidth=l(d)?d.getValue(ke.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Dc.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var ci=Dc;function kT(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new ge,this.setCallback(e,t)}Object.defineProperties(kT.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});kT.prototype.getValue=function(e,t){return this._callback(e,t)};kT.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};kT.prototype.equals=function(e){return this===e||e instanceof kT&&this._callback===e._callback&&this._isConstant===e._isConstant};var qh=kT;var jre=new h,B3e=new me;function UT(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new h,this._cartographicPosition=new me,this._normal=new h,this._definitionChanged=new ge,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let r=this;if(l(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){r._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){r._updateClamping()})),t.isConstant){let o=t.getValue(ke.MINIMUM_VALUE,jre);if(!l(o)||h.equals(o,h.ZERO)||!l(e.globe))return;this._position=h.clone(o,this._position),this._updateClamping(),this._normal=e.globe.ellipsoid.geodeticSurfaceNormal(o,this._normal)}}Object.defineProperties(UT.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});UT.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=e.globe,n=this._position;if(!l(t)||h.equals(n,h.ZERO)){this._terrainHeight=0;return}let i=t.ellipsoid,r=t._surface,o=this,s=i.cartesianToCartographic(n,this._cartographicPosition),a=t.getHeight(s);l(a)?this._terrainHeight=a:this._terrainHeight=0;function c(u){if(e.mode===te.SCENE3D){let f=i.cartesianToCartographic(u,B3e);o._terrainHeight=f.height}else o._terrainHeight=u.x;o.definitionChanged.raiseEvent()}this._removeCallbackFunc=r.updateHeight(s,c)};UT.prototype.getValue=function(e,t){let n=Y.getValueOrDefault(this._heightReference,e,ze.NONE),i=Y.getValueOrDefault(this._extrudedHeightReference,e,ze.NONE);if(n===ze.NONE&&i!==ze.RELATIVE_TO_GROUND)return this._position=h.clone(h.ZERO,this._position),h.clone(h.ZERO,t);if(this._positionProperty.isConstant)return h.multiplyByScalar(this._normal,this._terrainHeight,t);let r=this._scene,o=this._positionProperty.getValue(e,jre);if(!l(o)||h.equals(o,h.ZERO)||!l(r.globe))return h.clone(h.ZERO,t);if(h.equalsEpsilon(this._position,o,M.EPSILON10))return h.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=h.clone(o,this._position),this._updateClamping();let s=r.globe.ellipsoid.geodeticSurfaceNormal(o,this._normal);return h.multiplyByScalar(s,this._terrainHeight,t)};UT.prototype.isDestroyed=function(){return!1};UT.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),ue(this)};var zT=UT;function L3e(e,t,n,i){if(ci.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference;if(l(o)){let s=new qh(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new zT(this._scene,s,o)}}var gg=L3e;var qre=h.ZERO,Yre=new h,N3e=new h,Xre=new z;function F3e(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function Yl(e,t){ci.call(this,{entity:e,scene:t,geometryOptions:new F3e(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(Yl.prototype=Object.create(ci.prototype),Yl.prototype.constructor=Yl);Object.defineProperties(Yl.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Yl.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=kn.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o,color:void 0,offset:void 0};if(this._materialProperty instanceof Dt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Xre)),l(a)||(a=z.WHITE),s.color=Ot.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=nr.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,qre,Yre))),new pt({id:t,geometry:Vl.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.mapProjection.ellipsoid),attributes:s})};Yl.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Xre),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ot.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=nr.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,qre,Yre))),new pt({id:t,geometry:Ch.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.mapProjection.ellipsoid),attributes:o})};Yl.prototype._computeCenter=function(e,t){return Y.getValueOrUndefined(this._entity.position,e,t)};Yl.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||ci.prototype._isHidden.call(this,e,t)};Yl.prototype._isDynamic=function(e,t){return!e.position.isConstant||!Y.isConstant(e.orientation)||!t.dimensions.isConstant||!Y.isConstant(t.outlineWidth)};Yl.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrDefault(t.heightReference,ke.MINIMUM_VALUE,ze.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Dt?rn.VERTEX_FORMAT:lr.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(ke.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==ze.NONE?nn.ALL:void 0};Yl.prototype._onEntityPropertyChanged=gg;Yl.DynamicGeometryUpdater=HT;function HT(e,t,n){ai.call(this,e,t,n)}l(Object.create)&&(HT.prototype=Object.create(ai.prototype),HT.prototype.constructor=HT);HT.prototype._isHidden=function(e,t,n){let i=Y.getValueOrUndefined(e.position,n,N3e),r=this._options.dimensions;return!l(i)||!l(r)||ai.prototype._isHidden.call(this,e,t,n)};HT.prototype._setOptions=function(e,t,n){let i=Y.getValueOrDefault(t.heightReference,n,ze.NONE),r=this._options;r.dimensions=Y.getValueOrUndefined(t.dimensions,n,r.dimensions),r.offsetAttribute=i!==ze.NONE?nn.ALL:void 0};var RL=Yl;function Kre(e){e=y(e,y.EMPTY_OBJECT),this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=y(e.persists,!1),this.pass=Ce.COMPUTE,this.owner=e.owner}Kre.prototype.execute=function(e){e.execute(this)};var cd=Kre;var ML=`varying vec2 v_textureCoordinates;
- uniform float originalSize;
- uniform sampler2D texture0;
- uniform sampler2D texture1;
- uniform sampler2D texture2;
- uniform sampler2D texture3;
- uniform sampler2D texture4;
- uniform sampler2D texture5;
- const float yMipLevel1 = 1.0 - (1.0 / pow(2.0, 1.0));
- const float yMipLevel2 = 1.0 - (1.0 / pow(2.0, 2.0));
- const float yMipLevel3 = 1.0 - (1.0 / pow(2.0, 3.0));
- const float yMipLevel4 = 1.0 - (1.0 / pow(2.0, 4.0));
- void main()
- {
- vec2 uv = v_textureCoordinates;
- vec2 textureSize = vec2(originalSize * 1.5 + 2.0, originalSize);
- vec2 pixel = 1.0 / textureSize;
- float mipLevel = 0.0;
- if (uv.x - pixel.x > (textureSize.y / textureSize.x))
- {
- mipLevel = 1.0;
- if (uv.y - pixel.y > yMipLevel1)
- {
- mipLevel = 2.0;
- if (uv.y - pixel.y * 3.0 > yMipLevel2)
- {
- mipLevel = 3.0;
- if (uv.y - pixel.y * 5.0 > yMipLevel3)
- {
- mipLevel = 4.0;
- if (uv.y - pixel.y * 7.0 > yMipLevel4)
- {
- mipLevel = 5.0;
- }
- }
- }
- }
- }
- if (mipLevel > 0.0)
- {
- float scale = pow(2.0, mipLevel);
- uv.y -= (pixel.y * (mipLevel - 1.0) * 2.0);
- uv.x *= ((textureSize.x - 2.0) / textureSize.y);
- uv.x -= 1.0 + pixel.x;
- uv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0)));
- uv *= scale;
- }
- else
- {
- uv.x *= (textureSize.x / textureSize.y);
- }
- if(mipLevel == 0.0)
- {
- gl_FragColor = texture2D(texture0, uv);
- }
- else if(mipLevel == 1.0)
- {
- gl_FragColor = texture2D(texture1, uv);
- }
- else if(mipLevel == 2.0)
- {
- gl_FragColor = texture2D(texture2, uv);
- }
- else if(mipLevel == 3.0)
- {
- gl_FragColor = texture2D(texture3, uv);
- }
- else if(mipLevel == 4.0)
- {
- gl_FragColor = texture2D(texture4, uv);
- }
- else if(mipLevel == 5.0)
- {
- gl_FragColor = texture2D(texture5, uv);
- }
- else
- {
- gl_FragColor = vec4(0.0);
- }
- }
- `;var BL=`varying vec3 v_cubeMapCoordinates;
- uniform samplerCube cubeMap;
- void main()
- {
- vec4 rgba = textureCube(cubeMap, v_cubeMapCoordinates);
- #ifdef RGBA_NORMALIZED
- gl_FragColor = vec4(rgba.rgb, 1.0);
- #else
- float m = rgba.a * 16.0;
- vec3 r = rgba.rgb * m;
- gl_FragColor = vec4(r * r, 1.0);
- #endif
- }
- `;var LL=`attribute vec4 position;
- attribute vec3 cubeMapCoordinates;
- varying vec3 v_cubeMapCoordinates;
- void main()
- {
- gl_Position = position;
- v_cubeMapCoordinates = cubeMapCoordinates;
- }
- `;function rx(e){this._url=e,this._cubeMapBuffers=void 0,this._cubeMaps=void 0,this._texture=void 0,this._mipTextures=void 0,this._va=void 0,this._sp=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1;let t=this;this._readyPromise=new Promise((n,i)=>{t._completeLoadFromCache=r=>{v6(this),this._texture=r,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0,n()},t._failLoad=r=>{i(r)},t._completeLoad=()=>{this._ready=!0,n()}})}Object.defineProperties(rx.prototype,{url:{get:function(){return this._url}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}}});rx.isSupported=function(e){return e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat};var V3e=new h(1,0,0),k3e=new h(0,0,1),U3e=new h(-1,0,0),z3e=new h(0,0,-1),NL=new h(0,1,0),H3e=new h(0,-1,0),Jre=[NL,U3e,k3e,H3e,V3e,NL,z3e,NL,NL],Qre=Jre.length,eoe=new Float32Array(Qre*3),$re=0;for(let e=0;e<Qre;++e,$re+=3)h.pack(Jre[e],eoe,$re);var G3e=new Float32Array([-1,1,-1,0,0,1,0,0,1,0,1,1,0,-1,-1,-1,1,-1]),W3e=new Uint16Array([0,1,2,2,3,1,7,6,1,3,6,1,2,5,4,3,4,2,4,8,6,3,4,6]);function j3e(e){let t=at.createVertexBuffer({context:e,typedArray:G3e,usage:Ne.STATIC_DRAW}),n=at.createVertexBuffer({context:e,typedArray:eoe,usage:Ne.STATIC_DRAW}),i=at.createIndexBuffer({context:e,typedArray:W3e,usage:Ne.STATIC_DRAW,indexDatatype:Le.UNSIGNED_SHORT}),r=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:K.FLOAT},{index:1,vertexBuffer:n,componentsPerAttribute:3,componentDatatype:K.FLOAT}];return new Qn({context:e,attributes:r,indexBuffer:i})}function Zre(e){return function(){return e}}function v6(e){e._va=e._va&&e._va.destroy(),e._sp=e._sp&&e._sp.destroy();let t,n,i=e._cubeMaps;if(l(i))for(n=i.length,t=0;t<n;++t)i[t].destroy();let r=e._mipTextures;if(l(r))for(n=r.length,t=0;t<n;++t)r[t].destroy();e._va=void 0,e._sp=void 0,e._cubeMaps=void 0,e._cubeMapBuffers=void 0,e._mipTextures=void 0}rx.prototype.update=function(e){let t=e.context;if(!rx.isSupported(t)||(l(this._texture)&&l(this._va)&&v6(this),l(this._texture)))return;if(!l(this._texture)&&!this._loading){let g=e.context.textureCache.getTexture(this._url);l(g)&&this._completeLoadFromCache(g)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let g=this;Ua(this._url).then(function(m){g._cubeMapBuffers=m,g._loading=!1}).catch(function(m){g._failLoad(m)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let i=[],r=n[0].positiveX.pixelDatatype;l(r)?i.push("RGBA_NORMALIZED"):r=t.halfFloatingPointTexture?qe.HALF_FLOAT:qe.FLOAT;let o=ct.RGBA,s=new Fe({defines:i,sources:[BL]});this._va=j3e(t),this._sp=Wt.fromCache({context:t,vertexShaderSource:LL,fragmentShaderSource:s,attributeLocations:{position:0,cubeMapCoordinates:1}});let a=Math.min(n.length,6);this._maximumMipmapLevel=a-1;let c=this._cubeMaps=new Array(a),u=this._mipTextures=new Array(a),f=n[0].positiveX.width*2,d={originalSize:function(){return f}};for(let g=0;g<a;++g){let m=n[g].positiveY;n[g].positiveY=n[g].negativeY,n[g].negativeY=m;let x=c[g]=new Sc({context:t,source:n[g],pixelDatatype:r}),C=c[g].width*2,A=u[g]=new wt({context:t,width:C,height:C,pixelDatatype:r,pixelFormat:o}),b=new cd({vertexArray:this._va,shaderProgram:this._sp,uniformMap:{cubeMap:Zre(x)},outputTexture:A,persists:!0,owner:this});e.commandList.push(b),d[`texture${g}`]=Zre(A)}this._texture=new wt({context:t,width:f*1.5+2,height:f,pixelDatatype:r,pixelFormat:o}),this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture);let p=new cd({fragmentShaderSource:ML,uniformMap:d,outputTexture:this._texture,persists:!1,owner:this});e.commandList.push(p),this._completeLoad()};rx.prototype.isDestroyed=function(){return!1};rx.prototype.destroy=function(){return v6(this),this._texture=this._texture&&this._texture.destroy(),ue(this)};var Xl=rx;function Pc(e){e=y(e,y.EMPTY_OBJECT);let t=l(e.imageBasedLightingFactor)?W.clone(e.imageBasedLightingFactor):new W(1,1);this._imageBasedLightingFactor=t;let n=y(e.luminanceAtZenith,.2);this._luminanceAtZenith=n;let i=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=i,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapAtlas=void 0,this._specularEnvironmentMapAtlasDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousImageBasedLightingFactor=W.clone(t),this._previousLuminanceAtZenith=n,this._previousSphericalHarmonicCoefficients=i}Object.defineProperties(Pc.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=W.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=W.clone(e,this._imageBasedLightingFactor)}},luminanceAtZenith:{get:function(){return this._luminanceAtZenith},set:function(e){this._previousLuminanceAtZenith=this._luminanceAtZenith,this._luminanceAtZenith=e}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentMapAtlasDirty=this._specularEnvironmentMapAtlasDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useSphericalHarmonicCoefficients:{get:function(){return l(this._sphericalHarmonicCoefficients)||this._useDefaultSphericalHarmonics}},specularEnvironmentMapAtlas:{get:function(){return this._specularEnvironmentMapAtlas}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready||this._useDefaultSpecularMaps}}});function q3e(e,t){if(!!Xl.isSupported(t)){if(e._specularEnvironmentMapAtlas=e._specularEnvironmentMapAtlas&&e._specularEnvironmentMapAtlas.destroy(),l(e._specularEnvironmentMaps)){let n=new Xl(e._specularEnvironmentMaps);e._specularEnvironmentMapAtlas=n,n.readyPromise.then(function(){e._specularEnvironmentMapLoaded=!0}).catch(function(i){console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}Pc.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;let t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;W.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=W.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._luminanceAtZenith!==this._previousLuminanceAtZenith&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._luminanceAtZenith)!==l(this._previousLuminanceAtZenith),this._previousLuminanceAtZenith=this._luminanceAtZenith),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentMapAtlasDirty&&(q3e(this,t),this._specularEnvironmentMapAtlasDirty=!1),l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e);let r=!l(this._specularEnvironmentMapAtlas)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,o=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||r||o||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentMapAtlas)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};Pc.prototype.isDestroyed=function(){return!1};Pc.prototype.destroy=function(){return this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),ue(this)};function FL(e){e=y(e,y.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}FL.ALL=Object.freeze(new FL({color:new z(0,0,0,0),depth:1,stencil:0}));FL.prototype.execute=function(e,t){e.clear(this,t)};var li=FL;var _p={X:0,Y:1,Z:2};_p.Y_UP_TO_Z_UP=N.fromRotationTranslation(Q.fromRotationX(M.PI_OVER_TWO));_p.Z_UP_TO_Y_UP=N.fromRotationTranslation(Q.fromRotationX(-M.PI_OVER_TWO));_p.X_UP_TO_Z_UP=N.fromRotationTranslation(Q.fromRotationY(-M.PI_OVER_TWO));_p.Z_UP_TO_X_UP=N.fromRotationTranslation(Q.fromRotationY(M.PI_OVER_TWO));_p.X_UP_TO_Y_UP=N.fromRotationTranslation(Q.fromRotationZ(M.PI_OVER_TWO));_p.Y_UP_TO_X_UP=N.fromRotationTranslation(Q.fromRotationZ(-M.PI_OVER_TWO));_p.fromName=function(e){return _p[e]};var On=Object.freeze(_p);function yg(e){e=y(e,y.EMPTY_OBJECT),this._metadata=e.metadata}Object.defineProperties(yg.prototype,{metadata:{get:function(){return this._metadata}}});var GT={};GT._deprecationWarning=di;var gp=Uint32Array.BYTES_PER_ELEMENT;GT.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),r=new DataView(e);t+=gp;let o=r.getUint32(t,!0);if(o!==1)throw new fe(`Only Batched 3D Model version 1 is supported. Version ${o} is not.`);t+=gp;let s=r.getUint32(t,!0);t+=gp;let a=r.getUint32(t,!0);t+=gp;let c=r.getUint32(t,!0);t+=gp;let u=r.getUint32(t,!0);t+=gp;let f=r.getUint32(t,!0);t+=gp;let d;u>=570425344?(t-=gp*2,d=a,u=c,f=0,a=0,c=0,GT._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):f>=570425344&&(t-=gp,d=u,u=a,f=c,a=0,c=0,GT._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:y(d,0)}:(p=Vr(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let m,x;u>0&&(m=Vr(i,t,u),t+=u,f>0&&(x=new Uint8Array(e,t,f),x=new Uint8Array(x),t+=f));let C=n+s-t;if(C===0)throw new fe("glTF byte length must be greater than 0.");let A;return t%4===0?A=new Uint8Array(e,t,C):(GT._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),A=new Uint8Array(i.subarray(t,t+C))),{batchLength:d,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:x,gltf:A}};var WT=GT;function Cr(e){this._id=Ln();let t=e.featuresLength;this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[];let n,i;if(t>0){let r=Math.min(t,Bt.maximumTextureSize),o=Math.ceil(t/Bt.maximumTextureSize),s=1/r,a=s*.5,c=1/o,u=c*.5;n=new W(r,o),i=new se(s,a,c,u)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(Cr.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});Cr.DEFAULT_COLOR_VALUE=z.WHITE;Cr.DEFAULT_SHOW_VALUE=!0;function toe(e){let t=e._textureDimensions;return t.x*t.y*4}function noe(e){if(!l(e._batchValues)){let t=toe(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function ioe(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}Cr.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=ioe(this),i=e*2,r=t?255:0;if(n[i]!==r){n[i]=r;let o=noe(this),s=e*4+3;o[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};Cr.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};Cr.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var Y3e=new Array(4);Cr.prototype.setColor=function(e,t){if(z.equals(t,Cr.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(Y3e),i=n[3],r=noe(this),o=e*4,s=ioe(this),a=e*2;if(r[o]!==n[0]||r[o+1]!==n[1]||r[o+2]!==n[2]||s[a+1]!==i){r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2];let c=s[a+1]!==255,u=s[a]!==0;r[o+3]=u?i:0,s[a+1]=i;let f=i!==255;f&&!c?++this._translucentFeaturesLength:!f&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};Cr.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};Cr.prototype.getColor=function(e,t){if(!l(this._batchValues))return z.clone(Cr.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,r=this._showAlphaProperties,o=e*2;return z.fromBytes(n[i],n[i+1],n[i+2],r[o+1],t)};Cr.prototype.getPickColor=function(e){return this._pickIds[e]};function roe(e,t,n){let i=e._textureDimensions;return new wt({context:t,pixelFormat:ct.RGBA,pixelDatatype:qe.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:on.NEAREST})}function X3e(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,r=toe(e),o=new Uint8Array(r),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let u=t.createPickId(s.getFeature(c));i.push(u);let f=u.color,d=c*4;o[d]=z.floatToByte(f.red),o[d+1]=z.floatToByte(f.green),o[d+2]=z.floatToByte(f.blue),o[d+3]=z.floatToByte(f.alpha)}e._pickTexture=roe(e,t,o),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function K3e(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Cr.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&X3e(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=roe(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),K3e(this))};Cr.prototype.isDestroyed=function(){return!1};Cr.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();let e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var $3e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Z3e={SCALAR:void 0,VEC2:W,VEC3:h,VEC4:se,MAT2:Ri,MAT3:Q,MAT4:N};function J3e(e){let t=e.componentType,n;typeof t=="string"?n=K.fromName(t):n=t;let i=$3e[e.type],r=Z3e[e.type];return{componentsPerAttribute:i,classType:r,createArrayBufferView:function(o,s,a){return K.createArrayBufferView(n,o,s,i*a)}}}var nf=J3e;function Ic(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,Q3e(this,e.extension,e.binaryBody)}Object.defineProperties(Ic.prototype,{byteLength:{get:function(){return this._byteLength}}});function Q3e(e,t,n){let i,r,o,s=t.instancesLength,a=t.classes,c=t.classIds,u=t.parentCounts,f=t.parentIds,d=s,p=0;l(c.byteOffset)&&(c.componentType=y(c.componentType,K.UNSIGNED_SHORT),c.type=qt.SCALAR,o=nf(c),c=o.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let g;if(l(u)){for(l(u.byteOffset)&&(u.componentType=y(u.componentType,K.UNSIGNED_SHORT),u.type=qt.SCALAR,o=nf(u),u=o.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,s),p+=u.byteLength),g=new Uint16Array(s),d=0,i=0;i<s;++i)g[i]=d,d+=u[i];p+=g.byteLength}l(f)&&l(f.byteOffset)&&(f.componentType=y(f.componentType,K.UNSIGNED_SHORT),f.type=qt.SCALAR,o=nf(f),f=o.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,d),p+=f.byteLength);let m=a.length;for(i=0;i<m;++i){let A=a[i].length,b=a[i].instances,T=eVe(A,b,n);p+=tVe(T),a[i].instances=rt(T,b)}let x=new Array(m).fill(0),C=new Uint16Array(s);for(i=0;i<s;++i)r=c[i],C[i]=x[r],++x[r];p+=C.byteLength,e._classes=a,e._classIds=c,e._classIndexes=C,e._parentCounts=u,e._parentIndexes=g,e._parentIds=f,e._byteLength=p}function eVe(e,t,n){let i;for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=o.byteOffset;if(l(s)){let a=o.componentType,c=o.type;if(!l(a))throw new fe("componentType is required.");if(!l(c))throw new fe("type is required.");if(!l(n))throw new fe(`Property ${r} requires a batch table binary.`);let u=nf(o),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[r]={typedArray:p,componentCount:f,type:d}}}return i}function tVe(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var nVe=[],iVe=[],rVe=0;function oVe(e,t,n){let i=e._classIds,r=e._parentCounts,o=e._parentIds,s=e._parentIndexes,a=i.length,c=nVe;c.length=Math.max(c.length,a);let u=++rVe,f=iVe;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let d=n(e,t);if(l(d))return d;let p=r[t],g=s[t];for(let m=0;m<p;++m){let x=o[g+m];x!==t&&f.push(x)}}}function sVe(e,t,n){let i=!0;for(;i;){let r=n(e,t);if(l(r))return r;let o=e._parentIds[t];i=o!==t,t=o}}function zw(e,t,n){let i=e._parentCounts,r=e._parentIds;if(l(r)){if(l(i))return oVe(e,t,n)}else return n(e,t);return sVe(e,t,n)}Ic.prototype.hasProperty=function(e,t){let n=zw(this,e,function(i,r){let o=i._classIds[r],s=i._classes[o].instances;if(l(s[t]))return!0});return l(n)};Ic.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let r=t[i].instances;if(l(r[e]))return!0}return!1};Ic.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,zw(this,e,function(n,i){let r=n._classIds[i],o=n._classes[r].instances;for(let s in o)o.hasOwnProperty(s)&&t.indexOf(s)===-1&&t.push(s)}),t};Ic.prototype.getProperty=function(e,t){return zw(this,e,function(n,i){let r=n._classIds[i],o=n._classes[r],s=n._classIndexes[i],a=o.instances[t];if(l(a))return l(a.typedArray)?aVe(a,s):$e(a[s],!0)})};function aVe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}Ic.prototype.setProperty=function(e,t,n){let i=zw(this,e,function(r,o){let s=r._classIds[o],a=r._classes[s],c=r._classIndexes[o],u=a.instances[t];if(l(u))return l(u.typedArray)?cVe(u,c,n):u[c]=$e(n,!0),!0});return l(i)};function cVe(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}Ic.prototype.isClass=function(e,t){let n=zw(this,e,function(i,r){let o=i._classIds[r];if(i._classes[o].name===t)return!0});return l(n)};Ic.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var lVe={HIGHLIGHT:0,REPLACE:1,MIX:2},Kl=Object.freeze(lVe);var D6=Cr.DEFAULT_COLOR_VALUE,P6=Cr.DEFAULT_SHOW_VALUE;function ur(e,t,n,i,r){this.featuresLength=t;let o;l(n)&&(o=n.extensions),this._extensions=y(o,{});let s=uVe(n);this._properties=s,this._batchTableHierarchy=fVe(this,n,i);let a=soe(t,s,i);this._binaryPropertiesByteLength=dVe(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new Cr({featuresLength:t,colorChangedCallback:r,owner:e,statistics:e.tileset.statistics})}ur._deprecationWarning=di;Object.defineProperties(ur.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function uVe(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=$e(e[n],!0));return t}function fVe(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],r=t.HIERARCHY;if(l(r)&&(ur._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=r,i=r),!!l(i))return new Ic({extension:i,binaryBody:n})}function soe(e,t,n){let i;for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=o.byteOffset;if(l(s)){let a=o.componentType,c=o.type;if(!l(a))throw new fe("componentType is required.");if(!l(c))throw new fe("type is required.");if(!l(n))throw new fe(`Property ${r} requires a batch table binary.`);let u=nf(o),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[r]={typedArray:p,componentCount:f,type:d}}}return i}function dVe(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}ur.getBinaryProperties=function(e,t,n){return soe(e,t,n)};ur.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};ur.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};ur.prototype.getShow=function(e){return this._batchTexture.getShow(e)};ur.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};ur.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};ur.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};ur.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var hVe=new z;ur.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(D6),this.setAllShow(P6);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let r=t.getFeature(i),o=l(e.color)?y(e.color.evaluateColor(r,hVe),D6):D6,s=l(e.show)?y(e.show.evaluate(r),P6):P6;this.setColor(i,o),this.setShow(i,s)}};function mVe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function pVe(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}ur.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};ur.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};ur.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(!!l(t))return t.getClassName(e)};ur.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};ur.prototype.hasPropertyBySemantic=function(){return!1};ur.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);return t.push.apply(t,n),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,n)),t};ur.prototype.getPropertyBySemantic=function(e,t){};ur.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return mVe(i,e)}let n=this._properties[t];if(l(n))return $e(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};ur.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let o=this._batchTableBinaryProperties[t];if(l(o)){pVe(o,e,n);return}}if(l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let r=this._properties[t];l(r)||(this._properties[t]=new Array(i),r=this._properties[t]),r[e]=$e(n,!0)};function _Ve(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep;
- vec2 computeSt(float batchId)
- {
- float stepX = tile_textureStep.x;
- float centerX = tile_textureStep.y;
- return vec2(centerX + (batchId * stepX), 0.5);
- }
- `:`uniform vec4 tile_textureStep;
- uniform vec2 tile_textureDimensions;
- vec2 computeSt(float batchId)
- {
- float stepX = tile_textureStep.x;
- float centerX = tile_textureStep.y;
- float stepY = tile_textureStep.z;
- float centerY = tile_textureStep.w;
- float xId = mod(batchId, tile_textureDimensions.x);
- float yId = floor(batchId / tile_textureDimensions.x);
- return vec2(centerX + (xId * stepX), centerY + (yId * stepY));
- }
- `}ur.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(r){let o=aoe(r,n,!1),s;return Bt.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand;
- `),s+=`uniform sampler2D tile_batchTexture;
- varying vec4 tile_featureColor;
- varying vec2 tile_featureSt;
- void main()
- {
- vec2 st = computeSt(${t});
- vec4 featureProperties = texture2D(tile_batchTexture, st);
- tile_color(featureProperties);
- float show = ceil(featureProperties.a);
- gl_Position *= show;
- `,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0);
- if (czm_pass == czm_passTranslucent)
- {
- if (!isStyleTranslucent && !tile_translucentCommand)
- {
- gl_Position *= 0.0;
- }
- }
- else
- {
- if (isStyleTranslucent)
- {
- gl_Position *= 0.0;
- }
- }
- `),s+=` tile_featureColor = featureProperties;
- tile_featureSt = st;
- }`):s=`varying vec2 tile_featureSt;
- void main()
- {
- tile_color(vec4(1.0));
- tile_featureSt = computeSt(${t});
- }`,`${o}
- ${_Ve(i)}${s}`}};function ooe(e,t){return e=Fe.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend;
- void tile_color(vec4 tile_featureColor)
- {
- tile_main();
- tile_featureColor = czm_gammaCorrect(tile_featureColor);
- gl_FragColor.a *= tile_featureColor.a;
- float highlight = ceil(tile_colorBlend);
- gl_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight);
- }
- `:`${e}void tile_color(vec4 tile_featureColor)
- {
- tile_main();
- }
- `}function gVe(e,t){let n=`texture2D(${t}`,i=0,r=e.indexOf(n,i),o;for(;r>-1;){let s=0;for(let u=r;u<e.length;++u){let f=e.charAt(u);if(f==="(")++s;else if(f===")"&&(--s,s===0)){o=u+1;break}}let c=`tile_diffuse_final(${e.slice(r,o)}, tile_diffuse)`;e=e.slice(0,r)+c+e.slice(o),i=r+c.length,r=e.indexOf(n,i)}return e}function aoe(e,t,n){if(!l(t))return ooe(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),r=e.match(i);if(!l(r))return ooe(e,n);let o=r[0],s=r[2];e=Fe.replaceMain(e,"tile_main"),e=e.replace(o,"");let a=`bool isWhite(vec3 color)
- {
- return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));
- }
- vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse)
- {
- vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend);
- vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse;
- return vec4(diffuse.rgb, sourceDiffuse.a);
- }
- `,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor);
- gl_FragColor.a *= tile_featureColor.a;
- float highlight = ceil(tile_colorBlend);
- gl_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight);
- `,u;if(s==="vec3"||s==="vec4"){let f=s==="vec3"?`vec4(${t}, 1.0)`:t,d=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,d),u=` vec4 source = ${f};
- tile_diffuse = tile_diffuse_final(source, tile_featureColor);
- tile_main();
- `}else s==="sampler2D"&&(e=gVe(e,t),u=` tile_diffuse = tile_featureColor;
- tile_main();
- `);return e=`uniform float tile_colorBlend;
- vec4 tile_diffuse = vec4(1.0);
- ${a}${o}
- ${e}
- void tile_color(vec4 tile_featureColor)
- {
- ${u}`,n&&(e+=c),e+=`}
- `,e}ur.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=aoe(i,t,!0),Bt.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture;
- varying vec2 tile_featureSt;
- varying vec4 tile_featureColor;
- void main()
- {
- tile_color(tile_featureColor);
- `,n&&(i+=` gl_FragColor.rgb *= gl_FragColor.a;
- `),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand;
- `),i+=`uniform sampler2D tile_pickTexture;
- uniform sampler2D tile_batchTexture;
- varying vec2 tile_featureSt;
- void main()
- {
- vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt);
- if (featureProperties.a == 0.0) {
- discard;
- }
- `,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0);
- if (czm_pass == czm_passTranslucent)
- {
- if (!isStyleTranslucent && !tile_translucentCommand)
- {
- discard;
- }
- }
- else
- {
- if (isStyleTranslucent)
- {
- discard;
- }
- }
- `),i+=` tile_color(featureProperties);
- `,n&&(i+=` gl_FragColor.rgb *= gl_FragColor.a;
- `),i+=`}
- `),i}};ur.prototype.getClassificationFragmentShaderCallback=function(){if(this.featuresLength!==0)return function(e){return e=Fe.replaceMain(e,"tile_main"),Bt.maximumVertexTextureImageUnits>0?e+=`uniform sampler2D tile_pickTexture;
- varying vec2 tile_featureSt;
- varying vec4 tile_featureColor;
- void main()
- {
- tile_main();
- gl_FragColor = tile_featureColor;
- gl_FragColor.rgb *= gl_FragColor.a;
- }`:e+=`uniform sampler2D tile_batchTexture;
- uniform sampler2D tile_pickTexture;
- varying vec2 tile_featureSt;
- void main()
- {
- tile_main();
- vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt);
- if (featureProperties.a == 0.0) {
- discard;
- }
- gl_FragColor = featureProperties;
- gl_FragColor.rgb *= gl_FragColor.a;
- }
- `,e}};function yVe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Kl.HIGHLIGHT)return 0;if(n===Kl.REPLACE)return 1;if(n===Kl.MIX)return M.clamp(i,M.EPSILON4,1)}ur.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return rt(t,{tile_batchTexture:function(){return y(e._batchTexture.batchTexture,e._batchTexture.defaultTexture)},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return yVe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};ur.prototype.getPickId=function(){return"texture2D(tile_pickTexture, tile_featureSt)"};var xg={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};ur.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,r=this._content._tile,o=r._finalResolution,s=r.tileset,a=s._skipLevelOfDetail&&s._hasMixedContent&&e.context.stencilBuffer,c=xVe(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===Ce.COMPUTE)continue;let d=f.derivedCommands.tileset;(!l(d)||f.dirty)&&(d={},f.derivedCommands.tileset=d,d.originalCommand=CVe(f),f.dirty=!1);let p=d.originalCommand;c!==xg.ALL_OPAQUE&&f.pass!==Ce.TRANSLUCENT&&(l(d.translucent)||(d.translucent=AVe(p))),c!==xg.ALL_TRANSLUCENT&&f.pass!==Ce.TRANSLUCENT&&(l(d.opaque)||(d.opaque=TVe(p)),a&&(o||(l(d.zback)||(d.zback=EVe(e.context,p)),s._backfaceCommands.push(d.zback)),(!l(d.stencil)||r._selectionDepth!==wVe(d.stencil))&&(f.renderState.depthMask?d.stencil=SVe(p,r._selectionDepth):d.stencil=d.opaque)));let g=a?d.stencil:d.opaque,m=d.translucent;f.pass!==Ce.TRANSLUCENT?(c===xg.ALL_OPAQUE&&(n[u]=g),c===xg.ALL_TRANSLUCENT&&(n[u]=m),c===xg.OPAQUE_AND_TRANSLUCENT&&(n[u]=g,n.push(m))):n[u]=p}};function xVe(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?xg.ALL_OPAQUE:t===e.featuresLength?xg.ALL_TRANSLUCENT:xg.OPAQUE_AND_TRANSLUCENT}function CVe(e){let t=Ze.shallowClone(e),n=t.pass===Ce.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function AVe(e){let t=Ze.shallowClone(e);return t.pass=Ce.TRANSLUCENT,t.renderState=vVe(e.renderState),t}function TVe(e){let t=Ze.shallowClone(e);return t.renderState=DVe(e.renderState),t}function bVe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!l(n)){let i=t.fragmentShaderSource.clone();i.defines=l(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),i.sources.unshift(`#ifdef GL_OES_standard_derivatives
- #extension GL_OES_standard_derivatives : enable
- #endif
- `),n=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}return n}function EVe(e,t){let n=Ze.shallowClone(t),i=$e(n.renderState,!0);i.cull.enabled=!0,i.cull.face=Yi.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=tn.setCesium3DTileBit(),i.stencilMask=tn.CESIUM_3D_TILE_MASK,n.renderState=Ve.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=$e(t.uniformMap);let r=new W(5,5);return n.uniformMap.u_polygonOffset=function(){return r},n.shaderProgram=bVe(e,t.shaderProgram),n}function SVe(e,t){let n=Ze.shallowClone(e),i=$e(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=tn.SKIP_LOD_MASK,i.stencilTest.reference=tn.CESIUM_3D_TILE_MASK|t<<tn.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=yi.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=Ft.REPLACE,i.stencilTest.backFunction=yi.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=Ft.REPLACE,i.stencilMask=tn.CESIUM_3D_TILE_MASK|tn.SKIP_LOD_MASK,n.renderState=Ve.fromCache(i),n}function wVe(e){return(e.renderState.stencilTest.reference&tn.SKIP_LOD_MASK)>>>tn.SKIP_LOD_BIT_SHIFT}function vVe(e){let t=$e(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=hn.ALPHA_BLEND,t.stencilTest=tn.setCesium3DTileBit(),t.stencilMask=tn.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}function DVe(e){let t=$e(e,!0);return t.stencilTest=tn.setCesium3DTileBit(),t.stencilMask=tn.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}ur.prototype.update=function(e,t){this._batchTexture.update(e,t)};ur.prototype.isDestroyed=function(){return!1};ur.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var ml=ur;function $l(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties($l.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return l(this._color)||(this._color=new z),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(!!l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});$l.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};$l.prototype.getPropertyNames=function(e){return di("Cesium3DTileFeature.getPropertyNames","Cesium3DTileFeature.getPropertyNames was deprecated in CesiumJS 1.95 and will be removed in 1.98. Use Cesium3DTileFeature.getPropertyIds instead"),this._content.batchTable.getPropertyIds(this._batchId,e)};$l.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};$l.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};$l.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(l(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let r=e.metadata;if(l(r)){if(r.hasPropertyBySemantic(n))return r.getPropertyBySemantic(n);if(r.hasProperty(n))return r.getProperty(n)}let o=e.tile,s=o.metadata;if(l(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(l(o.implicitSubtree)&&(a=o.implicitSubtree.metadata),l(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=l(e.group)?e.group.metadata:void 0;if(l(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let u=e.tileset.metadata;if(l(u)){if(u.hasPropertyBySemantic(n))return u.getPropertyBySemantic(n);if(u.hasProperty(n))return u.getProperty(n)}};$l.prototype.getPropertyInherited=function(e){return $l.getPropertyInherited(this._content,this._batchId,e)};$l.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};$l.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};$l.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};$l.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var bo=$l;function Hw(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function coe(e,t,n,i,r,o){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=K.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+o,r*i),s[t]=a),a}function PVe(e,t,n,i){let r=e._cachedTypedArrays,o=r[t];return l(o)||(o=K.createTypedArray(n,i),r[t]=o),o}Hw.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(!!l(i))return l(i.byteOffset)?(t=y(t,K.UNSIGNED_INT),n=y(n,1),coe(this,e,t,n,1,i.byteOffset)):i};Hw.prototype.hasProperty=function(e){return l(this.json[e])};Hw.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(!!l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=K.fromName(i.componentType)),coe(this,e,t,n,this.featuresLength,i.byteOffset)):PVe(this,e,t,i)};Hw.prototype.getProperty=function(e,t,n,i,r){let o=this.json[e];if(!l(o))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)r[a]=s[n*i+a];return r};var pl=Hw;function IVe(e,t,n){if(n=y(n,!1),n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var fr=IVe;function OVe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var Ur=OVe;function zt(){}zt.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(l(r))return r}}};zt.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=t(r,i);if(l(o))return o}}};zt.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?zt.objectLegacy(i,n):zt.object(i,n)};zt.accessor=function(e,t){return zt.topLevel(e,"accessors",t)};zt.accessorWithSemantic=function(e,t,n){let i={};return zt.mesh(e,function(r){return zt.meshPrimitive(r,function(o){let s=zt.meshPrimitiveAttribute(o,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let u=n(a);if(l(u))return u}});return l(s)?s:zt.meshPrimitiveTarget(o,function(a){return zt.meshPrimitiveTargetAttribute(a,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};zt.accessorContainingVertexAttributeData=function(e,t){let n={};return zt.mesh(e,function(i){return zt.meshPrimitive(i,function(r){let o=zt.meshPrimitiveAttribute(r,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(o)?o:zt.meshPrimitiveTarget(r,function(s){return zt.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};zt.accessorContainingIndexData=function(e,t){let n={};return zt.mesh(e,function(i){return zt.meshPrimitive(i,function(r){let o=r.indices;if(l(o)&&!l(n[o])){n[o]=!0;let s=t(o);if(l(s))return s}})})};zt.animation=function(e,t){return zt.topLevel(e,"animations",t)};zt.animationChannel=function(e,t){let n=e.channels;return zt.object(n,t)};zt.animationSampler=function(e,t){let n=e.samplers;return zt.object(n,t)};zt.buffer=function(e,t){return zt.topLevel(e,"buffers",t)};zt.bufferView=function(e,t){return zt.topLevel(e,"bufferViews",t)};zt.camera=function(e,t){return zt.topLevel(e,"cameras",t)};zt.image=function(e,t){return zt.topLevel(e,"images",t)};zt.material=function(e,t){return zt.topLevel(e,"materials",t)};zt.materialValue=function(e,t){let n=e.values;l(e.extensions)&&l(e.extensions.KHR_techniques_webgl)&&(n=e.extensions.KHR_techniques_webgl.values);for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};zt.mesh=function(e,t){return zt.topLevel(e,"meshes",t)};zt.meshPrimitive=function(e,t){let n=e.primitives;if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=t(o,r);if(l(s))return s}}};zt.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};zt.meshPrimitiveTarget=function(e,t){let n=e.targets;if(l(n)){let i=n.length;for(let r=0;r<i;++r){let o=t(n[r],r);if(l(o))return o}}};zt.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(l(r))return r}};zt.node=function(e,t){return zt.topLevel(e,"nodes",t)};zt.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let r=t.length;for(let o=0;o<r;o++){let s=t[o],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let u=a.children;if(l(u)&&(c=zt.nodeInTree(e,u,n),l(c)))return c}}}};zt.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return zt.nodeInTree(e,i,n)};zt.program=function(e,t){return Ur(e,"KHR_techniques_webgl")?zt.object(e.extensions.KHR_techniques_webgl.programs,t):zt.topLevel(e,"programs",t)};zt.sampler=function(e,t){return zt.topLevel(e,"samplers",t)};zt.scene=function(e,t){return zt.topLevel(e,"scenes",t)};zt.shader=function(e,t){return Ur(e,"KHR_techniques_webgl")?zt.object(e.extensions.KHR_techniques_webgl.shaders,t):zt.topLevel(e,"shaders",t)};zt.skin=function(e,t){return zt.topLevel(e,"skins",t)};zt.skinJoint=function(e,t){let n=e.joints;if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=t(o);if(l(s))return s}}};zt.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};zt.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};zt.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};zt.technique=function(e,t){return Ur(e,"KHR_techniques_webgl")?zt.object(e.extensions.KHR_techniques_webgl.techniques,t):zt.topLevel(e,"techniques",t)};zt.texture=function(e,t){return zt.topLevel(e,"textures",t)};var Ae=zt;function RVe(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}var ps=RVe;function MVe(e,t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n];if(l(i.byteStride)&&i.byteStride>0)return i.byteStride}return K.getSizeInBytes(t.componentType)*ps(t.type)}var _s=MVe;function BVe(e){Ae.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=y(n.byteOffset,0))}),Ae.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=y(n.byteOffset,0))}),Ae.mesh(e,function(n){Ae.meshPrimitive(n,function(i){if(i.mode=y(i.mode,Z.TRIANGLES),!l(i.material)){l(e.materials)||(e.materials=[]);let r={name:"default"};i.material=fr(e.materials,r)}})}),Ae.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],r=i.bufferView;if(i.normalized=y(i.normalized,!1),l(r)){let o=e.bufferViews[r];o.byteStride=_s(e,i),o.target=Z.ARRAY_BUFFER}}),Ae.accessorContainingIndexData(e,function(n){let r=e.accessors[n].bufferView;if(l(r)){let o=e.bufferViews[r];o.target=Z.ELEMENT_ARRAY_BUFFER}}),Ae.material(e,function(n){let i=y(n.extensions,y.EMPTY_OBJECT),r=i.KHR_materials_common;if(l(r)){let c=r.technique,u=l(r.values)?r.values:{};r.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=y(u.transparency,1),u.transparent=y(u.transparent,!1),u.doubleSided=y(u.doubleSided,!1),c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=y(u.shininess,0)));return}n.emissiveFactor=y(n.emissiveFactor,[0,0,0]),n.alphaMode=y(n.alphaMode,"OPAQUE"),n.doubleSided=y(n.doubleSided,!1),n.alphaMode==="MASK"&&(n.alphaCutoff=y(n.alphaCutoff,.5));let o=i.KHR_techniques_webgl;l(o)&&Ae.materialValue(n,function(c){l(c.index)&&ox(c)}),ox(n.emissiveTexture),ox(n.normalTexture),ox(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=y(s.baseColorFactor,[1,1,1,1]),s.metallicFactor=y(s.metallicFactor,1),s.roughnessFactor=y(s.roughnessFactor,1),ox(s.baseColorTexture),ox(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=y(a.diffuseFactor,[1,1,1,1]),a.specularFactor=y(a.specularFactor,[1,1,1]),a.glossinessFactor=y(a.glossinessFactor,1),ox(a.specularGlossinessTexture))}),Ae.animation(e,function(n){Ae.animationSampler(n,function(i){i.interpolation=y(i.interpolation,"LINEAR")})});let t=LVe(e);return Ae.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=y(n.translation,[0,0,0]),n.rotation=y(n.rotation,[0,0,0,1]),n.scale=y(n.scale,[1,1,1])):n.matrix=y(n.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),Ae.sampler(e,function(n){n.wrapS=y(n.wrapS,Z.REPEAT),n.wrapT=y(n.wrapT,Z.REPEAT)}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function LVe(e){let t={};return Ae.animation(e,function(n){Ae.animationChannel(n,function(i){let r=i.target,o=r.node,s=r.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[o]=!0)})}),t}function ox(e){l(e)&&(e.texCoord=y(e.texCoord,0))}var Cg=BVe;function NVe(e){return Ae.shader(e,function(t){VL(t)}),Ae.buffer(e,function(t){VL(t)}),Ae.image(e,function(t){VL(t)}),VL(e),e}function VL(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var yp=NVe;function FVe(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var kL=FVe;function VVe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),kL(e,t),n.length===0&&delete e.extensionsUsed}}var UL=VVe;var kVe=4;function UVe(e){if(Gu(e)!=="glTF")throw new fe("File is not valid binary glTF");let n=loe(e,0,5),i=n[1];if(i!==1&&i!==2)throw new fe("Binary glTF version is not 1 or 2");return i===1?zVe(e,n):HVe(e,n)}function loe(e,t,n){let i=new DataView(e.buffer),r=new Array(n);for(let o=0;o<n;++o)r[o]=i.getUint32(e.byteOffset+t+o*kVe,!0);return r}function zVe(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new fe("Binary glTF scene format is not JSON");let o=20,s=o+i,a=fa(e,o,i),c=JSON.parse(a);yp(c);let u=e.subarray(s,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let d=y(f.binary_glTF,f.KHR_binary_glTF);l(d)&&(d.extras._pipeline.source=u,delete d.uri)}return UL(c,"KHR_binary_glTF"),c}function HVe(e,t){let n=t[2],i=12,r,o;for(;i<n;){let s=loe(e,i,2),a=s[0],c=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,c===1313821514){let f=fa(u);r=JSON.parse(f),yp(r)}else c===5130562&&(o=u)}if(l(r)&&l(o)){let s=r.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=o}}return r}var xp=UVe;function GVe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),fr(n,t,!0)}var Yh=GVe;function WVe(e){switch(e){case K.BYTE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt8(n+s*r)};case K.UNSIGNED_BYTE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint8(n+s*r)};case K.SHORT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt16(n+s*r,!0)};case K.UNSIGNED_SHORT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint16(n+s*r,!0)};case K.INT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt32(n+s*r,!0)};case K.UNSIGNED_INT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint32(n+s*r,!0)};case K.FLOAT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getFloat32(n+s*r,!0)};case K.DOUBLE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getFloat64(n+s*r,!0)}}}var Ag=WVe;function jVe(e,t){let n=e.bufferViews,i=e.buffers,r=t.bufferView,o=ps(t.type);if(!l(t.bufferView))return{min:new Array(o).fill(0),max:new Array(o).fill(0)};let s=new Array(o).fill(Number.POSITIVE_INFINITY),a=new Array(o).fill(Number.NEGATIVE_INFINITY),c=n[r],u=c.buffer,d=i[u].extras._pipeline.source,p=t.count,g=_s(e,t),m=t.byteOffset+c.byteOffset+d.byteOffset,x=t.componentType,C=K.getSizeInBytes(x),A=new DataView(d.buffer),b=new Array(o),T=Ag(x);for(let S=0;S<p;S++){T(A,m,o,C,b);for(let w=0;w<o;w++){let D=b[w];s[w]=Math.min(s[w],D),a[w]=Math.max(a[w],D)}m+=g}return{min:s,max:a}}var Gw=jVe;var qVe=[Z.FUNC_ADD,Z.FUNC_ADD],YVe=[Z.ONE,Z.ZERO,Z.ONE,Z.ZERO];function uoe(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var XVe=[Z.ZERO,Z.ONE,Z.SRC_COLOR,Z.ONE_MINUS_SRC_COLOR,Z.SRC_ALPHA,Z.ONE_MINUS_SRC_ALPHA,Z.DST_ALPHA,Z.ONE_MINUS_DST_ALPHA,Z.DST_COLOR,Z.ONE_MINUS_DST_COLOR];function KVe(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(XVe.indexOf(e[n])===-1)return t;return e}function $Ve(e){let t={},n={},i=e.techniques;return l(i)&&(Ae.technique(e,function(r,o){let s=r.states;if(l(s)){let a=n[o]={};if(uoe(s,Z.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[o]={blendEquation:y(c.blendEquationSeparate,qVe),blendFactors:KVe(c.blendFuncSeparate,YVe)})}uoe(s,Z.CULL_FACE)||(a.doubleSided=!0),delete r.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Yh(e,"KHR_blend")),Ae.material(e,function(r){if(l(r.technique)){let o=n[r.technique];Ae.objectLegacy(o,function(a,c){r[c]=a});let s=t[r.technique];l(s)&&(l(r.extensions)||(r.extensions={}),r.extensions.KHR_blend=s)}})),e}var zL=$Ve;function ZVe(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),fr(n,t,!0),Yh(e,t)}var HL=ZVe;function JVe(e){let t=e.techniques,n={},i={},r={};if(l(t)){let o={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Ae.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Ae.techniqueAttribute(a,function(d,p){f=a.parameters[d],u.attributes[p]={semantic:f.semantic}}),Ae.techniqueUniform(a,function(d,p){f=a.parameters[d],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][d]=p}),l(r[a.program]))u.program=r[a.program];else{let d=e.programs[a.program],p={name:d.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[d.fragmentShader];p.fragmentShader=fr(o.shaders,g,!0);let m=e.shaders[d.vertexShader];p.vertexShader=fr(o.shaders,m,!0),u.program=fr(o.programs,p),r[a.program]=u.program}i[c]=fr(o.techniques,u)}),o.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=o,Yh(e,"KHR_techniques_webgl"),HL(e,"KHR_techniques_webgl"))}return Ae.material(e,function(o){if(l(o.technique)){let s={technique:i[o.technique]};Ae.objectLegacy(o.values,function(a,c){l(s.values)||(s.values={});let u=n[o.technique][c];s.values[u]=a}),l(o.extensions)||(o.extensions={}),o.extensions.KHR_techniques_webgl=s}delete o.technique,delete o.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var GL=JVe;function QVe(e,t){Nl.typeOf.object("material",e),Nl.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,o=t(r.index,r);if(l(o))return o}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,o=t(r.index,r);if(l(o))return o}}if(l(e.extensions)){let r=e.extensions.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let s=r.diffuseTexture,a=t(s.index,s);if(l(a))return a}if(l(r.specularGlossinessTexture)){let s=r.specularGlossinessTexture,a=t(s.index,s);if(l(a))return a}}let o=e.extensions.KHR_materials_common;if(l(o)){let s=o.values.diffuse,a=o.values.ambient,c=o.values.emission,u=o.values.specular;if(l(s)&&l(s.index)){let f=t(s.index,s);if(l(f))return f}if(l(a)&&l(a.index)){let f=t(a.index,a);if(l(f))return f}if(l(c)&&l(c.index)){let f=t(c.index,c);if(l(f))return f}if(l(u)&&l(u.index)){let f=t(u.index,u);if(l(f))return f}}}let i=Ae.materialValue(e,function(r){if(l(r.index)){let o=t(r.index,r);if(l(o))return o}});if(l(i))return i;if(l(e.emissiveTexture)){let r=e.emissiveTexture,o=t(r.index,r);if(l(o))return o}if(l(e.normalTexture)){let r=e.normalTexture,o=t(r.index,r);if(l(o))return o}if(l(e.occlusionTexture)){let r=e.occlusionTexture,o=t(r.index,r);if(l(o))return o}}var Ww=QVe;var foe=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function eke(e,t){return t=y(t,foe),foe.forEach(function(n){t.indexOf(n)>-1&&nke(e,n)}),e}var tke={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function nke(e,t){let n=tke[t],i=e[n];if(l(i)){let r=0,o=Kh[t](e),s=i.length;for(let a=0;a<s;++a)o[a]||(Xh[t](e,a-r),r++)}}function Xh(){}Xh.accessor=function(e,t){e.accessors.splice(t,1),Ae.mesh(e,function(i){Ae.meshPrimitive(i,function(r){Ae.meshPrimitiveAttribute(r,function(s,a){s>t&&r.attributes[a]--}),Ae.meshPrimitiveTarget(r,function(s){Ae.meshPrimitiveTargetAttribute(s,function(a,c){a>t&&s[c]--})});let o=r.indices;l(o)&&o>t&&r.indices--})}),Ae.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Ae.animation(e,function(i){Ae.animationSampler(i,function(r){l(r.input)&&r.input>t&&r.input--,l(r.output)&&r.output>t&&r.output--})})};Xh.buffer=function(e,t){e.buffers.splice(t,1),Ae.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--,l(i.extensions)&&l(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};Xh.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Ae.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Ae.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Ae.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Ur(e,"KHR_draco_mesh_compression")&&Ae.mesh(e,function(i){Ae.meshPrimitive(i,function(r){l(r.extensions)&&l(r.extensions.KHR_draco_mesh_compression)&&r.extensions.KHR_draco_mesh_compression.bufferView>t&&r.extensions.KHR_draco_mesh_compression.bufferView--})}),Ur(e,"EXT_feature_metadata")){let r=e.extensions.EXT_feature_metadata.featureTables;for(let o in r)if(r.hasOwnProperty(o)){let a=r[o].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}};Xh.image=function(e,t){e.images.splice(t,1),Ae.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let r=i.extensions;l(r)&&l(r.EXT_texture_webp)&&r.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(r)&&l(r.KHR_texture_basisu)&&r.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};Xh.mesh=function(e,t){e.meshes.splice(t,1),Ae.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Xh.node=function(e,t){e.nodes.splice(t,1),Ae.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(r){return r>t?r-1:r})}),Ae.animation(e,function(i){Ae.animationChannel(i,function(r){l(r.target)&&l(r.target.node)&&r.target.node>t&&r.target.node--})}),Ae.technique(e,function(i){Ae.techniqueUniform(i,function(r){l(r.node)&&r.node>t&&r.node--})}),Ae.node(e,function(i){!l(i.children)||(i.children=i.children.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r}))}),Ae.scene(e,function(i){i.nodes=i.nodes.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r})})};Xh.material=function(e,t){e.materials.splice(t,1),Ae.mesh(e,function(i){Ae.meshPrimitive(i,function(r){l(r.material)&&r.material>t&&r.material--})})};Xh.sampler=function(e,t){e.samplers.splice(t,1),Ae.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};Xh.texture=function(e,t){if(e.textures.splice(t,1),Ae.material(e,function(i){Ww(i,function(r,o){o.index>t&&--o.index})}),Ur(e,"EXT_feature_metadata")){Ae.mesh(e,function(o){Ae.meshPrimitive(o,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let g=u[d].featureIds.texture;g.index>t&&--g.index}}}})});let r=e.extensions.EXT_feature_metadata.featureTextures;for(let o in r)if(r.hasOwnProperty(o)){let a=r[o].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let f=a[c].texture;f.index>t&&--f.index}}}}};function Kh(){}Kh.accessor=function(e){let t={};return Ae.mesh(e,function(n){Ae.meshPrimitive(n,function(i){Ae.meshPrimitiveAttribute(i,function(o){t[o]=!0}),Ae.meshPrimitiveTarget(i,function(o){Ae.meshPrimitiveTargetAttribute(o,function(s){t[s]=!0})});let r=i.indices;l(r)&&(t[r]=!0)})}),Ae.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Ae.animation(e,function(n){Ae.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),Ur(e,"EXT_mesh_gpu_instancing")&&Ae.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let r=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[r]=!0})}),t};Kh.buffer=function(e){let t={};return Ae.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0),l(n.extensions)&&l(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};Kh.bufferView=function(e){let t={};if(Ae.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Ae.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Ae.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Ur(e,"KHR_draco_mesh_compression")&&Ae.mesh(e,function(n){Ae.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),Ur(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}return t};Kh.image=function(e){let t={};return Ae.texture(e,function(n){l(n.source)&&(t[n.source]=!0),l(n.extensions)&&l(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:l(n.extensions)&&l(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};Kh.mesh=function(e){let t={};return Ae.node(e,function(n){if(l(n.mesh&&l(e.meshes))){let i=e.meshes[n.mesh];l(i)&&l(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function doe(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(r){return!doe(e,r,n)}).length===0}Kh.node=function(e){let t={};return Ae.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Ae.skinJoint(n,function(i){t[i]=!0})}),Ae.animation(e,function(n){Ae.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Ae.technique(e,function(n){Ae.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Ae.node(e,function(n,i){doe(e,i,t)||(t[i]=!0)}),t};Kh.material=function(e){let t={};return Ae.mesh(e,function(n){Ae.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Kh.texture=function(e){let t={};if(Ae.material(e,function(n){Ww(n,function(i){t[i]=!0})}),Ur(e,"EXT_feature_metadata")){Ae.mesh(e,function(r){Ae.meshPrimitive(r,function(o){let s=o.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].texture;t[u.index]=!0}}}}return t};Kh.sampler=function(e){let t={};return Ae.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var WL=eke;function ike(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},r={buffer:fr(e.buffers,n),byteOffset:0,byteLength:t.length};return fr(e.bufferViews,r)}var jL=ike;function rke(e,t){let n=_s(e,t),i=K.getSizeInBytes(t.componentType),r=ps(t.type),o=t.count,s=new Array(r*o);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,u=t.byteOffset+a.byteOffset+c.byteOffset,f=new DataView(c.buffer),d=new Array(r),p=Ag(t.componentType);for(let g=0;g<o;++g){p(f,u,r,i,d);for(let m=0;m<r;++m)s[g*r+m]=d[m];u+=n}return s}var qL=rke;function oke(e){let t;return Ae.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===Z.BYTE?YL(e,i,K.UNSIGNED_BYTE):t!==Z.UNSIGNED_BYTE&&t!==Z.UNSIGNED_SHORT&&YL(e,i,K.UNSIGNED_SHORT)}),Ae.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===Z.BYTE?YL(e,i,K.UNSIGNED_BYTE):t===Z.SHORT&&YL(e,i,K.UNSIGNED_SHORT)}),e}function YL(e,t,n){let i=K.createTypedArray(n,qL(e,t)),r=new Uint8Array(i.buffer);t.bufferView=jL(e,r),t.componentType=n,t.byteOffset=0}var XL=oke;var KL={.8:fke,"1.0":Oke,"2.0":void 0};function ske(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.targetVersion,i=e.version;e.asset=y(e.asset,{version:"1.0"}),e.asset.version=y(e.asset.version,"1.0"),i=y(i,e.asset.version).toString(),Object.prototype.hasOwnProperty.call(KL,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(KL,i)||(i="1.0"));let r=KL[i];for(;l(r)&&i!==n;)r(e,t),i=e.asset.version,r=KL[i];return e}function moe(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.instanceTechnique;l(r)&&(i.technique=r.technique,i.values=r.values,delete i.instanceTechnique)}}function ake(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n].primitives;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let a=r[s],c=y(a.primitive,Z.TRIANGLES);a.mode=y(a.mode,c),delete a.primitive}}}}function cke(e){let t=e.nodes,n=new h,i=new Re;for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r];if(l(o.rotation)){let a=o.rotation;h.fromArray(a,0,n),Re.fromAxisAngle(n,a[3],i),o.rotation=[i.x,i.y,i.z,i.w]}let s=o.instanceSkin;l(s)&&(o.skeletons=s.skeletons,o.skin=s.skin,o.meshes=s.meshes,delete o.instanceSkin)}}function lke(e){let t=e.animations,n=e.accessors,i=e.bufferViews,r=e.buffers,o={},s=new h,a=new Re;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,d=u.parameters,p=u.samplers;if(l(f)){let g=f.length;for(let m=0;m<g;++m){let x=f[m];if(x.target.path==="rotation"){let C=d[p[x.sampler].output];if(l(o[C]))continue;o[C]=!0;let A=n[C],b=i[A.bufferView],S=r[b.buffer].extras._pipeline.source,w=S.byteOffset+b.byteOffset+A.byteOffset,D=A.componentType,I=A.count,O=ps(A.type),B=A.count*O,L=K.createArrayBufferView(D,S.buffer,w,B);for(let _=0;_<I;_++){let E=_*O;h.unpack(L,E,s);let v=L[E+3];Re.fromAxisAngle(s,v,a),Re.pack(a,L,E)}}}}}}function uke(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.passes;if(l(r)){let o=y(i.pass,"defaultPass");if(Object.prototype.hasOwnProperty.call(r,o)){let s=r[o],a=s.instanceProgram;i.attributes=y(i.attributes,a.attributes),i.program=y(i.program,a.program),i.uniforms=y(i.uniforms,a.uniforms),i.states=y(i.states,s.states)}delete i.passes,delete i.pass}}}function fke(e){l(e.asset)||(e.asset={});let t=e.asset;if(t.version="1.0",typeof t.profile=="string"){let n=t.profile.split(" ");t.profile={api:n[0],version:n[1]}}else t.profile={};if(l(e.version)&&delete e.version,moe(e),ake(e),cke(e),lke(e),uke(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=y(e.extensions,{});e.extensions=n;let i=y(n.KHR_materials_common,{});n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,Yh(e,"KHR_materials_common")}}function dke(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.parameters;if(l(r)){let o=i.samplers;for(let s in o)if(Object.prototype.hasOwnProperty.call(o,s)){let a=o[s];a.input=r[a.input],a.output=r[a.output]}delete i.parameters}}}function hoe(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let r=e[i];t[i]=n.length,n.push(r),l(r.name)||(r.name=i)}return n}function hke(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,r={},o=e.nodes;for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i=o[s].jointName,l(i)&&(r[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&l(n[s])){let a={},c=e[s];e[s]=hoe(c,a),n[s]=a}for(i in r)Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n.nodes[r[i]]);l(e.scene)&&(e.scene=n.scenes[e.scene]),Ae.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Ae.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Ae.shader(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Ae.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Ae.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),Ae.techniqueParameter(s,function(a){l(a.node)&&(a.node=n.nodes[a.node]);let c=a.value;typeof c=="string"&&(a.value={index:n.textures[c]})})}),Ae.mesh(e,function(s){Ae.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),Ae.meshPrimitiveAttribute(a,function(c,u){a.attributes[u]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),Ae.node(e,function(s){let a=s.children;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(l(s.meshes)){let c=s.meshes,u=c.length;if(u>0)for(s.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},d=fr(e.nodes,f);l(a)||(a=[],s.children=a),a.push(d)}delete s.meshes}if(l(s.camera)&&(s.camera=n.cameras[s.camera]),l(s.skin)&&(s.skin=n.skins[s.skin]),l(s.skeletons)){let c=s.skeletons;if(c.length>0&&l(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),Ae.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t<u;++t)c[t]=r[a[t]];s.joints=c,delete s.jointNames}}),Ae.scene(e,function(s){let a=s.nodes;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}}),Ae.animation(e,function(s){let a={};s.samplers=hoe(s.samplers,a),Ae.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),Ae.animationChannel(s,function(c){c.sampler=a[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),Ae.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),Ae.materialValue(s,function(c,u){typeof c=="string"&&(s.values[u]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&Ae.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),Ae.image(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],s.mimeType=c.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Ae.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function mke(e){Ae.animation(e,function(t){Ae.animationSampler(t,function(n){delete n.name})})}function pke(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];Array.isArray(n)&&n.length===0&&delete e[t]}Ae.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function _ke(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var gke={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function yke(e){let t=e.extensionsUsed;if(e.extensionsRequired=y(e.extensionsRequired,[]),l(t)){let n=t.length;for(let i=0;i<n;++i){let r=t[i];l(gke[r])&&e.extensionsRequired.push(r)}}}function xke(e){Ae.buffer(e,function(t){delete t.type})}function Cke(e){Ae.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function Ake(e){Ae.mesh(e,function(t){Ae.meshPrimitive(t,function(n){Ae.meshPrimitiveAttribute(n,function(i,r){r==="TEXCOORD"?n.attributes.TEXCOORD_0=i:r==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),Ae.technique(e,function(t){Ae.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var Tke={POSITION:!0,NORMAL:!0,TANGENT:!0},bke={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function Eke(e){let t={};Ae.mesh(e,function(n){Ae.meshPrimitive(n,function(i){Ae.meshPrimitiveAttribute(i,function(r,o){if(o.charAt(0)!=="_"){let s=o.search(/_[0-9]+/g),a=o,c="_0";s>=0&&(a=o.substring(0,s),c=o.substring(s));let u,f=bke[a];l(f)?(u=f+c,t[o]=u):l(Tke[a])||(u="_"+o,t[o]=u)}});for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r],s=i.attributes[r];l(s)&&(delete i.attributes[r],i.attributes[o]=s)}})}),Ae.technique(e,function(n){Ae.techniqueParameter(n,function(i){let r=t[i.semantic];l(r)&&(i.semantic=r)})})}function Ske(e){Ae.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let r=n.yfov;l(r)&&r===0&&(n.yfov=1)}})}function I6(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:_s(e,t)}function wke(e){Ae.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Ae.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],r=I6(e,t),o=t.byteOffset+t.count*r;i.byteLength=Math.max(y(i.byteLength,0),o)}})}function vke(e){let t,n,i,r=e.bufferViews,o={};Ae.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(o[c.bufferView]=!0)});let s={};Ae.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=y(s[a.bufferView],[]),s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=r[a];let c=s[a];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let u=0,f=0,d=c.length;for(t=0;t<d;++t){let p=c[t],g=I6(e,p),m=p.byteOffset,x=p.count*g;delete p.byteStride;let C=t<d-1,A=C?I6(e,c[t+1]):void 0;if(g!==A){let b=$e(i,!0);o[a]&&(b.byteStride=g),b.byteOffset+=u,b.byteLength=m+x-u;let T=fr(r,b);for(n=f;n<=t;++n)p=c[n],p.bufferView=T,p.byteOffset=p.byteOffset-u;u=C?c[t+1].byteOffset:void 0,f=t+1}}}WL(e,["accessor","bufferView","buffer"])}function Dke(e){Ae.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=Gw(e,n);n.min=i.min,n.max=i.max}})}function poe(e){return(!l(e.children)||e.children.length===0)&&(!l(e.meshes)||e.meshes.length===0)&&!l(e.camera)&&!l(e.skin)&&!l(e.skeletons)&&!l(e.jointName)&&(!l(e.translation)||h.fromArray(e.translation).equals(h.ZERO))&&(!l(e.scale)||h.fromArray(e.scale).equals(new h(1,1,1)))&&(!l(e.rotation)||se.fromArray(e.rotation).equals(new se(0,0,0,1)))&&(!l(e.matrix)||N.fromColumnMajorArray(e.matrix).equals(N.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function _oe(e,t){Ae.scene(e,function(n){let i=n.nodes;if(l(i)){let r=i.length;for(let o=r;o>=0;--o)if(i[o]===t){i.splice(o,1);return}}}),Ae.node(e,function(n,i){if(l(n.children)){let r=n.children.indexOf(t);r>-1&&(n.children.splice(r,1),poe(n)&&_oe(e,i))}}),delete e.nodes[t]}function Pke(e){return Ae.node(e,function(t,n){poe(t)&&_oe(e,n)}),e}function Ike(e){Ae.animation(e,function(t){Ae.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let r=Gw(e,i);i.min=r.min,i.max=r.max}})})}function Oke(e){e.asset=y(e.asset,{}),e.asset.version="2.0",moe(e),dke(e),Pke(e),hke(e),mke(e),_ke(e),yke(e),wke(e),vke(e),Dke(e),Ike(e),xke(e),Cke(e),Ake(e),Eke(e),XL(e),Ske(e),zL(e),GL(e),pke(e)}var Tg=ske;function Cp(){this.initialized=!1,this.resourcesParsed=!1,this.vertexBuffersToCreate=new rl,this.indexBuffersToCreate=new rl,this.buffers={},this.pendingBufferLoads=0,this.programsToCreate=new rl,this.shaders={},this.pendingShaderLoads=0,this.texturesToCreate=new rl,this.pendingTextureLoads=0,this.texturesToCreateFromBufferView=new rl,this.pendingBufferViewToImage=0,this.createSamplers=!0,this.createSkins=!0,this.createRuntimeAnimations=!0,this.createVertexArrays=!0,this.createRenderStates=!0,this.createUniformMaps=!0,this.createRuntimeNodes=!0,this.createdBufferViews={},this.primitivesToDecode=new rl,this.activeDecodingTasks=0,this.pendingDecodingCache=!1,this.skinnedNodesIds=[]}function Rke(e,t,n){return e.subarray(t,t+n)}Cp.prototype.getBuffer=function(e){return Rke(this.buffers[e.buffer],e.byteOffset,e.byteLength)};Cp.prototype.finishedPendingBufferLoads=function(){return this.pendingBufferLoads===0};Cp.prototype.finishedBuffersCreation=function(){return this.pendingBufferLoads===0&&this.vertexBuffersToCreate.length===0&&this.indexBuffersToCreate.length===0};Cp.prototype.finishedProgramCreation=function(){return this.pendingShaderLoads===0&&this.programsToCreate.length===0};Cp.prototype.finishedTextureCreation=function(){let e=this.pendingTextureLoads===0,t=this.texturesToCreate.length===0&&this.texturesToCreateFromBufferView.length===0;return e&&t};Cp.prototype.finishedEverythingButTextureCreation=function(){let e=this.pendingBufferLoads===0&&this.pendingShaderLoads===0,t=this.vertexBuffersToCreate.length===0&&this.indexBuffersToCreate.length===0&&this.programsToCreate.length===0&&this.pendingBufferViewToImage===0;return this.finishedDecoding()&&e&&t};Cp.prototype.finishedDecoding=function(){return this.primitivesToDecode.length===0&&this.activeDecodingTasks===0&&!this.pendingDecodingCache};Cp.prototype.finished=function(){return this.finishedDecoding()&&this.finishedTextureCreation()&&this.finishedEverythingButTextureCreation()};var jT=Cp;var Fi={};Fi.updateForwardAxis=function(e){let t=e.gltfInternal.extras.sourceVersion;(l(t)&&t!=="2.0"||Fi.getAssetVersion(e.gltfInternal)!=="2.0")&&(e._gltfForwardAxis=On.X)};Fi.getAssetVersion=function(e){return!l(e.asset)||!l(e.asset.version)?"1.0":e.asset.version};Fi.splitIncompatibleMaterials=function(e){let t=e.accessors,n=e.materials,i={};return Ae.mesh(e,function(r){Ae.meshPrimitive(r,function(o){let s=o.material,a=n[s],c=o.attributes.JOINTS_0,u,f;if(l(c)){let S=t[c];u=S.componentType,f=S.type}let d=l(c)&&f==="VEC4",p=l(o.attributes.COLOR_0),g=l(o.targets),m=l(o.attributes.NORMAL),x=l(o.attributes.TANGENT),C=l(o.attributes.TEXCOORD_0),A=C&&l(o.attributes.TEXCOORD_1),b=l(o.extensions)&&l(o.extensions.CESIUM_primitive_outline),T=i[s];if(!l(T))i[s]={skinning:{skinned:d,componentType:u},hasVertexColors:p,hasMorphTargets:g,hasNormals:m,hasTangents:x,hasTexCoords:C,hasTexCoord1:A,hasOutline:b};else if(T.skinning.skinned!==d||T.hasVertexColors!==p||T.hasMorphTargets!==g||T.hasNormals!==m||T.hasTangents!==x||T.hasTexCoords!==C||T.hasTexCoord1!==A||T.hasOutline!==b){let S=$e(a,!0);s=fr(n,S),o.material=s,i[s]={skinning:{skinned:d,componentType:u},hasVertexColors:p,hasMorphTargets:g,hasNormals:m,hasTangents:x,hasTexCoords:C,hasTexCoord1:A,hasOutline:b}}})}),i};Fi.getShaderVariable=function(e){return e==="SCALAR"?"float":e.toLowerCase()};Fi.ModelState={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3};Fi.getFailedLoadFunction=function(e,t,n){return function(i){e._state=Fi.ModelState.FAILED;let r=`Failed to load ${t}: ${n}`;l(i)&&(r+=`
- ${i.message}`),e._readyPromise.reject(new fe(r))}};Fi.parseBuffers=function(e,t){let n=e._loadResources;Ae.buffer(e.gltfInternal,function(i,r){if(l(i.extras._pipeline.source))n.buffers[r]=i.extras._pipeline.source;else if(l(t)){let o=e._resource.getDerivedResource({url:i.uri});++n.pendingBufferLoads,o.fetchArrayBuffer().then(t(e,r)).catch(Fi.getFailedLoadFunction(e,"buffer",o.url))}})};var Mke=new h,Bke=new h;Fi.computeBoundingSphere=function(e){let t=e.gltfInternal,n=t.nodes,i=t.meshes,r=t.scenes[t.scene].nodes,o=r.length,s=[],a=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),c=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let f=0;f<o;++f){let d=n[r[f]];for(d._transformToRoot=Fi.getTransform(d),s.push(d);s.length>0;){d=s.pop();let p=d._transformToRoot,g=d.mesh;if(l(g)){let C=i[g].primitives,A=C.length;for(let b=0;b<A;++b){let T=C[b].attributes.POSITION;if(l(T)){let S=Fi.getAccessorMinMax(t,T);if(l(S.min)&&l(S.max)){let w=h.fromArray(S.min,0,Mke),D=h.fromArray(S.max,0,Bke);N.multiplyByPoint(p,w,w),N.multiplyByPoint(p,D,D),h.minimumByComponent(a,w,a),h.maximumByComponent(c,D,c)}}}}let m=d.children;if(l(m)){let x=m.length;for(let C=0;C<x;++C){let A=n[m[C]];A._transformToRoot=Fi.getTransform(A),N.multiplyTransformation(p,A._transformToRoot,A._transformToRoot),s.push(A)}}delete d._transformToRoot}}let u=re.fromCornerPoints(a,c);return e.forwardAxis===On.Z&&re.transformWithoutScale(u,On.Z_UP_TO_X_UP,u),e._upAxis===On.Y?re.transformWithoutScale(u,On.Y_UP_TO_Z_UP,u):e._upAxis===On.X&&re.transformWithoutScale(u,On.X_UP_TO_Z_UP,u),u};function Lke(e,t){return Ae.techniqueAttribute(e,function(n,i){if(n.semantic===t)return i})}function Nke(e,t){let n=e.accessors,i=e.materials,r=e.extensions.KHR_techniques_webgl,o=r.techniques,s=r.programs,a=r.shaders,c=t.targets,u=t.attributes;for(let m in c)if(c.hasOwnProperty(m)){let x=c[m];for(let C in x)C!=="extras"&&(u[`${C}_${m}`]=x[C])}let f=i[t.material],d=o[f.extensions.KHR_techniques_webgl.technique],p=s[d.program],g=a[p.vertexShader];for(let m in u)if(u.hasOwnProperty(m)&&!l(Lke(d,m))){let x=u[m],C=n[x],A=m.toLowerCase();A.charAt(0)==="_"&&(A=A.slice(1));let b=`a_${A}`;d.attributes[b]={semantic:m,type:C.componentType};let T=g.extras._pipeline,S=T.source;S=`attribute ${Fi.getShaderVariable(C.type)} ${b};
- ${S}`,T.source=S}}Fi.ensureSemanticExistence=function(e){return Ae.mesh(e,function(t){Ae.meshPrimitive(t,function(n){Nke(e,n)})}),e};Fi.createAttributeLocations=function(e,t){let n={},i=!1,r=1;if(Ae.techniqueAttribute(e,function(o,s){/pos/i.test(s)&&!i?(n[s]=0,i=!0):n[s]=r++}),l(t))for(let o in t)t.hasOwnProperty(o)&&(n[o]=r++);return n};Fi.getAccessorMinMax=function(e,t){let n=e.accessors[t],i=n.extensions,r=n.min,o=n.max;if(l(i)){let s=i.WEB3D_quantized_attributes;l(s)&&(r=s.decodedMin,o=s.decodedMax)}return{min:r,max:o}};function goe(e,t,n,i){return Ur(e,"KHR_techniques_webgl")?function(r,o){if(r.semantic===n&&(!i||!l(r.node)))return o}:function(r,o){let s=t.parameters[r];if(s.semantic===n&&(!i||!l(s.node)))return o}}Fi.getAttributeOrUniformBySemantic=function(e,t,n,i){return Ae.technique(e,function(r){if(l(n)&&r.program!==n)return;let o=Ae.techniqueAttribute(r,goe(e,r,t,i));return l(o)?o:Ae.techniqueUniform(r,goe(e,r,t,i))})};Fi.getDiffuseAttributeOrUniform=function(e,t){let n=Fi.getAttributeOrUniformBySemantic(e,"COLOR_0",t);return l(n)||(n=Fi.getAttributeOrUniformBySemantic(e,"_3DTILESDIFFUSE",t)),n};var Fke=new h,Vke=new Re,kke=new h;Fi.getTransform=function(e,t){return l(e.matrix)?N.fromColumnMajorArray(e.matrix,t):N.fromTranslationQuaternionRotationScale(h.fromArray(e.translation,0,Fke),Re.unpack(e.rotation,0,Vke),h.fromArray(e.scale,0,kke),t)};Fi.getUsedExtensions=function(e){let t=e.extensionsUsed,n={};if(l(t)){let i=t.length;for(let r=0;r<i;r++){let o=t[r];n[o]=!0}}return n};Fi.getRequiredExtensions=function(e){let t=e.extensionsRequired,n={};if(l(t)){let i=t.length;for(let r=0;r<i;r++){let o=t[r];n[o]=!0}}return n};Fi.supportedExtensions={AGI_articulations:!0,CESIUM_RTC:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_binary_glTF:!0,KHR_texture_basisu:!0,KHR_draco_mesh_compression:!0,KHR_materials_common:!0,KHR_techniques_webgl:!0,KHR_materials_unlit:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0};Fi.checkSupportedExtensions=function(e,t){for(let n in e)if(e.hasOwnProperty(n)){if(!Fi.supportedExtensions[n])throw new fe(`Unsupported glTF Extension: ${n}`);if(n==="EXT_texture_webp"&&t===!1)throw new fe("Loaded model requires WebP but browser does not support it.")}};Fi.checkSupportedGlExtensions=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let r=e[i];if(r!=="OES_element_index_uint")throw new fe(`Unsupported WebGL Extension: ${r}`);if(!t.elementIndexUint)throw new fe("OES_element_index_uint WebGL extension is not enabled.")}}};function O6(e,t,n){t+="(?!\\w)",t=new RegExp(t,"g");let i=e.search(t);return e.replace(t,function(r,o){return i===o?r:n})}function Uke(e,t){let i=e.accessors[t].extensions;if(l(i))return i.WEB3D_quantized_attributes}function yoe(e,t,n){let i=t.material,r=e.materials[i];if(!Ur(e,"KHR_techniques_webgl")||!l(r.extensions)||!l(r.extensions.KHR_techniques_webgl))return;let o=r.extensions.KHR_techniques_webgl.technique,a=e.extensions.KHR_techniques_webgl.techniques[o];return Ae.techniqueAttribute(a,function(c,u){if(c.semantic===n)return u})}Fi.modifyShaderForDracoQuantizedAttributes=function(e,t,n,i){let r={};for(let o in i)if(i.hasOwnProperty(o)){let s=i[o],a=s.quantization;if(!l(a))continue;let c=yoe(e,t,o);o.charAt(0)==="_"&&(o=o.substring(1));let u=`gltf_u_dec_${o.toLowerCase()}`;if(!l(r[u])){let f=`gltf_decoded_${o}`,d=c.replace("a_","gltf_a_dec_"),p=s.componentsPerAttribute;n=O6(n,c,d);let g;a.octEncoded?g="vec3":p>1?g=`vec${p}`:g="float",n=`${g} ${d};
- ${n}`;let m=p===3&&o==="COLOR_0";m&&(n=O6(n,d,`vec4(${d}, 1.0)`));let x="";if(a.octEncoded){let C=`${u}_rangeConstant`;n=`uniform float ${C};
- ${n}`,x=`
- void main() {
- ${d} = czm_octDecode(${c}.xy, ${C}).zxy;
- ${f}();
- }
- `}else{let C=`${u}_normConstant`,A=`${u}_min`;n=`uniform float ${C};
- uniform ${g} ${A};
- ${n}`,x=`
- void main() {
- ${d} = ${A} + ${c}${m?".xyz":""} * ${C};
- ${f}();
- }
- `}n=Fe.replaceMain(n,f),n+=x}}return{shader:n}};Fi.modifyShaderForQuantizedAttributes=function(e,t,n){let i={},r=t.attributes;for(let o in r)if(r.hasOwnProperty(o)){let s=yoe(e,t,o),a=t.attributes[o];o.charAt(0)==="_"&&(o=o.substring(1));let c=`gltf_u_dec_${o.toLowerCase()}`,u=`${c}_scale`,f=`${c}_translate`;if(!l(i[c])&&!l(i[u])){let d=Uke(e,a);if(l(d)){let p=d.decodeMatrix,g=`gltf_decoded_${o}`,m=s.replace("a_","gltf_a_dec_"),x=Math.floor(Math.sqrt(p.length));n=O6(n,s,m);let C;x>2?C=`vec${x-1}`:C="float",n=`${C} ${m};
- ${n}`;let A="";x===5?(n=`uniform mat4 ${u};
- ${n}`,n=`uniform vec4 ${f};
- ${n}`,A=`
- void main() {
- ${m} = ${u} * ${s} + ${f};
- ${g}();
- }
- `,i[u]={mat:4},i[f]={vec:4}):(n=`uniform mat${x} ${c};
- ${n}`,A=`
- void main() {
- ${m} = ${C}(${c} * vec${x}(${s},1.0));
- ${g}();
- }
- `,i[c]={mat:x}),n=Fe.replaceMain(n,g),n+=A}}}return{shader:n,uniforms:i}};function YT(e){let t={value:e,clone:function(n,i){return n},func:function(){return t.value}};return t}function ZL(e){let t={value:W.fromArray(e),clone:W.clone,func:function(){return t.value}};return t}function JL(e){let t={value:h.fromArray(e),clone:h.clone,func:function(){return t.value}};return t}function XT(e){let t={value:se.fromArray(e),clone:se.clone,func:function(){return t.value}};return t}function R6(e){let t={value:Ri.fromColumnMajorArray(e),clone:Ri.clone,func:function(){return t.value}};return t}function M6(e){let t={value:Q.fromColumnMajorArray(e),clone:Q.clone,func:function(){return t.value}};return t}function $L(e){let t={value:N.fromColumnMajorArray(e),clone:N.clone,func:function(){return t.value}};return t}function QL(e,t,n){this._value=void 0,this._textureId=e.index,this._textures=t,this._defaultTexture=n}Object.defineProperties(QL.prototype,{value:{get:function(){if(!l(this._value)){let e=this._textures[this._textureId];if(l(e))this._value=e;else return this._defaultTexture}return this._value},set:function(e){this._value=e}}});QL.prototype.clone=function(e){return e};QL.prototype.func=void 0;function zke(e,t,n){let i=new QL(e,t,n);return i.func=function(){return i.value},i}var _a={};_a[Z.FLOAT]=YT;_a[Z.FLOAT_VEC2]=ZL;_a[Z.FLOAT_VEC3]=JL;_a[Z.FLOAT_VEC4]=XT;_a[Z.INT]=YT;_a[Z.INT_VEC2]=ZL;_a[Z.INT_VEC3]=JL;_a[Z.INT_VEC4]=XT;_a[Z.BOOL]=YT;_a[Z.BOOL_VEC2]=ZL;_a[Z.BOOL_VEC3]=JL;_a[Z.BOOL_VEC4]=XT;_a[Z.FLOAT_MAT2]=R6;_a[Z.FLOAT_MAT3]=M6;_a[Z.FLOAT_MAT4]=$L;_a[Z.SAMPLER_2D]=zke;Fi.createUniformFunction=function(e,t,n,i){return _a[e](t,n,i)};function Hke(e){return[e[0],e[1],e[2],e[3],e[5],e[6],e[7],e[8],e[10],e[11],e[12],e[13],e[15],e[16],e[17],e[18]]}function Gke(e){return[e[20],e[21],e[22],e[23]]}Fi.createUniformsForDracoQuantizedAttributes=function(e){let t={};for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.quantization;if(!l(r))continue;n.charAt(0)==="_"&&(n=n.substring(1));let o=`gltf_u_dec_${n.toLowerCase()}`;if(r.octEncoded){let u=`${o}_rangeConstant`,f=(1<<r.quantizationBits)-1;t[u]=YT(f).func;continue}let s=`${o}_normConstant`,a=r.range/(1<<r.quantizationBits);t[s]=YT(a).func;let c=`${o}_min`;switch(i.componentsPerAttribute){case 1:t[c]=YT(r.minValues).func;break;case 2:t[c]=ZL(r.minValues).func;break;case 3:t[c]=JL(r.minValues).func;break;case 4:t[c]=XT(r.minValues).func;break}}return t};Fi.createUniformsForQuantizedAttributes=function(e,t,n){let i=e.accessors,r={},o={},s=t.attributes;for(let a in s)if(s.hasOwnProperty(a)){let c=s[a],u=i[c],f=u.extensions;if(a.charAt(0)==="_"&&(a=a.substring(1)),l(f)){let d=f.WEB3D_quantized_attributes;if(l(d)){let p=d.decodeMatrix,g=`gltf_u_dec_${a.toLowerCase()}`,m,x;switch(u.type){case qt.SCALAR:o[g]=R6(p).func,r[g]=!0;break;case qt.VEC2:o[g]=M6(p).func,r[g]=!0;break;case qt.VEC3:o[g]=$L(p).func,r[g]=!0;break;case qt.VEC4:m=`${g}_scale`,x=`${g}_translate`,o[m]=$L(Hke(p)).func,o[x]=XT(Gke(p)).func,r[m]=!0,r[x]=!0;break}}}}for(let a in n)if(n.hasOwnProperty(a)&&!r[a]){let c=n[a];l(c.mat)&&(c.mat===2?o[a]=R6(Ri.IDENTITY).func:c.mat===3?o[a]=M6(Q.IDENTITY).func:c.mat===4&&(o[a]=$L(N.IDENTITY).func)),l(c.vec)&&c.vec===4&&(o[a]=XT([0,0,0,0]).func)}return o};var qT=new h,Wke={MODEL:function(e,t){return function(){return e.model}},VIEW:function(e,t){return function(){return e.view}},PROJECTION:function(e,t){return function(){return e.projection}},MODELVIEW:function(e,t){return function(){return e.modelView}},CESIUM_RTC_MODELVIEW:function(e,t){let n=new N;return function(){return l(t._rtcCenter)?(N.getTranslation(e.model,qT),h.add(qT,t._rtcCenter,qT),N.multiplyByPoint(e.view,qT,qT),N.setTranslation(e.modelView,qT,n)):e.modelView}},MODELVIEWPROJECTION:function(e,t){return function(){return e.modelViewProjection}},MODELINVERSE:function(e,t){return function(){return e.inverseModel}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t){return function(){return e.inverseModelView}},MODELVIEWPROJECTIONINVERSE:function(e,t){return function(){return e.inverseModelViewProjection}},MODELINVERSETRANSPOSE:function(e,t){return function(){return e.inverseTransposeModel}},MODELVIEWINVERSETRANSPOSE:function(e,t){return function(){return e.normal}},VIEWPORT:function(e,t){return function(){return e.viewportCartesian4}}};Fi.getGltfSemanticUniforms=function(){return Wke};var $t=Fi;function jke(e,t){if(t=y(t,y.EMPTY_OBJECT),!l(e)||!Ur(e,"KHR_materials_common"))return;Ur(e,"KHR_techniques_webgl")||(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl={programs:[],shaders:[],techniques:[]},e.extensionsUsed.push("KHR_techniques_webgl"),e.extensionsRequired.push("KHR_techniques_webgl"));let n=e.extensions.KHR_techniques_webgl;Kke(e);let i=qke(e),r=$t.splitIncompatibleMaterials(e),o={},s=!1;return Ae.material(e,function(a,c){if(l(a.extensions)&&l(a.extensions.KHR_materials_common)){let u=a.extensions.KHR_materials_common,f=r[c],d=Xke(u,f),p=o[d];l(p)||(p=Yke(e,n,f,u,i,t.addBatchIdToGeneratedShaders),o[d]=p,s=!0);let g={},m=u.values,x;for(let C in m)m.hasOwnProperty(C)&&C!=="transparent"&&C!=="doubleSided"&&(x=`u_${C.toLowerCase()}`,g[x]=m[C]);a.extensions.KHR_techniques_webgl={technique:p,values:g},a.alphaMode="OPAQUE",u.transparent&&(a.alphaMode="BLEND"),u.doubleSided&&(a.doubleSided=!0)}}),s&&$t.ensureSemanticExistence(e),e}function qke(e){let t={},n;if(l(e.extensions)&&l(e.extensions.KHR_materials_common)&&(n=e.extensions.KHR_materials_common.lights),l(n)){let i=e.nodes;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o];if(l(s.extensions)&&l(s.extensions.KHR_materials_common)){let a=s.extensions.KHR_materials_common.light;l(a)&&l(n[a])&&(n[a].node=o),delete s.extensions.KHR_materials_common}}let r=0;for(let o in n)if(n.hasOwnProperty(o)){let s=n[o],a=s.type;if(a!=="ambient"&&!l(s.node)){delete n[o];continue}let c=`light${r.toString()}`;s.baseName=c;let u,f,d,p;switch(a){case"ambient":u=s.ambient,t[`${c}Color`]={type:Z.FLOAT_VEC3,value:u.color};break;case"directional":f=s.directional,t[`${c}Color`]={type:Z.FLOAT_VEC3,value:f.color},l(s.node)&&(t[`${c}Transform`]={node:s.node,semantic:"MODELVIEW",type:Z.FLOAT_MAT4});break;case"point":d=s.point,t[`${c}Color`]={type:Z.FLOAT_VEC3,value:d.color},l(s.node)&&(t[`${c}Transform`]={node:s.node,semantic:"MODELVIEW",type:Z.FLOAT_MAT4}),t[`${c}Attenuation`]={type:Z.FLOAT_VEC3,value:[d.constantAttenuation,d.linearAttenuation,d.quadraticAttenuation]};break;case"spot":p=s.spot,t[`${c}Color`]={type:Z.FLOAT_VEC3,value:p.color},l(s.node)&&(t[`${c}Transform`]={node:s.node,semantic:"MODELVIEW",type:Z.FLOAT_MAT4},t[`${c}InverseTransform`]={node:s.node,semantic:"MODELVIEWINVERSE",type:Z.FLOAT_MAT4,useInFragment:!0}),t[`${c}Attenuation`]={type:Z.FLOAT_VEC3,value:[p.constantAttenuation,p.linearAttenuation,p.quadraticAttenuation]},t[`${c}FallOff`]={type:Z.FLOAT_VEC2,value:[p.fallOffAngle,p.fallOffExponent]};break}++r}}return t}function Yke(e,t,n,i,r,o){l(i)||(i={}),o=y(o,!1);let s=t.techniques,a=t.shaders,c=t.programs,u=i.technique.toUpperCase(),f;l(e.extensions)&&l(e.extensions.KHR_materials_common)&&(f=e.extensions.KHR_materials_common.lights);let d=i.values,p=y(i.jointCount,0),g,m=!1,x=!1;l(n)&&(g=n.skinning,m=g.skinned,x=n.hasVertexColors);let C=`precision highp float;
- `,A=`precision highp float;
- `,b=u!=="CONSTANT",T={u_modelViewMatrix:{semantic:Ur(e,"CESIUM_RTC")?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:Z.FLOAT_MAT4},u_projectionMatrix:{semantic:"PROJECTION",type:Z.FLOAT_MAT4}};b&&(T.u_normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:Z.FLOAT_MAT3}),m&&(T.u_jointMatrix={count:p,semantic:"JOINTMATRIX",type:Z.FLOAT_MAT4});let S,w=!1;for(let H in d)if(d.hasOwnProperty(H)&&H!=="transparent"&&H!=="doubleSided"){let V=xoe(H,d[H]);S=`u_${H.toLowerCase()}`,!w&&V===Z.SAMPLER_2D&&(w=!0),T[S]={type:V}}if(l(T.u_diffuse)&&(T.u_diffuse.semantic="_3DTILESDIFFUSE"),l(r))for(let H in r)r.hasOwnProperty(H)&&(S=`u_${H}`,T[S]=r[H]);for(S in T)if(T.hasOwnProperty(S)){let H=T[S],V=l(H.count)?`[${H.count}]`:"";H.type!==Z.FLOAT_MAT3&&H.type!==Z.FLOAT_MAT4||H.useInFragment?(A+=`uniform ${ag(H.type)} ${S}${V};
- `,delete H.useInFragment):C+=`uniform ${ag(H.type)} ${S}${V};
- `}let D="";m&&(D+=` mat4 skinMatrix =
- a_weight.x * u_jointMatrix[int(a_joint.x)] +
- a_weight.y * u_jointMatrix[int(a_joint.y)] +
- a_weight.z * u_jointMatrix[int(a_joint.z)] +
- a_weight.w * u_jointMatrix[int(a_joint.w)];
- `);let I={a_position:{semantic:"POSITION"}};C+=`attribute vec3 a_position;
- `,C+=`varying vec3 v_positionEC;
- `,m?D+=` vec4 pos = u_modelViewMatrix * skinMatrix * vec4(a_position,1.0);
- `:D+=` vec4 pos = u_modelViewMatrix * vec4(a_position,1.0);
- `,D+=` v_positionEC = pos.xyz;
- `,D+=` gl_Position = u_projectionMatrix * pos;
- `,A+=`varying vec3 v_positionEC;
- `,b&&(I.a_normal={semantic:"NORMAL"},C+=`attribute vec3 a_normal;
- `,C+=`varying vec3 v_normal;
- `,m?D+=` v_normal = u_normalMatrix * mat3(skinMatrix) * a_normal;
- `:D+=` v_normal = u_normalMatrix * a_normal;
- `,A+=`varying vec3 v_normal;
- `);let O;w&&(I.a_texcoord_0={semantic:"TEXCOORD_0"},O="v_texcoord_0",C+=`attribute vec2 a_texcoord_0;
- `,C+=`varying vec2 ${O};
- `,D+=` ${O} = a_texcoord_0;
- `,A+=`varying vec2 ${O};
- `),m&&(I.a_joint={semantic:"JOINTS_0"},I.a_weight={semantic:"WEIGHTS_0"},C+=`attribute vec4 a_joint;
- `,C+=`attribute vec4 a_weight;
- `),x&&(I.a_vertexColor={semantic:"COLOR_0"},C+=`attribute vec4 a_vertexColor;
- `,C+=`varying vec4 v_vertexColor;
- `,D+=` v_vertexColor = a_vertexColor;
- `,A+=`varying vec4 v_vertexColor;
- `),o&&(I.a_batchId={semantic:"_BATCHID"},C+=`attribute float a_batchId;
- `);let B=b&&(u==="BLINN"||u==="PHONG")&&l(T.u_specular)&&l(T.u_shininess)&&T.u_shininess>0,L=!1,_=!1,E="";for(let H in f)if(f.hasOwnProperty(H)){let V=f[H],q=V.type.toLowerCase(),j=V.baseName;E+=` {
- `;let X=`u_${j}Color`;if(q==="ambient")_=!0,E+=` ambientLight += ${X};
- `;else if(b){L=!0;let G=`v_${j}Direction`,$=`v_${j}Position`;q!=="point"&&(C+=`varying vec3 ${G};
- `,A+=`varying vec3 ${G};
- `,D+=` ${G} = mat3(u_${j}Transform) * vec3(0.,0.,1.);
- `,q==="directional"&&(E+=` vec3 l = normalize(${G});
- `)),q!=="directional"?(C+=`varying vec3 ${$};
- `,A+=`varying vec3 ${$};
- `,D+=` ${$} = u_${j}Transform[3].xyz;
- `,E+=` vec3 VP = ${$} - v_positionEC;
- `,E+=` vec3 l = normalize(VP);
- `,E+=` float range = length(VP);
- `,E+=` float attenuation = 1.0 / (u_${j}Attenuation.x + `,E+=`(u_${j}Attenuation.y * range) + `,E+=`(u_${j}Attenuation.z * range * range));
- `):E+=` float attenuation = 1.0;
- `,q==="spot"&&(E+=` float spotDot = dot(l, normalize(${G}));
- `,E+=` if (spotDot < cos(u_${j}FallOff.x * 0.5))
- `,E+=` {
- `,E+=` attenuation = 0.0;
- `,E+=` }
- `,E+=` else
- `,E+=` {
- `,E+=` attenuation *= max(0.0, pow(spotDot, u_${j}FallOff.y));
- `,E+=` }
- `),E+=` diffuseLight += ${X}* max(dot(normal,l), 0.) * attenuation;
- `,B&&(u==="BLINN"?(E+=` vec3 h = normalize(l + viewDir);
- `,E+=` float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)) * attenuation;
- `):(E+=` vec3 reflectDir = reflect(-l, normal);
- `,E+=` float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation;
- `),E+=` specularLight += ${X} * specularIntensity;
- `)}E+=` }
- `}_||(E+=` ambientLight += vec3(0.2, 0.2, 0.2);
- `),!L&&u!=="CONSTANT"&&(A+=`#ifdef USE_CUSTOM_LIGHT_COLOR
- `,A+=`uniform vec3 gltf_lightColor;
- `,A+=`#endif
- `,E+=`#ifndef USE_CUSTOM_LIGHT_COLOR
- `,E+=` vec3 lightColor = czm_lightColor;
- `,E+=`#else
- `,E+=` vec3 lightColor = gltf_lightColor;
- `,E+=`#endif
- `,E+=` vec3 l = normalize(czm_lightDirectionEC);
- `,E+=` diffuseLight += lightColor * max(dot(normal,l), 0.2);
- `,B&&(u==="BLINN"?(E+=` vec3 h = normalize(l + viewDir);
- `,E+=` float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess));
- `):(E+=` vec3 reflectDir = reflect(-l, normal);
- `,E+=` float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess));
- `),E+=` specularLight += lightColor * specularIntensity;
- `)),C+=`void main(void) {
- `,C+=D,C+=`}
- `,A+=`void main(void) {
- `;let v=` vec3 color = vec3(0.0, 0.0, 0.0);
- `;b&&(A+=` vec3 normal = normalize(v_normal);
- `,i.doubleSided&&(A+=` if (czm_backFacing())
- `,A+=` {
- `,A+=` normal = -normal;
- `,A+=` }
- `));let P;u!=="CONSTANT"?(l(T.u_diffuse)&&(T.u_diffuse.type===Z.SAMPLER_2D?A+=` vec4 diffuse = texture2D(u_diffuse, ${O});
- `:A+=` vec4 diffuse = u_diffuse;
- `,A+=` vec3 diffuseLight = vec3(0.0, 0.0, 0.0);
- `,v+=` color += diffuse.rgb * diffuseLight;
- `),B&&(T.u_specular.type===Z.SAMPLER_2D?A+=` vec3 specular = texture2D(u_specular, ${O}).rgb;
- `:A+=` vec3 specular = u_specular.rgb;
- `,A+=` vec3 specularLight = vec3(0.0, 0.0, 0.0);
- `,v+=` color += specular * specularLight;
- `),l(T.u_transparency)?P=` gl_FragColor = vec4(color * diffuse.a * u_transparency, diffuse.a * u_transparency);
- `:P=` gl_FragColor = vec4(color * diffuse.a, diffuse.a);
- `):l(T.u_transparency)?P=` gl_FragColor = vec4(color * u_transparency, u_transparency);
- `:P=` gl_FragColor = vec4(color, 1.0);
- `,x&&(v+=` color *= v_vertexColor.rgb;
- `),l(T.u_emission)&&(T.u_emission.type===Z.SAMPLER_2D?A+=` vec3 emission = texture2D(u_emission, ${O}).rgb;
- `:A+=` vec3 emission = u_emission.rgb;
- `,v+=` color += emission;
- `),(l(T.u_ambient)||u!=="CONSTANT")&&(l(T.u_ambient)?T.u_ambient.type===Z.SAMPLER_2D?A+=` vec3 ambient = texture2D(u_ambient, ${O}).rgb;
- `:A+=` vec3 ambient = u_ambient.rgb;
- `:A+=` vec3 ambient = diffuse.rgb;
- `,v+=` color += ambient * ambientLight;
- `),A+=` vec3 viewDir = -normalize(v_positionEC);
- `,A+=` vec3 ambientLight = vec3(0.0, 0.0, 0.0);
- `,A+=E,A+=v,A+=P,A+=`}
- `;let R=fr(a,{type:Z.VERTEX_SHADER,extras:{_pipeline:{source:C,extension:".glsl"}}}),F=fr(a,{type:Z.FRAGMENT_SHADER,extras:{_pipeline:{source:A,extension:".glsl"}}}),U=fr(c,{fragmentShader:F,vertexShader:R});return fr(s,{attributes:I,program:U,uniforms:T})}function xoe(e,t){let n;switch(l(t.value)?n=t.value:l(t.index)?n=[t.index]:n=t,e){case"ambient":return n.length===1?Z.SAMPLER_2D:Z.FLOAT_VEC4;case"diffuse":return n.length===1?Z.SAMPLER_2D:Z.FLOAT_VEC4;case"emission":return n.length===1?Z.SAMPLER_2D:Z.FLOAT_VEC4;case"specular":return n.length===1?Z.SAMPLER_2D:Z.FLOAT_VEC4;case"shininess":return Z.FLOAT;case"transparency":return Z.FLOAT;case"transparent":return Z.BOOL;case"doubleSided":return Z.BOOL}}function Xke(e,t){let n="";n+=`technique:${e.technique};`;let i=e.values,r=Object.keys(i).sort(),o=r.length;for(let a=0;a<o;++a){let c=r[a];i.hasOwnProperty(c)&&(n+=`${c}:${xoe(c,i[c])}`,n+=";")}let s=y(e.jointCount,0);if(n+=`${s.toString()};`,l(t)){let a=t.skinning;s>0&&(n+=`${a.type};`),n+=t.hasVertexColors}return n}function Kke(e){let t=e.extensions.KHR_materials_common;if(!l(t)||!l(t.lights))return;let n=t.lights,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.type==="ambient"){l(o.ambient)||(o.ambient={});let s=o.ambient;l(s.color)||(s.color=[1,1,1])}else if(o.type==="directional"){l(o.directional)||(o.directional={});let s=o.directional;l(s.color)||(s.color=[1,1,1])}else if(o.type==="point"){l(o.point)||(o.point={});let s=o.point;l(s.color)||(s.color=[1,1,1]),s.constantAttenuation=y(s.constantAttenuation,1),s.linearAttenuation=y(s.linearAttenuation,0),s.quadraticAttenuation=y(s.quadraticAttenuation,0)}else if(o.type==="spot"){l(o.spot)||(o.spot={});let s=o.spot;l(s.color)||(s.color=[1,1,1]),s.constantAttenuation=y(s.constantAttenuation,1),s.fallOffAngle=y(s.fallOffAngle,3.14159265),s.fallOffExponent=y(s.fallOffExponent,0),s.linearAttenuation=y(s.linearAttenuation,0),s.quadraticAttenuation=y(s.quadraticAttenuation,0)}}}var KT=jke;function $ke(e,t){if(t=y(t,y.EMPTY_OBJECT),Ur(e,"KHR_techniques_webgl")||!l(e.materials)||e.materials.length===0)return e;l(e.extensions)||(e.extensions={}),l(e.extensionsUsed)||(e.extensionsUsed=[]),l(e.extensionsRequired)||(e.extensionsRequired=[]),e.extensions.KHR_techniques_webgl={programs:[],shaders:[],techniques:[]},e.extensionsUsed.push("KHR_techniques_webgl"),e.extensionsRequired.push("KHR_techniques_webgl");let n=$t.splitIncompatibleMaterials(e);return Ae.material(e,function(i,r){let o={},s=tUe(e,i,r,o,n,t);l(i.extensions)||(i.extensions={}),i.extensions.KHR_techniques_webgl={values:o,technique:s}}),$t.ensureSemanticExistence(e),e}function Zke(e){return l(e.extensions)&&l(e.extensions.KHR_materials_pbrSpecularGlossiness)}function sx(e,t,n,i,r){let o,s=n[t];return l(s)&&l(s.texCoord)&&s.texCoord===1&&(i=i.replace("0","1")),l(n[`${t}Offset`])?(o=`${t}Coord`,r.fragmentShaderMain+=` vec2 ${o} = computeTexCoord(${i}, ${t}Offset, ${t}Rotation, ${t}Scale);
- `):o=i,o}var Jke=[0,0],Qke=[0],eUe=[1,1];function B6(e,t,n){if(e.indexOf("Texture")===-1||!l(t.extensions)||!l(t.extensions.KHR_texture_transform))return;let i=`u_${e}`,r=t.extensions.KHR_texture_transform;n[`${i}Offset`]=y(r.offset,Jke),n[`${i}Rotation`]=y(r.rotation,Qke),n[`${i}Scale`]=y(r.scale,eUe),l(t.texCoord)&&l(r.texCoord)&&(n[i].texCoord=r.texCoord)}function tUe(e,t,n,i,r,o){let s=y(o.addBatchIdToGeneratedShaders,!1),a=e.extensions.KHR_techniques_webgl,c=a.techniques,u=a.shaders,f=a.programs,d=Zke(t),p,g,m;if(!d){let Be=t.pbrMetallicRoughness;if(l(Be))for(g in Be)Be.hasOwnProperty(g)&&(m=Be[g],p=`u_${g}`,i[p]=m,B6(g,m,i));else i.u_baseColorFactor=[1,1,1,1]}if(d){let Be=t.extensions.KHR_materials_pbrSpecularGlossiness;for(g in Be)Be.hasOwnProperty(g)&&(m=Be[g],p=`u_${g}`,i[p]=m,B6(g,m,i))}for(let Be in t)t.hasOwnProperty(Be)&&(Be.indexOf("Texture")>=0||Be.indexOf("Factor")>=0)&&(m=t[Be],p=`u_${Be}`,i[p]=m,B6(Be,m,i));let x=`precision highp float;
- `,C=`precision highp float;
- `,A;l(e.skins)&&(A=e.skins[0]);let b=l(A)?A.joints:[],T=b.length,S=r[n],w,D=!1,I=!1,O=!1,B=!1,L=!1,_=!1,E=!1,v=!1,P=!1,R=o.marsOptions||{};l(S)&&(w=S.skinning,D=w.skinned&&b.length>0,I=S.hasVertexColors,O=S.hasMorphTargets,B=S.hasNormals,L=S.hasTangents,_=S.hasTexCoords,E=S.hasTexCoord1,v=S.hasOutline);let F;O&&Ae.mesh(e,function(Be){Ae.meshPrimitive(Be,function(tt){if(tt.material===n){let lt=tt.targets;l(lt)&&(F=lt)}})});let U={u_modelViewMatrix:{semantic:Ur(e,"CESIUM_RTC")?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:Z.FLOAT_MAT4},u_projectionMatrix:{semantic:"PROJECTION",type:Z.FLOAT_MAT4}};l(t.extensions)&&l(t.extensions.KHR_materials_unlit)&&(P=!0),B&&(U.u_normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:Z.FLOAT_MAT3}),D&&(U.u_jointMatrix={count:T,semantic:"JOINTMATRIX",type:Z.FLOAT_MAT4}),O&&(U.u_morphWeights={count:F.length,semantic:"MORPHWEIGHTS",type:Z.FLOAT});let k=t.alphaMode;l(k)&&k==="MASK"&&(U.u_alphaCutoff={semantic:"ALPHACUTOFF",type:Z.FLOAT});for(p in i)i.hasOwnProperty(p)&&(U[p]={type:nUe(p)});let H=y(U.u_baseColorTexture,U.u_baseColorFactor);l(H)&&(H.semantic="_3DTILESDIFFUSE");for(p in U)if(U.hasOwnProperty(p)){let Be=U[p],tt=l(Be.count)?`[${Be.count}]`:"";Be.type!==Z.FLOAT_MAT3&&Be.type!==Z.FLOAT_MAT4&&p!=="u_morphWeights"||Be.useInFragment?(C+=`uniform ${ag(Be.type)} ${p}${tt};
- `,delete Be.useInFragment):x+=`uniform ${ag(Be.type)} ${p}${tt};
- `}v&&(C+=`uniform sampler2D u_outlineTexture;
- `),R.edit&&(C+=`uniform vec4 u_mars_floodVar;
- `,C+=`uniform vec4 u_mars_floodColor;
- `);let V="";D&&(V+=` mat4 skinMatrix =
- a_weight.x * u_jointMatrix[int(a_joint.x)] +
- a_weight.y * u_jointMatrix[int(a_joint.y)] +
- a_weight.z * u_jointMatrix[int(a_joint.z)] +
- a_weight.w * u_jointMatrix[int(a_joint.w)];
- `);let q={a_position:{semantic:"POSITION"}};if(v&&(q.a_outlineCoordinates={semantic:"_OUTLINE_COORDINATES"}),x+=`attribute vec3 a_position;
- `,x+=`varying vec3 v_mars_vertex;
- `,x+=`varying vec3 v_mars_viewPos;
- `,C+=`varying vec3 v_mars_viewPos;
- `,V+=` v_mars_vertex = a_position;
- `,C+=`varying vec3 v_mars_vertex;
- `,x+=`uniform mat4 u_mars_modelInverseMatrix;
- `,C+=`uniform mat4 u_mars_modelInverseMatrix;
- `,x+=`uniform bool u_mars_modelUpZ;
- `,C+=`uniform bool u_mars_modelUpZ;
- `,B&&(x+=`varying vec3 v_positionEC;
- `),v&&(x+=`attribute vec3 a_outlineCoordinates;
- `,x+=`varying vec3 v_outlineCoordinates;
- `),V+=` vec3 weightedPosition = a_position;
- `,V+=` vec3 v_mars_tempaPos = a_position;
- `,R.edit&&(V+=` v_mars_tempaPos = v_mars_tempaPos - u_mars_offset;
- `),x+=`bool isPointInBound(vec2 point, vec4 bounds)
- {
- return (point.x>bounds.x&&point.x<bounds.z&&point.y<bounds.w&&point.y>bounds.y);
- }
- float unpackDepth(const in vec4 rgba_depth)
- {
- const vec4 bitShifts = vec4(1.0, 1.0 / 255.0, 1.0 / (255.0 * 255.0), 1.0 / (255.0 * 255.0 * 255.0));
- float depth=dot(rgba_depth, bitShifts);
- return depth;
- }
- `,B&&(V+=` vec3 weightedNormal = a_normal;
- `),L&&(V+=` vec4 weightedTangent = a_tangent;
- `),O)for(let Be=0;Be<F.length;Be++){let tt=F[Be];for(let lt in tt)if(tt.hasOwnProperty(lt)&<!=="extras"){let Pt=`a_${lt}_${Be}`;q[Pt]={semantic:`${lt}_${Be}`},x+=`attribute vec3 ${Pt};
- `,lt==="POSITION"?V+=` weightedPosition += u_morphWeights[${Be}] * ${Pt};
- `:lt==="NORMAL"?V+=` weightedNormal += u_morphWeights[${Be}] * ${Pt};
- `:L&<==="TANGENT"&&(V+=` weightedTangent.xyz += u_morphWeights[${Be}] * ${Pt};
- `)}}D?V+=` vec4 position = skinMatrix * vec4(weightedPosition, 1.0);
- `:V+=` vec4 position = vec4(weightedPosition, 1.0);
- `,V+=` position = u_modelViewMatrix * position;
- `,V+=` v_mars_viewPos = position.xyz;
- `,R.edit&&(V+="if (!u_mars_modelUpZ) {v_mars_tempaPos = vec3(v_mars_tempaPos.x, -v_mars_tempaPos.z, v_mars_tempaPos.y);}",V+=` v_mars_tempaPos = (u_mars_modelInverseMatrix * czm_inverseView * position).xyz;
- `),B&&(V+=` v_positionEC = position.xyz;
- `),V+=` gl_Position = u_projectionMatrix * position;
- `,v&&(V+=` v_outlineCoordinates = a_outlineCoordinates;
- `),R.edit&&(C+=`varying float v_mars_isFlat;
- `,C+=`uniform bvec4 u_mars_IsYaPing;
- `,C+=`uniform bvec4 u_mars_editVar;
- `),B&&(q.a_normal={semantic:"NORMAL"},x+=`attribute vec3 a_normal;
- `,P||(x+=`varying vec3 v_normal;
- `,D?V+=` v_normal = u_normalMatrix * mat3(skinMatrix) * weightedNormal;
- `:V+=` v_normal = u_normalMatrix * weightedNormal;
- `,C+=`varying vec3 v_normal;
- `),C+=`varying vec3 v_positionEC;
- `),L&&(q.a_tangent={semantic:"TANGENT"},x+=`attribute vec4 a_tangent;
- `,x+=`varying vec4 v_tangent;
- `,V+=` v_tangent.xyz = u_normalMatrix * weightedTangent.xyz;
- `,V+=` v_tangent.w = weightedTangent.w;
- `,C+=`varying vec4 v_tangent;
- `),v&&(C+=`varying vec3 v_outlineCoordinates;
- `);let j="",X,G,$,J,ce,de,ie,ae;if(_){if(q.a_texcoord_0={semantic:"TEXCOORD_0"},X="v_texcoord_0",x+=`attribute vec2 a_texcoord_0;
- `,x+=`varying vec2 ${X};
- `,V+=` ${X} = a_texcoord_0;
- `,C+=`varying vec2 ${X};
- `,E){q.a_texcoord_1={semantic:"TEXCOORD_1"};let tt=X.replace("0","1");x+=`attribute vec2 a_texcoord_1;
- `,x+=`varying vec2 ${tt};
- `,V+=` ${tt} = a_texcoord_1;
- `,C+=`varying vec2 ${tt};
- `}let Be={fragmentShaderMain:j};G=sx(e,"u_normalTexture",i,X,Be),$=sx(e,"u_baseColorTexture",i,X,Be),J=sx(e,"u_specularGlossinessTexture",i,X,Be),ce=sx(e,"u_diffuseTexture",i,X,Be),de=sx(e,"u_metallicRoughnessTexture",i,X,Be),ie=sx(e,"u_occlusionTexture",i,X,Be),ae=sx(e,"u_emissiveTexture",i,X,Be),j=Be.fragmentShaderMain}D&&(q.a_joint={semantic:"JOINTS_0"},q.a_weight={semantic:"WEIGHTS_0"},x+=`attribute vec4 a_joint;
- `,x+=`attribute vec4 a_weight;
- `),I&&(q.a_vertexColor={semantic:"COLOR_0"},x+=`attribute vec4 a_vertexColor;
- `,x+=`varying vec4 v_vertexColor;
- `,V+=` v_vertexColor = a_vertexColor;
- `,C+=`varying vec4 v_vertexColor;
- `),s&&(q.a_batchId={semantic:"_BATCHID"},x+=`attribute float a_batchId;
- `),R.edit&&(x+=`uniform bvec4 u_mars_IsYaPing;
- `,x+=`uniform bvec4 u_mars_editVar;
- `,x+=`uniform vec3 u_mars_offset;
- `,x+=`uniform sampler2D u_mars_polygonTexture;
- `,x+=`uniform vec4 u_mars_polygonBounds;
- `,x+=`uniform vec2 u_mars_heightVar;
- `,x+=`varying float v_mars_isFlat;
- `),x+=`void main(void)
- {
- `,R.edit&&(V+=`if(u_mars_IsYaPing[0]){
- `,V+=` vec2 texCoord;
- `,V+=` texCoord.x = (v_mars_tempaPos.x-u_mars_polygonBounds.x)/(u_mars_polygonBounds.z-u_mars_polygonBounds.x);
- `,V+=` texCoord.y = (v_mars_tempaPos.y-u_mars_polygonBounds.y)/(u_mars_polygonBounds.w-u_mars_polygonBounds.y);
- `,V+=` vec4 flatTColor = texture2D(u_mars_polygonTexture, texCoord.xy);
- `,V+=`if ((texCoord.x>=0.0 && texCoord.x<=1.0 && texCoord.y>=0.0 && texCoord.y<=1.0) && (flatTColor.r>=0.5 && flatTColor.a>=0.5)){
- `,V+=` v_mars_isFlat = 1.0;
- `,V+=` if(u_mars_IsYaPing[2]||u_mars_IsYaPing[3]){return;}
- `,V+=` if(u_mars_IsYaPing[1]){
- `,V+=` if(!u_mars_modelUpZ){weightedPosition.y = u_mars_heightVar[0] + u_mars_heightVar[1];}else{weightedPosition.z = u_mars_heightVar[0] + u_mars_heightVar[1];}
- `,V+=` gl_Position = u_projectionMatrix * u_modelViewMatrix * vec4(weightedPosition,1.0);
- `,V+=` }else {v_mars_isFlat = -1.0;}
- `,V+=`}else{v_mars_isFlat = -1.0;}
- `,V+=`};
- `),x+=V,x+=`}
- `,B&&!P&&(C+=`const float M_PI = 3.141592653589793;
- `,C+=`vec3 lambertianDiffuse(vec3 diffuseColor)
- {
- return diffuseColor / M_PI;
- }
- `,C+=`vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH)
- {
- return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0);
- }
- `,C+=`vec3 fresnelSchlick(float metalness, float VdotH)
- {
- return metalness + (vec3(1.0) - metalness) * pow(1.0 - VdotH, 5.0);
- }
- `,C+=`float smithVisibilityG1(float NdotV, float roughness)
- {
- float k = (roughness + 1.0) * (roughness + 1.0) / 8.0;
- return NdotV / (NdotV * (1.0 - k) + k);
- }
- `,C+=`float smithVisibilityGGX(float roughness, float NdotL, float NdotV)
- {
- return smithVisibilityG1(NdotL, roughness) * smithVisibilityG1(NdotV, roughness);
- }
- `,C+=`float GGX(float roughness, float NdotH)
- {
- float roughnessSquared = roughness * roughness;
- float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;
- return roughnessSquared / (M_PI * f * f);
- }
- `),C+=`vec3 SRGBtoLINEAR3(vec3 srgbIn)
- {
- return pow(srgbIn, vec3(2.2));
- }
- `,C+=`vec4 SRGBtoLINEAR4(vec4 srgbIn)
- {
- vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));
- return vec4(linearOut, srgbIn.a);
- }
- `,C+=`vec3 applyTonemapping(vec3 linearIn)
- {
- #ifndef HDR
- return czm_acesTonemapping(linearIn);
- #else
- return linearIn;
- #endif
- }
- `,C+=`vec3 LINEARtoSRGB(vec3 linearIn)
- {
- #ifndef HDR
- return pow(linearIn, vec3(1.0/2.2));
- #else
- return linearIn;
- #endif
- }
- `,C+=`vec2 computeTexCoord(vec2 texCoords, vec2 offset, float rotation, vec2 scale)
- {
- rotation = -rotation;
- mat3 transform = mat3(
- cos(rotation) * scale.x, sin(rotation) * scale.x, 0.0,
- -sin(rotation) * scale.y, cos(rotation) * scale.y, 0.0,
- offset.x, offset.y, 1.0);
- vec2 transformedTexCoords = (transform * vec3(fract(texCoords), 1.0)).xy;
- return transformedTexCoords;
- }
- `,C+=`#ifdef USE_IBL_LIGHTING
- `,C+=`uniform vec2 gltf_iblFactor;
- `,C+=`#endif
- `,C+=`#ifdef USE_CUSTOM_LIGHT_COLOR
- `,C+=`uniform vec3 gltf_lightColor;
- `,C+=`#endif
- `,C+=`void main(void)
- {
- `,C+=j,B&&!P&&(C+=` vec3 ng = normalize(v_normal);
- `,C+=` vec3 positionWC = vec3(czm_inverseView * vec4(v_positionEC, 1.0));
- `,l(i.u_normalTexture)?L?(C+=` vec3 t = normalize(v_tangent.xyz);
- `,C+=` vec3 b = normalize(cross(ng, t) * v_tangent.w);
- `,C+=` mat3 tbn = mat3(t, b, ng);
- `,C+=` vec3 n = texture2D(u_normalTexture, ${G}).rgb;
- `,C+=` n = normalize(tbn * (2.0 * n - 1.0));
- `):(C=`#ifdef GL_OES_standard_derivatives
- #extension GL_OES_standard_derivatives : enable
- #endif
- ${C}`,C+=`#ifdef GL_OES_standard_derivatives
- `,C+=` vec3 pos_dx = dFdx(v_positionEC);
- `,C+=` vec3 pos_dy = dFdy(v_positionEC);
- `,C+=` vec3 tex_dx = dFdx(vec3(${G},0.0));
- `,C+=` vec3 tex_dy = dFdy(vec3(${G},0.0));
- `,C+=` vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);
- `,C+=` t = normalize(t - ng * dot(ng, t));
- `,C+=` vec3 b = normalize(cross(ng, t));
- `,C+=` mat3 tbn = mat3(t, b, ng);
- `,C+=` vec3 n = texture2D(u_normalTexture, ${G}).rgb;
- `,C+=` n = normalize(tbn * (2.0 * n - 1.0));
- `,C+=`#else
- `,C+=` vec3 n = ng;
- `,C+=`#endif
- `):C+=` vec3 n = ng;
- `,t.doubleSided&&(C+=` if (czm_backFacing())
- `,C+=` {
- `,C+=` n = -n;
- `,C+=` }
- `)),l(i.u_baseColorTexture)?(C+=` vec4 baseColorWithAlpha = SRGBtoLINEAR4(texture2D(u_baseColorTexture, ${$}));
- `,R.edit&&(C+="if(u_mars_IsYaPing[0]&&u_mars_IsYaPing[2]){ if(!u_mars_editVar[0]&&v_mars_isFlat>0.0){ discard; } if(u_mars_editVar[0]&&v_mars_isFlat<0.0){ discard; }}"),l(i.u_baseColorFactor)&&(C+=` baseColorWithAlpha *= u_baseColorFactor;
- `)):l(i.u_baseColorFactor)?C+=` vec4 baseColorWithAlpha = u_baseColorFactor;
- `:C+=` vec4 baseColorWithAlpha = vec4(1.0);
- `,I&&(C+=` baseColorWithAlpha *= v_vertexColor;
- `),C+=` vec3 baseColor = baseColorWithAlpha.rgb;
- `,B&&!P?(d?(l(i.u_specularGlossinessTexture)?(C+=` vec4 specularGlossiness = SRGBtoLINEAR4(texture2D(u_specularGlossinessTexture, ${J}));
- `,C+=` vec3 specular = specularGlossiness.rgb;
- `,C+=` float glossiness = specularGlossiness.a;
- `,l(i.u_specularFactor)&&(C+=` specular *= u_specularFactor;
- `),l(i.u_glossinessFactor)&&(C+=` glossiness *= u_glossinessFactor;
- `)):(l(i.u_specularFactor)?C+=` vec3 specular = clamp(u_specularFactor, vec3(0.0), vec3(1.0));
- `:C+=` vec3 specular = vec3(1.0);
- `,l(i.u_glossinessFactor)?C+=` float glossiness = clamp(u_glossinessFactor, 0.0, 1.0);
- `:C+=` float glossiness = 1.0;
- `),l(i.u_diffuseTexture)?(C+=` vec4 diffuse = SRGBtoLINEAR4(texture2D(u_diffuseTexture, ${ce}));
- `,l(i.u_diffuseFactor)&&(C+=` diffuse *= u_diffuseFactor;
- `)):l(i.u_diffuseFactor)?C+=` vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0));
- `:C+=` vec4 diffuse = vec4(1.0);
- `,C+=` baseColorWithAlpha.a = diffuse.a;
- `):l(i.u_metallicRoughnessTexture)?(C+=` vec3 metallicRoughness = texture2D(u_metallicRoughnessTexture, ${de}).rgb;
- `,C+=` float metalness = clamp(metallicRoughness.b, 0.0, 1.0);
- `,C+=` float roughness = clamp(metallicRoughness.g, 0.04, 1.0);
- `,l(i.u_metallicFactor)&&(C+=` metalness *= u_metallicFactor;
- `),l(i.u_roughnessFactor)&&(C+=` roughness *= u_roughnessFactor;
- `)):(l(i.u_metallicFactor)?C+=` float metalness = clamp(u_metallicFactor, 0.0, 1.0);
- `:C+=` float metalness = 1.0;
- `,l(i.u_roughnessFactor)?C+=` float roughness = clamp(u_roughnessFactor, 0.04, 1.0);
- `:C+=` float roughness = 1.0;
- `),C+=` vec3 v = -normalize(v_positionEC);
- `,C+=`#ifndef USE_CUSTOM_LIGHT_COLOR
- `,C+=` vec3 lightColorHdr = czm_lightColorHdr;
- `,C+=`#else
- `,C+=` vec3 lightColorHdr = gltf_lightColor;
- `,C+=`#endif
- `,C+=` vec3 l = normalize(czm_lightDirectionEC);
- `,C+=` vec3 h = normalize(v + l);
- `,C+=` float NdotL = clamp(dot(n, l), 0.001, 1.0);
- `,C+=` float NdotV = abs(dot(n, v)) + 0.001;
- `,C+=` float NdotH = clamp(dot(n, h), 0.0, 1.0);
- `,C+=` float LdotH = clamp(dot(l, h), 0.0, 1.0);
- `,C+=` float VdotH = clamp(dot(v, h), 0.0, 1.0);
- `,C+=` vec3 f0 = vec3(0.04);
- `,d?(C+=` float roughness = 1.0 - glossiness;
- `,C+=` vec3 diffuseColor = diffuse.rgb * (1.0 - max(max(specular.r, specular.g), specular.b));
- `,C+=` vec3 specularColor = specular;
- `):(C+=` vec3 diffuseColor = baseColor * (1.0 - metalness) * (1.0 - f0);
- `,C+=` vec3 specularColor = mix(f0, baseColor, metalness);
- `),C+=` float alpha = roughness * roughness;
- `,C+=` float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);
- `,C+=` vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));
- `,C+=` vec3 r0 = specularColor.rgb;
- `,C+=` vec3 F = fresnelSchlick2(r0, r90, VdotH);
- `,C+=` float G = smithVisibilityGGX(alpha, NdotL, NdotV);
- `,C+=` float D = GGX(alpha, NdotH);
- `,C+=` vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);
- `,C+=` vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV);
- `,C+=` vec3 color = NdotL * lightColorHdr * (diffuseContribution + specularContribution);
- `,C+=`#if defined(USE_IBL_LIGHTING) && !defined(DIFFUSE_IBL) && !defined(SPECULAR_IBL)
- `,C+=` vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n)));
- `,C+=` float vertexRadius = length(positionWC);
- `,C+=` float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius);
- `,C+=` float reflectionDotNadir = dot(r, normalize(positionWC));
- `,C+=` r.x = -r.x;
- `,C+=` r = -normalize(czm_temeToPseudoFixed * r);
- `,C+=` r.x = -r.x;
- `,C+=` float inverseRoughness = 1.04 - roughness;
- `,C+=` inverseRoughness *= inverseRoughness;
- `,C+=` vec3 sceneSkyBox = textureCube(czm_environmentMap, r).rgb * inverseRoughness;
- `,C+=` float atmosphereHeight = 0.05;
- `,C+=` float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);
- `,C+=` float blendRegionOffset = roughness * -1.0;
- `,C+=` float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);
- `,C+=` float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);
- `,C+=` float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);
- `,C+=` float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);
- `,C+=` vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight);
- `,C+=` vec3 nadirColor = belowHorizonColor * 0.5;
- `,C+=` vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5);
- `,C+=` vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75);
- `,C+=` vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight);
- `,C+=` vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9);
- `,C+=` float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight;
- `,C+=` float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25));
- `,C+=` vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);
- `,C+=` float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8);
- `,C+=` vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough);
- `,C+=` specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness);
- `,C+=` specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness);
- `,C+=`#ifdef USE_SUN_LUMINANCE
- `,C+=` float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), normalize(positionWC * -1.0)), 0.001, 1.0);
- `,C+=` float S = acos(LdotZenith);
- `,C+=` float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), normalize(positionWC * -1.0)), 0.001, 1.0);
- `,C+=` float gamma = acos(NdotL);
- `,C+=` float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith)));
- `,C+=` float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32));
- `,C+=` float luminance = gltf_luminanceAtZenith * (numerator / denominator);
- `,C+=`#endif
- `,C+=` vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;
- `,C+=` vec3 IBLColor = (diffuseIrradiance * diffuseColor * gltf_iblFactor.x) + (specularIrradiance * SRGBtoLINEAR3(specularColor * brdfLut.x + brdfLut.y) * gltf_iblFactor.y);
- `,C+=` float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z);
- `,C+=` vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0);
- `,C+=` IBLColor *= lightColor;
- `,C+=`#ifdef USE_SUN_LUMINANCE
- `,C+=` color += IBLColor * luminance;
- `,C+=`#else
- `,C+=` color += IBLColor;
- `,C+=`#endif
- `,C+=`#elif defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)
- `,C+=` const mat3 yUpToZUp = mat3(-1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0);
- `,C+=` vec3 cubeDir = normalize(yUpToZUp * gltf_iblReferenceFrameMatrix * normalize(reflect(-v, n)));
- `,C+=`#ifdef DIFFUSE_IBL
- `,C+=`#ifdef CUSTOM_SPHERICAL_HARMONICS
- `,C+=` vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, gltf_sphericalHarmonicCoefficients);
- `,C+=`#else
- `,C+=` vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients);
- `,C+=`#endif
- `,C+=`#else
- `,C+=` vec3 diffuseIrradiance = vec3(0.0);
- `,C+=`#endif
- `,C+=`#ifdef SPECULAR_IBL
- `,C+=` vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;
- `,C+=`#ifdef CUSTOM_SPECULAR_IBL
- `,C+=` vec3 specularIBL = czm_sampleOctahedralProjection(gltf_specularMap, gltf_specularMapSize, cubeDir, roughness * gltf_maxSpecularLOD, gltf_maxSpecularLOD);
- `,C+=`#else
- `,C+=` vec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD);
- `,C+=`#endif
- `,C+=` specularIBL *= F * brdfLut.x + brdfLut.y;
- `,C+=`#else
- `,C+=` vec3 specularIBL = vec3(0.0);
- `,C+=`#endif
- `,C+=` color += diffuseIrradiance * diffuseColor + specularColor * specularIBL;
- `,C+=`#endif
- `):C+=` vec3 color = baseColor;
- `,P||(l(i.u_occlusionTexture)&&y(R.occlusion,!0)&&(C+=` color *= texture2D(u_occlusionTexture, ${ie}).r;
- `),l(i.u_emissiveTexture)?(C+=` vec3 emissive = SRGBtoLINEAR3(texture2D(u_emissiveTexture, ${ae}).rgb);
- `,l(i.u_emissiveFactor)&&(C+=` emissive *= u_emissiveFactor;
- `),C+=` color += emissive;
- `):l(i.u_emissiveFactor)&&(C+=` color += u_emissiveFactor;
- `)),P||(C+=` color = applyTonemapping(color);
- `),C+=` color = LINEARtoSRGB(color);
- `,v&&(C+=` float outlineness = max(
- `,C+=` texture2D(u_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r,
- `,C+=` max(
- `,C+=` texture2D(u_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r,
- `,C+=` texture2D(u_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r));
- `,C+=` color = mix(color, vec3(0.0, 0.0, 0.0), outlineness);
- `),l(k)?k==="MASK"?(C+=` if (baseColorWithAlpha.a < u_alphaCutoff) {
- `,C+=` discard;
- `,C+=` }
- `,C+=` gl_FragColor = vec4(color, 1.0);
- `):k==="BLEND"?C+=` gl_FragColor = vec4(color, baseColorWithAlpha.a);
- `:C+=` gl_FragColor = vec4(color, 1.0);
- `:C+=` gl_FragColor = vec4(color, 1.0);
- `,R.edit&&(C+=`if(u_mars_IsYaPing[3]){
- `,C+=` float posHeight = v_mars_vertex.z;
- `,C+=` if(!u_mars_modelUpZ){posHeight = (u_mars_modelInverseMatrix * czm_inverseView * vec4(v_mars_viewPos,1.0)).z;}
- `,C+=` if(posHeight<u_mars_floodVar[1]&&posHeight>=u_mars_floodVar[0]){
- `,C+=` if(u_mars_editVar[1]){gl_FragColor.xyz = mix(gl_FragColor.xyz,u_mars_floodColor.rgb,u_mars_floodColor.a);return;}
- `,C+=` if(v_mars_isFlat<0.0){return;}
- `,C+=` float r;
- `,C+=` float g;
- `,C+=` float b = 0.0;
- `,C+=` if(length(u_mars_floodColor.rgb)>0.01){
- `,C+=` r = u_mars_floodColor.r;
- `,C+=` g = u_mars_floodColor.g;
- `,C+=` b = u_mars_floodColor.b;
- `,C+=` }else{
- `,C+=` g = (posHeight - u_mars_floodVar[0])/u_mars_floodVar[3];
- `,C+=` r = 1.0 - g;
- `,C+=` }
- `,C+=` gl_FragColor.xyz = mix(gl_FragColor.xyz,vec3(r,g,b),u_mars_floodColor.a);
- `,C+=` }
- `,C+=`}
- `),R.updatePbrFsByJzw&&(C+=R.updatePbrFsByJzw(o)||""),C+=`}
- `;let _e=fr(u,{type:Z.VERTEX_SHADER,extras:{_pipeline:{source:x,extension:".glsl"}}}),be=fr(u,{type:Z.FRAGMENT_SHADER,extras:{_pipeline:{source:C,extension:".glsl"}}}),Te=fr(f,{fragmentShader:be,vertexShader:_e});return fr(c,{attributes:q,program:Te,uniforms:U})}function nUe(e){if(e.indexOf("Offset")!==-1)return Z.FLOAT_VEC2;if(e.indexOf("Rotation")!==-1)return Z.FLOAT;if(e.indexOf("Scale")!==-1)return Z.FLOAT_VEC2;if(e.indexOf("Texture")!==-1)return Z.SAMPLER_2D;switch(e){case"u_baseColorFactor":return Z.FLOAT_VEC4;case"u_metallicFactor":return Z.FLOAT;case"u_roughnessFactor":return Z.FLOAT;case"u_emissiveFactor":return Z.FLOAT_VEC3;case"u_diffuseFactor":return Z.FLOAT_VEC4;case"u_specularFactor":return Z.FLOAT_VEC3;case"u_glossinessFactor":return Z.FLOAT}}var $T=$ke;function iUe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var rf=iUe;var jw=`attribute vec3 position;
- attribute float a_batchId;
- uniform mat4 u_modifiedModelViewProjection;
- void main()
- {
- gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0));
- }
- `;var ax=Ns(Coe(),1);var rUe={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},ft=Object.freeze(rUe);function ld(e,t){this._expression=e,e=gUe(e,t),e=xUe(yUe(e)),ax.default.addBinaryOp("=~",0),ax.default.addBinaryOp("!~",0);let n;try{n=(0,ax.default)(e)}catch(i){throw new fe(i)}this._runtimeAst=xi(this,n)}Object.defineProperties(ld.prototype,{expression:{get:function(){return this._expression}}});var Sn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new W],cartesian3Array:[new h],cartesian4Array:[new se],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new W),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new h),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new se),this.cartesian4Array[this.cartesian4Index++]}};ld.prototype.evaluate=function(e,t){Sn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof z&&n instanceof se?z.fromCartesian4(n,t):n instanceof W||n instanceof h||n instanceof se?n.clone(t):n};ld.prototype.evaluateColor=function(e,t){Sn.reset();let n=this._runtimeAst.evaluate(e);return z.fromCartesian4(n,t)};ld.prototype.getShaderFunction=function(e,t,n,i){let r=this.getShaderExpression(t,n);return r=`${i} ${e}
- {
- return ${r};
- }
- `,r};ld.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};ld.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var oUe=["!","-","+"],Aoe=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],iN=/\${(.*?)}/g,sUe=/\\/g,aUe="@#%",cUe=/@#%/g,rN=new z,oN={abs:ws(Math.abs),sqrt:ws(Math.sqrt),cos:ws(Math.cos),sin:ws(Math.sin),tan:ws(Math.tan),acos:ws(Math.acos),asin:ws(Math.asin),atan:ws(Math.atan),radians:ws(M.toRadians),degrees:ws(M.toDegrees),sign:ws(M.sign),floor:ws(Math.floor),ceil:ws(Math.ceil),round:ws(Math.round),exp:ws(Math.exp),exp2:ws(uUe),log:ws(Math.log),log2:ws(fUe),fract:ws(lUe),length:dUe,normalize:hUe},sN={atan2:tN(Math.atan2,!1),pow:tN(Math.pow,!1),min:tN(Math.min,!0),max:tN(Math.max,!0),distance:mUe,dot:pUe,cross:_Ue},F6={clamp:Toe(M.clamp,!0),mix:Toe(M.lerp,!0)};function lUe(e){return e-Math.floor(e)}function uUe(e){return Math.pow(2,e)}function fUe(e){return M.log2(e)}function ws(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof W)return W.fromElements(e(n.x),e(n.y),Sn.getCartesian2());if(n instanceof h)return h.fromElements(e(n.x),e(n.y),e(n.z),Sn.getCartesian3());if(n instanceof se)return se.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Sn.getCartesian4());throw new fe(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function tN(e,t){return function(n,i,r){if(t&&typeof r=="number"){if(typeof i=="number")return e(i,r);if(i instanceof W)return W.fromElements(e(i.x,r),e(i.y,r),Sn.getCartesian2());if(i instanceof h)return h.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),Sn.getCartesian3());if(i instanceof se)return se.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),e(i.w,r),Sn.getCartesian4())}if(typeof i=="number"&&typeof r=="number")return e(i,r);if(i instanceof W&&r instanceof W)return W.fromElements(e(i.x,r.x),e(i.y,r.y),Sn.getCartesian2());if(i instanceof h&&r instanceof h)return h.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),Sn.getCartesian3());if(i instanceof se&&r instanceof se)return se.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),e(i.w,r.w),Sn.getCartesian4());throw new fe(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${r}.`)}}function Toe(e,t){return function(n,i,r,o){if(t&&typeof o=="number"){if(typeof i=="number"&&typeof r=="number")return e(i,r,o);if(i instanceof W&&r instanceof W)return W.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),Sn.getCartesian2());if(i instanceof h&&r instanceof h)return h.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),Sn.getCartesian3());if(i instanceof se&&r instanceof se)return se.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),e(i.w,r.w,o),Sn.getCartesian4())}if(typeof i=="number"&&typeof r=="number"&&typeof o=="number")return e(i,r,o);if(i instanceof W&&r instanceof W&&o instanceof W)return W.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),Sn.getCartesian2());if(i instanceof h&&r instanceof h&&o instanceof h)return h.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),Sn.getCartesian3());if(i instanceof se&&r instanceof se&&o instanceof se)return se.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),e(i.w,r.w,o.w),Sn.getCartesian4());throw new fe(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${r}, and ${o}.`)}}function dUe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof W)return W.magnitude(t);if(t instanceof h)return h.magnitude(t);if(t instanceof se)return se.magnitude(t);throw new fe(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function hUe(e,t){if(typeof t=="number")return 1;if(t instanceof W)return W.normalize(t,Sn.getCartesian2());if(t instanceof h)return h.normalize(t,Sn.getCartesian3());if(t instanceof se)return se.normalize(t,Sn.getCartesian4());throw new fe(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function mUe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof W&&n instanceof W)return W.distance(t,n);if(t instanceof h&&n instanceof h)return h.distance(t,n);if(t instanceof se&&n instanceof se)return se.distance(t,n);throw new fe(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function pUe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof W&&n instanceof W)return W.dot(t,n);if(t instanceof h&&n instanceof h)return h.dot(t,n);if(t instanceof se&&n instanceof se)return se.dot(t,n);throw new fe(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function _Ue(e,t,n){if(t instanceof h&&n instanceof h)return h.cross(t,n,Sn.getCartesian3());throw new fe(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function mt(e,t,n,i,r){this._type=e,this._value=t,this._left=n,this._right=i,this._test=r,this.evaluate=void 0,PUe(this)}function gUe(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),r=`(${t[n]})`;l(r)&&(e=e.replace(i,r))}return e}function yUe(e){return e.replace(sUe,aUe)}function N6(e){return e.replace(cUe,"\\")}function xUe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let r=t.indexOf("'"),o=t.indexOf('"'),s;if(r>=0&&r<i)s=t.indexOf("'",r+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else if(o>=0&&o<i)s=t.indexOf('"',o+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new fe("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function CUe(e){let t=typeof e.value;if(e.value===null)return new mt(ft.LITERAL_NULL,null);if(t==="boolean")return new mt(ft.LITERAL_BOOLEAN,e.value);if(t==="number")return new mt(ft.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new mt(ft.VARIABLE_IN_STRING,e.value):new mt(ft.LITERAL_STRING,N6(e.value))}function AUe(e,t){let n=t.arguments,i=n.length,r,o,s,a;if(t.callee.type==="MemberExpression"){r=t.callee.property.name;let c=t.callee.object;if(r==="test"||r==="exec"){if(c.callee.name!=="regExp")throw new fe(`${r} is not a function.`);return i===0?r==="test"?new mt(ft.LITERAL_BOOLEAN,!1):new mt(ft.LITERAL_NULL,null):(s=xi(e,c),a=xi(e,n[0]),new mt(ft.FUNCTION_CALL,r,s,a))}else if(r==="toString")return o=xi(e,c),new mt(ft.FUNCTION_CALL,r,o);throw new fe(`Unexpected function call "${r}".`)}if(r=t.callee.name,r==="color"){if(i===0)return new mt(ft.LITERAL_COLOR,r);if(o=xi(e,n[0]),l(n[1])){let c=xi(e,n[1]);return new mt(ft.LITERAL_COLOR,r,[o,c])}return new mt(ft.LITERAL_COLOR,r,[o])}else if(r==="rgb"||r==="hsl"){if(i<3)throw new fe(`${r} requires three arguments.`);return o=[xi(e,n[0]),xi(e,n[1]),xi(e,n[2])],new mt(ft.LITERAL_COLOR,r,o)}else if(r==="rgba"||r==="hsla"){if(i<4)throw new fe(`${r} requires four arguments.`);return o=[xi(e,n[0]),xi(e,n[1]),xi(e,n[2]),xi(e,n[3])],new mt(ft.LITERAL_COLOR,r,o)}else if(r==="vec2"||r==="vec3"||r==="vec4"){o=new Array(i);for(let c=0;c<i;++c)o[c]=xi(e,n[c]);return new mt(ft.LITERAL_VECTOR,r,o)}else{if(r==="isNaN"||r==="isFinite")return i===0?r==="isNaN"?new mt(ft.LITERAL_BOOLEAN,!0):new mt(ft.LITERAL_BOOLEAN,!1):(o=xi(e,n[0]),new mt(ft.UNARY,r,o));if(r==="isExactClass"||r==="isClass"){if(i<1||i>1)throw new fe(`${r} requires exactly one argument.`);return o=xi(e,n[0]),new mt(ft.UNARY,r,o)}else if(r==="getExactClassName"){if(i>0)throw new fe(`${r} does not take any argument.`);return new mt(ft.UNARY,r)}else if(l(oN[r])){if(i!==1)throw new fe(`${r} requires exactly one argument.`);return o=xi(e,n[0]),new mt(ft.UNARY,r,o)}else if(l(sN[r])){if(i!==2)throw new fe(`${r} requires exactly two arguments.`);return s=xi(e,n[0]),a=xi(e,n[1]),new mt(ft.BINARY,r,s,a)}else if(l(F6[r])){if(i!==3)throw new fe(`${r} requires exactly three arguments.`);s=xi(e,n[0]),a=xi(e,n[1]);let c=xi(e,n[2]);return new mt(ft.TERNARY,r,s,a,c)}else{if(r==="Boolean")return i===0?new mt(ft.LITERAL_BOOLEAN,!1):(o=xi(e,n[0]),new mt(ft.UNARY,r,o));if(r==="Number")return i===0?new mt(ft.LITERAL_NUMBER,0):(o=xi(e,n[0]),new mt(ft.UNARY,r,o));if(r==="String")return i===0?new mt(ft.LITERAL_STRING,""):(o=xi(e,n[0]),new mt(ft.UNARY,r,o));if(r==="regExp")return TUe(e,t)}}throw new fe(`Unexpected function call "${r}".`)}function TUe(e,t){let n=t.arguments;if(n.length===0)return new mt(ft.LITERAL_REGEX,new RegExp);let i=xi(e,n[0]),r;if(n.length>1){let o=xi(e,n[1]);if(L6(i)&&L6(o)){try{r=new RegExp(N6(String(i._value)),o._value)}catch(s){throw new fe(s)}return new mt(ft.LITERAL_REGEX,r)}return new mt(ft.REGEX,i,o)}if(L6(i)){try{r=new RegExp(N6(String(i._value)))}catch(o){throw new fe(o)}return new mt(ft.LITERAL_REGEX,r)}return new mt(ft.REGEX,i)}function bUe(e){if(vUe(e.name)){let t=DUe(e.name);return t.substr(0,8)==="tiles3d_"?new mt(ft.BUILTIN_VARIABLE,t):new mt(ft.VARIABLE,t)}else{if(e.name==="NaN")return new mt(ft.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new mt(ft.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new mt(ft.LITERAL_UNDEFINED,void 0)}throw new fe(`${e.name} is not defined.`)}function EUe(e){let t=e.property.name;if(t==="PI")return new mt(ft.LITERAL_NUMBER,Math.PI);if(t==="E")return new mt(ft.LITERAL_NUMBER,Math.E)}function SUe(e){if(e.property.name==="POSITIVE_INFINITY")return new mt(ft.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function wUe(e,t){if(t.object.name==="Math")return EUe(t);if(t.object.name==="Number")return SUe(t);let n,i=xi(e,t.object);return t.computed?(n=xi(e,t.property),new mt(ft.MEMBER,"brackets",i,n)):(n=new mt(ft.LITERAL_STRING,t.property.name),new mt(ft.MEMBER,"dot",i,n))}function L6(e){return e._type>=ft.LITERAL_NULL}function vUe(e){return e.substr(0,4)==="czm_"}function DUe(e){return e.substr(4)}function xi(e,t){let n,i,r,o;if(t.type==="Literal")n=CUe(t);else if(t.type==="CallExpression")n=AUe(e,t);else if(t.type==="Identifier")n=bUe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=xi(e,t.argument);if(oUe.indexOf(i)>-1)n=new mt(ft.UNARY,i,s);else throw new fe(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,r=xi(e,t.left),o=xi(e,t.right),Aoe.indexOf(i)>-1)n=new mt(ft.BINARY,i,r,o);else throw new fe(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,r=xi(e,t.left),o=xi(e,t.right),Aoe.indexOf(i)>-1&&(n=new mt(ft.BINARY,i,r,o));else if(t.type==="ConditionalExpression"){let s=xi(e,t.test);r=xi(e,t.consequent),o=xi(e,t.alternate),n=new mt(ft.CONDITIONAL,"?",r,o,s)}else if(t.type==="MemberExpression")n=wUe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=xi(e,t.elements[a]);n=new mt(ft.ARRAY,s)}else throw t.type==="Compound"?new fe("Provide exactly one expression."):new fe("Cannot parse expression.");return n}function PUe(e){e._type===ft.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===ft.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===ft.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:l(oN[e._value])&&(e.evaluate=OUe(e._value)):e._type===ft.BINARY?e._value==="+"?e.evaluate=e._evaluatePlus:e._value==="-"?e.evaluate=e._evaluateMinus:e._value==="*"?e.evaluate=e._evaluateTimes:e._value==="/"?e.evaluate=e._evaluateDivide:e._value==="%"?e.evaluate=e._evaluateMod:e._value==="==="?e.evaluate=e._evaluateEqualsStrict:e._value==="!=="?e.evaluate=e._evaluateNotEqualsStrict:e._value==="<"?e.evaluate=e._evaluateLessThan:e._value==="<="?e.evaluate=e._evaluateLessThanOrEquals:e._value===">"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(sN[e._value])&&(e.evaluate=RUe(e._value)):e._type===ft.TERNARY?e.evaluate=MUe(e._value):e._type===ft.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===ft.ARRAY?e.evaluate=e._evaluateArray:e._type===ft.VARIABLE?e.evaluate=e._evaluateVariable:e._type===ft.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===ft.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===ft.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===ft.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===ft.REGEX?e.evaluate=e._evaluateRegExp:e._type===ft.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=IUe):e.evaluate=e._evaluateLiteral}function IUe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function OUe(e){let t=oN[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function RUe(e){let t=sN[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n);return t(e,i,r)}}function MUe(e){let t=F6[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n),o=this._test.evaluate(n);return t(e,i,r,o)}}function aN(e,t){if(l(e))return e.getPropertyInherited(t)}mt.prototype._evaluateLiteral=function(){return this._value};mt.prototype._evaluateLiteralColor=function(e){let t=rN,n=this._left;if(this._value==="color")l(n)?n.length>1?(z.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):z.fromCssColorString(n[0].evaluate(e),t):z.fromBytes(255,255,255,255,t);else if(this._value==="rgb")z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return se.fromColor(t,Sn.getCartesian4())};mt.prototype._evaluateLiteralVector=function(e){let t=Sn.getArray(),n=this._value,i=this._left,r=i.length;for(let a=0;a<r;++a){let c=i[a].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof W)t.push(c.x,c.y);else if(c instanceof h)t.push(c.x,c.y,c.z);else if(c instanceof se)t.push(c.x,c.y,c.z,c.w);else throw new fe(`${n} argument must be a vector or number. Argument is ${c}.`)}let o=t.length,s=parseInt(n.charAt(3));if(o===0)throw new fe(`Invalid ${n} constructor. No valid arguments.`);if(o<s&&o>1)throw new fe(`Invalid ${n} constructor. Not enough arguments.`);if(o>s&&r>1)throw new fe(`Invalid ${n} constructor. Too many arguments.`);if(o===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return W.fromArray(t,0,Sn.getCartesian2());if(n==="vec3")return h.fromArray(t,0,Sn.getCartesian3());if(n==="vec4")return se.fromArray(t,0,Sn.getCartesian4())};mt.prototype._evaluateLiteralString=function(){return this._value};mt.prototype._evaluateVariableString=function(e){let t=this._value,n=iN.exec(t);for(;n!==null;){let i=n[0],r=n[1],o=aN(e,r);l(o)||(o=""),t=t.replace(i,o),n=iN.exec(t)}return t};mt.prototype._evaluateVariable=function(e){return aN(e,this._value)};function cx(e){return e._value==="feature"}mt.prototype._evaluateMemberDot=function(e){if(cx(this._left))return aN(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof W||t instanceof h||t instanceof se){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};mt.prototype._evaluateMemberBrackets=function(e){if(cx(this._left))return aN(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof W||t instanceof h||t instanceof se){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};mt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};mt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new fe(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};mt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof W)return W.negate(t,Sn.getCartesian2());if(t instanceof h)return h.negate(t,Sn.getCartesian3());if(t instanceof se)return se.negate(t,Sn.getCartesian4());if(typeof t=="number")return-t;throw new fe(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};mt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof W||t instanceof h||t instanceof se||typeof t=="number"))throw new fe(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};mt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new fe(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};mt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new fe(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};mt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new fe(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};mt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new fe(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};mt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new fe(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new fe(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};mt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new fe(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new fe(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};mt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof W&&t instanceof W)return W.add(t,n,Sn.getCartesian2());if(n instanceof h&&t instanceof h)return h.add(t,n,Sn.getCartesian3());if(n instanceof se&&t instanceof se)return se.add(t,n,Sn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new fe(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};mt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof W&&t instanceof W)return W.subtract(t,n,Sn.getCartesian2());if(n instanceof h&&t instanceof h)return h.subtract(t,n,Sn.getCartesian3());if(n instanceof se&&t instanceof se)return se.subtract(t,n,Sn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new fe(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};mt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof W&&t instanceof W)return W.multiplyComponents(t,n,Sn.getCartesian2());if(n instanceof W&&typeof t=="number")return W.multiplyByScalar(n,t,Sn.getCartesian2());if(t instanceof W&&typeof n=="number")return W.multiplyByScalar(t,n,Sn.getCartesian2());if(n instanceof h&&t instanceof h)return h.multiplyComponents(t,n,Sn.getCartesian3());if(n instanceof h&&typeof t=="number")return h.multiplyByScalar(n,t,Sn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.multiplyByScalar(t,n,Sn.getCartesian3());if(n instanceof se&&t instanceof se)return se.multiplyComponents(t,n,Sn.getCartesian4());if(n instanceof se&&typeof t=="number")return se.multiplyByScalar(n,t,Sn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.multiplyByScalar(t,n,Sn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new fe(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};mt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof W&&t instanceof W)return W.divideComponents(t,n,Sn.getCartesian2());if(t instanceof W&&typeof n=="number")return W.divideByScalar(t,n,Sn.getCartesian2());if(n instanceof h&&t instanceof h)return h.divideComponents(t,n,Sn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.divideByScalar(t,n,Sn.getCartesian3());if(n instanceof se&&t instanceof se)return se.divideComponents(t,n,Sn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.divideByScalar(t,n,Sn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new fe(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};mt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof W&&t instanceof W)return W.fromElements(t.x%n.x,t.y%n.y,Sn.getCartesian2());if(n instanceof h&&t instanceof h)return h.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Sn.getCartesian3());if(n instanceof se&&t instanceof se)return se.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,Sn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new fe(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};mt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof W&&t instanceof W||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?t.equals(n):t===n};mt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof W&&t instanceof W||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?!t.equals(n):t!==n};mt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new fe(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};mt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};mt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};mt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};mt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};mt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};mt.prototype._evaluateBooleanConversion=function(e){return Boolean(this._left.evaluate(e))};mt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};mt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};mt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(r){throw new fe(r)}return i};mt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new fe(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};mt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new fe(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};mt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new fe(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};mt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new fe(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};mt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof W||t instanceof h||t instanceof se)return String(t);throw new fe(`Unexpected function call "${this._value}".`)};function boe(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==ft.LITERAL_NUMBER)return;let i=t[0]._value,r=t[1]._value,o=t[2]._value,s=n===4?t[3]._value:1;return z.fromHsl(i,r,o,s,rN)}function Eoe(e){let t=e._left,n=t.length;for(let r=0;r<n;++r)if(t[r]._type!==ft.LITERAL_NUMBER)return;let i=rN;return i.red=t[0]._value/255,i.green=t[1]._value/255,i.blue=t[2]._value/255,i.alpha=n===4?t[3]._value:1,i}function bg(e){return e%1===0?e.toFixed(1):e.toString()}function BUe(e){let t=bg(e.red),n=bg(e.green),i=bg(e.blue);return`vec3(${t}, ${n}, ${i})`}function nN(e){let t=bg(e.red),n=bg(e.green),i=bg(e.blue),r=bg(e.alpha);return`vec4(${t}, ${n}, ${i}, ${r})`}function Soe(e,t,n,i){let r=e.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=e[s].getShaderExpression(t,n,i);return o}function woe(e,t){return l(t[e])?t[e]:ld.NULL_SENTINEL}ld.NULL_SENTINEL="czm_infinity";mt.prototype.getShaderExpression=function(e,t,n){let i,r,o,s,a=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?r=Soe(this._left,e,t,this):r=this._left.getShaderExpression(e,t,this)),l(this._right)&&(o=this._right.getShaderExpression(e,t,this)),l(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=Soe(this._value,e,t,this));let u,f,d;switch(a){case ft.VARIABLE:return cx(this)?void 0:woe(c,e);case ft.UNARY:if(c==="Boolean")return`bool(${r})`;if(c==="Number")return`float(${r})`;if(c==="round")return`floor(${r} + 0.5)`;if(l(oN[c]))return`${c}(${r})`;if(c==="isNaN")return`(${r} != ${r})`;if(c==="isFinite")return`(abs(${r}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new fe(`Error generating style shader: "${c}" is not supported.`);return c+r;case ft.BINARY:return c==="%"?`mod(${r}, ${o})`:c==="==="?`(${r} == ${o})`:c==="!=="?`(${r} != ${o})`:c==="atan2"?`atan(${r}, ${o})`:l(sN[c])?`${c}(${r}, ${o})`:`(${r} ${c} ${o})`;case ft.TERNARY:if(l(F6[c]))return`${c}(${r}, ${o}, ${s})`;break;case ft.CONDITIONAL:return`(${s} ? ${r} : ${o})`;case ft.MEMBER:return cx(this._left)?woe(o,e):o==="r"||o==="x"||o==="0.0"?`${r}[0]`:o==="g"||o==="y"||o==="1.0"?`${r}[1]`:o==="b"||o==="z"||o==="2.0"?`${r}[2]`:o==="a"||o==="w"||o==="3.0"?`${r}[3]`:`${r}[int(${o})]`;case ft.FUNCTION_CALL:throw new fe(`Error generating style shader: "${c}" is not supported.`);case ft.ARRAY:if(c.length===4)return`vec4(${c[0]}, ${c[1]}, ${c[2]}, ${c[3]})`;if(c.length===3)return`vec3(${c[0]}, ${c[1]}, ${c[2]})`;if(c.length===2)return`vec2(${c[0]}, ${c[1]})`;throw new fe("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case ft.REGEX:throw new fe("Error generating style shader: Regular expressions are not supported.");case ft.VARIABLE_IN_STRING:throw new fe("Error generating style shader: Converting a variable to a string is not supported.");case ft.LITERAL_NULL:return ld.NULL_SENTINEL;case ft.LITERAL_BOOLEAN:return c?"true":"false";case ft.LITERAL_NUMBER:return bg(c);case ft.LITERAL_STRING:if(l(n)&&n._type===ft.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||cx(n._left)))return c;if(i=z.fromCssColorString(c,rN),l(i))return BUe(i);throw new fe("Error generating style shader: String literals are not supported.");case ft.LITERAL_COLOR:if(u=r,c==="color"){if(l(u)){if(u.length>1){let p=u[0],g=u[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=Eoe(this),l(i)?nN(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=Eoe(this),l(i)?nN(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=boe(this),l(i)?nN(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=boe(this),l(i)?(i.alpha!==1&&(t.translucent=!0),nN(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case ft.LITERAL_VECTOR:f=r.length,d=`${c}(`;for(let p=0;p<f;++p)d+=r[p],p<f-1&&(d+=", ");return d+=")",d;case ft.LITERAL_REGEX:throw new fe("Error generating style shader: Regular expressions are not supported.");case ft.LITERAL_UNDEFINED:return ld.NULL_SENTINEL;case ft.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};mt.prototype.getVariables=function(e,t){let n,i,r,o=this._type,s=this._value;if(l(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,r=0;r<i;++r)n[r].getVariables(e,this);else this._left.getVariables(e,this);if(l(this._right)&&this._right.getVariables(e,this),l(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,r=0;r<i;++r)n[r].getVariables(e,this);let a;switch(o){case ft.VARIABLE:cx(this)||e.push(s);break;case ft.VARIABLE_IN_STRING:for(a=iN.exec(s);a!==null;)e.push(a[1]),a=iN.exec(s);break;case ft.LITERAL_STRING:l(t)&&t._type===ft.MEMBER&&cx(t._left)&&e.push(s);break}};var ud=ld;function Ap(e){e=y(e,y.EMPTY_OBJECT),this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=y(e.center,h.ZERO),this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=y(e.classificationType,qn.BOTH),this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};let t=this._batchIds.length;for(let n=0;n<t;++n){let i=this._batchIds[n];this._batchIdLookUp[i]=n}}Object.defineProperties(Ap.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var LUe={position:0,a_batchId:1};function NUe(e,t){if(l(e._va))return;let n=at.createVertexBuffer({context:t,typedArray:e._positions,usage:Ne.STATIC_DRAW}),i=at.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Ne.STATIC_DRAW}),r=at.createIndexBuffer({context:t,typedArray:e._indices,usage:Ne.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Le.UNSIGNED_SHORT:Le.UNSIGNED_INT}),o=[{index:0,vertexBuffer:n,componentDatatype:K.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:K.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new Qn({context:t,attributes:o,indexBuffer:r}),t.webgl2&&(e._vaSwap=new Qn({context:t,attributes:o,indexBuffer:at.createIndexBuffer({context:t,sizeInBytes:r.sizeInBytes,usage:Ne.DYNAMIC_DRAW,indexDatatype:r.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._verticesPromise=void 0}function FUe(e,t){if(l(e._sp))return;let n=e._batchTable,i=y(e._attributeLocations,LUe),r=e._pickId,o=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(o)){e._sp=Wt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=Fe.replaceMain(s,"czm_non_pick_main"),s=`${s}void main()
- {
- czm_non_pick_main();
- gl_FragColor = ${r};
- }
- `,e._spPick=Wt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(jw),c=n.getFragmentShaderCallback(!1,void 0,!0)(Zy);r=n.getPickId();let u=new Fe({sources:[a]}),f=new Fe({defines:["VECTOR_TILE"],sources:[c]});e._sp=Wt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new Fe({sources:[jw]}),f=new Fe({defines:["VECTOR_TILE"],sources:[Zy]}),e._spStencil=Wt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=Fe.replaceMain(c,"czm_non_pick_main"),c=`${c}
- void main()
- {
- czm_non_pick_main();
- gl_FragColor = ${r};
- }
- `;let d=new Fe({sources:[a]}),p=new Fe({defines:["VECTOR_TILE"],sources:[c]});e._spPick=Wt.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:i})}function voe(e){let t=e?yi.EQUAL:yi.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:Ft.KEEP,zFail:Ft.DECREMENT_WRAP,zPass:Ft.KEEP},backFunction:t,backOperation:{fail:Ft.KEEP,zFail:Ft.INCREMENT_WRAP,zPass:Ft.KEEP},reference:tn.CESIUM_3D_TILE_MASK,mask:tn.CESIUM_3D_TILE_MASK},stencilMask:tn.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:wc.LESS_OR_EQUAL},depthMask:!1}}var VUe={stencilTest:{enabled:!0,frontFunction:yi.NOT_EQUAL,frontOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},backFunction:yi.NOT_EQUAL,backOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},reference:0,mask:tn.CLASSIFICATION_MASK},stencilMask:tn.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:hn.PRE_MULTIPLIED_ALPHA_BLEND},kUe={stencilTest:{enabled:!0,frontFunction:yi.NOT_EQUAL,frontOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},backFunction:yi.NOT_EQUAL,backOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},reference:0,mask:tn.CLASSIFICATION_MASK},stencilMask:tn.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function UUe(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ve.fromCache(voe(!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(voe(!0)),e._rsColorPass=Ve.fromCache(VUe),e._rsPickPass=Ve.fromCache(kUe))}var lx=new N,Doe=new h;function zUe(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,r=t.uniformState.projection;return N.clone(i,lx),N.multiplyByPoint(lx,e._center,Doe),N.setTranslation(lx,Doe,lx),N.multiply(r,lx,lx),lx},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function V6(e,t,n,i,r,o,s){let a=e.constructor.BYTES_PER_ELEMENT,c=o.length;for(let u=0;u<c;++u){let f=o[u],d=s[f],p=i[d],g=r[d],m=new e.constructor(e.buffer,a*p,g);t.set(m,n),i[d]=n,n+=g}return n}function HUe(e,t){let n=e._indices,i=e._indexOffsets,r=e._indexCounts,o=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],u=V6(n,s,0,i,r,a.batchIds,o);for(a.offset=0,a.count=u;t.length>0;){let f=t.pop();if(z.equals(f.color,a.color))u=V6(n,s,u,i,r,f.batchIds,o),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let d=u;u=V6(n,s,u,i,r,f.batchIds,o),f.offset=d,f.count=u-d,c.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function k6(e,t,n,i,r,o,s){let a=e.bytesPerIndex,c=o.length;for(let u=0;u<c;++u){let f=o[u],d=s[f],p=i[d],g=r[d];t.copyFromBuffer(e,p*a,n*a,g*a),i[d]=n,n+=g}return n}function GUe(e,t){let n=e._indexOffsets,i=e._indexCounts,r=e._batchIdLookUp,o=t.pop(),s=[o],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,u=k6(a,c,0,n,i,o.batchIds,r);for(o.offset=0,o.count=u;t.length>0;){let d=t.pop();if(z.equals(d.color,o.color))u=k6(a,c,u,n,i,d.batchIds,r),o.batchIds=o.batchIds.concat(d.batchIds),o.count=u-o.offset;else{let p=u;u=k6(a,c,u,n,i,d.batchIds,r),d.offset=p,d.count=u-p,s.push(d),o=d}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function WUe(e,t){return t.color.toRgba()-e.color.toRgba()}function jUe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,r=!1,o={};for(let s=0;s<i;++s){let c=n[s].color.toRgba();if(l(o[c])){r=!0;break}else o[c]=!0}if(!r)return e._batchDirty=!1,!1;if(r&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(WUe),t.webgl2?GUe(e,n):HUe(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function qUe(e,t){let n=jUe(e,t),i=e._commands,r=e._batchedIndices,o=r.length,s=o*2;if(l(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,u=y(e._modelMatrix,N.IDENTITY),f=e._uniformMap,d=e._boundingVolume;for(let p=0;p<o;++p){let g=r[p].offset,m=r[p].count,x=i[p*2];l(x)||(x=i[p*2]=new Ze({owner:e})),x.vertexArray=a,x.modelMatrix=u,x.offset=g,x.count=m,x.renderState=e._rsStencilDepthPass,x.shaderProgram=c,x.uniformMap=f,x.boundingVolume=d,x.cull=!1,x.pass=Ce.TERRAIN_CLASSIFICATION;let C=Ze.shallowClone(x,x.derivedCommands.tileset);C.renderState=e._rsStencilDepthPass3DTiles,C.pass=Ce.CESIUM_3D_TILE_CLASSIFICATION,x.derivedCommands.tileset=C;let A=i[p*2+1];l(A)||(A=i[p*2+1]=new Ze({owner:e})),A.vertexArray=a,A.modelMatrix=u,A.offset=g,A.count=m,A.renderState=e._rsColorPass,A.shaderProgram=c,A.uniformMap=f,A.boundingVolume=d,A.cull=!1,A.pass=Ce.TERRAIN_CLASSIFICATION;let b=Ze.shallowClone(A,A.derivedCommands.tileset);b.pass=Ce.CESIUM_3D_TILE_CLASSIFICATION,A.derivedCommands.tileset=b}e._commandsDirty=!0}function YUe(e,t){if(e.classificationType===qn.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,r=e._spStencil,o=n.length,s=i.length=o/2,a=0;for(let c=0;c<s;++c){let u=i[c]=Ze.shallowClone(n[a],i[c]);u.shaderProgram=r,u.pass=Ce.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function XUe(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,r=e._spStencil,o=e._spPick,s=y(e._modelMatrix,N.IDENTITY),a=e._uniformMap;for(let c=0;c<t;++c){let u=e._indexOffsets[c],f=e._indexCounts[c],d=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new Ze({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=r,p.uniformMap=a,p.boundingVolume=d,p.pass=Ce.TERRAIN_CLASSIFICATION;let g=Ze.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=Ce.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let m=n[c*2+1];l(m)||(m=n[c*2+1]=new Ze({owner:e,pickOnly:!0})),m.vertexArray=i,m.modelMatrix=s,m.offset=u,m.count=f,m.renderState=e._rsPickPass,m.shaderProgram=o,m.uniformMap=a,m.boundingVolume=d,m.pass=Ce.TERRAIN_CLASSIFICATION;let x=Ze.shallowClone(m,m.derivedCommands.tileset);x.pass=Ce.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=x}e._pickCommandsDirty=!1}Ap.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new bo(e,o)}};Ap.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function KUe(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,r;for(r=0;r<i;++r){let s=n[r],a=t[s];a.show=!0,a.color=z.WHITE}let o=e._batchedIndices;for(i=o.length,r=0;r<i;++r)o[r].color=z.clone(z.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var $Ue=new z,ZUe=z.WHITE,JUe=!0,QUe=/\$/;Ap.prototype.applyStyle=function(e,t){if(!l(e)){KUe(this,t);return}let n=e.color,i=n instanceof ud&&!QUe.test(n.expression);this._updatingAllCommands=i;let r=this._batchIds,o=r.length,s;for(s=0;s<o;++s){let a=r[s],c=t[a];c.color=l(e.color)?e.color.evaluateColor(c,$Ue):ZUe,c.show=l(e.show)?e.show.evaluate(c):JUe}if(i){let a=this._batchedIndices;for(o=a.length,s=0;s<o;++s)a[s].color=z.clone(z.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};Ap.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let r=this._indexOffsets,o=this._indexCounts,s=r[i],a=o[i],c=this._batchedIndices,u=c.length,f;for(f=0;f<u;++f){let x=c[f].offset,C=c[f].count;if(s>=x&&s<x+C)break}c.push(new rf({color:z.clone(t),offset:s,count:a,batchIds:[e]}));let d=[],p=[],g=c[f].batchIds,m=g.length;for(let x=0;x<m;++x){let C=g[x];if(C===e)continue;let A=n[C];r[A]<s?d.push(C):p.push(C)}p.length!==0&&c.push(new rf({color:z.clone(c[f].color),offset:s+a,count:c[f].offset+c[f].count-(s+a),batchIds:p})),d.length!==0?(c[f].count=s-c[f].offset,c[f].batchIds=d):c.splice(f,1),this._batchDirty=!0};function Poe(e,t,n,i){let r=e.classificationType,o=r!==qn.CESIUM_3D_TILE,s=r!==qn.TERRAIN,a=t.commandList,c=n.length,u,f;for(f=0;f<c;++f)o&&(u=n[f],u.pass=Ce.TERRAIN_CLASSIFICATION,a.push(u)),s&&(u=n[f].derivedCommands.tileset,u.pass=Ce.CESIUM_3D_TILE_CLASSIFICATION,a.push(u));if(!(!t.invertClassification||!l(i)))for(c=i.length,f=0;f<c;++f)a.push(i[f])}function e4e(e,t){let n=e.commandList,i=t.length;for(let r=0;r<i;r+=2){let o=t[r+1];o.pass=Ce.OPAQUE,n.push(o)}}function t4e(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=Ve.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Me.LINES):(n=e._rsColorPass,i=Me.TRIANGLES);let r=e._commands,o=r.length;for(let s=0;s<o;s+=2){let a=r[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}Ap.prototype.update=function(e){let t=e.context;NUe(this,t),FUe(this,t),UUe(this),zUe(this,t);let n=e.passes;n.render&&(qUe(this,t),YUe(this,e),t4e(this),this._debugWireframe?e4e(e,this._commands):Poe(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(XUe(this),Poe(this,e,this._pickCommands))};Ap.prototype.isDestroyed=function(){return!1};Ap.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),ue(this)};var Eg=Ap;var n4e=new h,Sg=$t.ModelState;function ZT(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf;if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t instanceof Uint8Array)t=xp(t),Tg(t),Cg(t),KT(t),$T(t);else throw new fe("Only binary glTF is supported as a classifier.");Ae.buffer(t,function(f){if(!l(f.extras._pipeline.source))throw new fe("Buffer data must be embedded in the binary gltf.")});let n=t.nodes,i=t.meshes,o=n[0].mesh;if(n.length!==1||!l(o))throw new fe("Only one node is supported for classification and it must have a mesh.");if(i.length!==1)throw new fe("Only one mesh is supported when using b3dm for classification.");let s=i[0].primitives;if(s.length!==1)throw new fe("Only one primitive per mesh is supported when using b3dm for classification.");let a=s[0].attributes.POSITION;if(!l(a))throw new fe("The mesh must have a position attribute.");let c=s[0].attributes._BATCHID;if(!l(c))throw new fe("The mesh must have a batch id attribute.");this._gltf=t,this.show=y(e.show,!0),this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this._modelMatrix=N.clone(this.modelMatrix),this._ready=!1;let u=this;this._readyPromise=new Promise(f=>{u._completeLoad=d=>{d.afterRender.push(function(){u._ready=!0,f(u)})}}),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=y(e.debugWireframe,!1),this._debugWireframe=!1,this._classificationType=e.classificationType,this._vertexShaderLoaded=e.vertexShaderLoaded,this._classificationShaderLoaded=e.classificationShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._pickIdLoaded=e.pickIdLoaded,this._ignoreCommands=y(e.ignoreCommands,!1),this._upAxis=y(e.upAxis,On.Y),this._batchTable=e.batchTable,this._computedModelMatrix=new N,this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new re,this._state=Sg.NEEDS_LOAD,this._loadResources=void 0,this._mode=void 0,this._dirty=!1,this._nodeMatrix=new N,this._primitive=void 0,this._extensionsUsed=void 0,this._extensionsRequired=void 0,this._quantizedUniforms=void 0,this._buffers={},this._vertexArray=void 0,this._shaderProgram=void 0,this._uniformMap=void 0,this._geometryByteLength=0,this._trianglesLength=0,this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._rtcCenter3D=void 0,this._rtcCenter2D=void 0}Object.defineProperties(ZT.prototype,{gltf:{get:function(){return this._gltf}},gltfInternal:{get:function(){return this._gltf}},boundingSphere:{get:function(){let e=this.modelMatrix,t=N.getScale(e,n4e),n=this._scaledBoundingSphere;return n.center=h.multiplyComponents(this._boundingSphere.center,t,n.center),n.radius=h.maximumComponent(t)*this._initialRadius,l(this._rtcCenter)&&h.add(this._rtcCenter,n.center,n.center),n}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},dirty:{get:function(){return this._dirty}},extensionsUsed:{get:function(){return l(this._extensionsUsed)||(this._extensionsUsed=$t.getUsedExtensions(this.gltf)),this._extensionsUsed}},extensionsRequired:{get:function(){return l(this._extensionsRequired)||(this._extensionsRequired=$t.getRequiredExtensions(this.gltf)),this._extensionsRequired}},upAxis:{get:function(){return this._upAxis}},trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},texturesByteLength:{get:function(){return 0}},classificationType:{get:function(){return this._classificationType}}});function i4e(e){let t=e.gltf,n=e._loadResources;Ae.buffer(t,function(i,r){n.buffers[r]=i.extras._pipeline.source})}function r4e(e){let t=e.gltf.bufferViews,n=e._loadResources.vertexBuffersToCreate;Ae.bufferView(e.gltf,function(o,s){o.target===Z.ARRAY_BUFFER&&n.enqueue(s)});let i=e._loadResources.indexBuffersToCreate,r={};Ae.accessor(e.gltf,function(o){let s=o.bufferView;t[s].target===Z.ELEMENT_ARRAY_BUFFER&&!l(r[s])&&(r[s]=!0,i.enqueue({id:s,componentType:o.componentType}))})}function o4e(e,t){let n=t._loadResources,r=t.gltf.bufferViews[e],o=n.getBuffer(r);t._buffers[e]=o,t._geometryByteLength+=o.byteLength}function s4e(e,t,n){let i=n._loadResources,o=n.gltf.bufferViews[e],s={typedArray:i.getBuffer(o),indexDatatype:t};n._buffers[e]=s,n._geometryByteLength+=s.typedArray.byteLength}function a4e(e){let t=e._loadResources;if(t.pendingBufferLoads!==0)return;let n=t.vertexBuffersToCreate,i=t.indexBuffersToCreate;for(;n.length>0;)o4e(n.dequeue(),e);for(;i.length>0;){let r=i.dequeue();s4e(r.id,r.componentType,e)}}function c4e(e,t){let n=t.gltf.meshes[0].primitives[0],i=$t.modifyShaderForQuantizedAttributes(t.gltf,n,e);return t._quantizedUniforms=i.uniforms,i.shader}function Ioe(e,t){return l(t)&&(e=t(e)),e}function l4e(e){let t=e.gltf,n=$t.getAttributeOrUniformBySemantic(t,"POSITION"),i=$t.getAttributeOrUniformBySemantic(t,"_BATCHID"),r={};r[n]=0,r[i]=1;let o=$t.getAttributeOrUniformBySemantic(t,"MODELVIEWPROJECTION"),s,a;if(l(o))s=`uniform mat4 ${o};
- `,a=`${o} * vec4(${n}, 1.0)`;else{let g=$t.getAttributeOrUniformBySemantic(t,"PROJECTION"),m=$t.getAttributeOrUniformBySemantic(t,"MODELVIEW");l(m)||(m=$t.getAttributeOrUniformBySemantic(t,"CESIUM_RTC_MODELVIEW")),s=`uniform mat4 ${m};
- uniform mat4 ${g};
- `,a=`${g} * ${m} * vec4(${n}, 1.0)`}let c=` vec4 positionInClipCoords = ${a};
- `,u=`attribute vec3 ${n};
- attribute float ${i};
- ${s}void main() {
- ${c} gl_Position = czm_depthClamp(positionInClipCoords);
- }
- `,f=`#ifdef GL_EXT_frag_depth
- #extension GL_EXT_frag_depth : enable
- #endif
- void main()
- {
- gl_FragColor = vec4(1.0);
- czm_writeDepthClamp();
- }
- `;e.extensionsUsed.WEB3D_quantized_attributes&&(u=c4e(u,e));let d=Ioe(u,e._vertexShaderLoaded),p=Ioe(f,e._classificationShaderLoaded);e._shaderProgram={vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:r}}function u4e(){return{POSITION:0,_BATCHID:1}}function f4e(e){if(!e._loadResources.finishedBuffersCreation()||l(e._vertexArray))return;let n=e._buffers,i=e.gltf,r=i.accessors,a=i.meshes[0].primitives[0],c=u4e(),u={};Ae.meshPrimitiveAttribute(a,function(d,p){let g=c[p];if(l(g)){let m=r[d];u[p]={index:g,vertexBuffer:n[m.bufferView],componentsPerAttribute:ps(m.type),componentDatatype:m.componentType,offsetInBytes:m.byteOffset,strideInBytes:_s(i,m)}}});let f;if(l(a.indices)){let d=r[a.indices];f=n[d.bufferView]}e._vertexArray={attributes:u,indexBuffer:f}}var Ooe={PROJECTION:function(e,t){return $t.getGltfSemanticUniforms().PROJECTION(e,t)},MODELVIEW:function(e,t){return $t.getGltfSemanticUniforms().MODELVIEW(e,t)},CESIUM_RTC_MODELVIEW:function(e,t){return $t.getGltfSemanticUniforms().CESIUM_RTC_MODELVIEW(e,t)},MODELVIEWPROJECTION:function(e,t){return $t.getGltfSemanticUniforms().MODELVIEWPROJECTION(e,t)}};function d4e(e,t){if(l(e._uniformMap))return;let n={};Ae.technique(e.gltf,function(i){Ae.techniqueUniform(i,function(r,o){!l(r.semantic)||!l(Ooe[r.semantic])||(n[o]=Ooe[r.semantic](t.uniformState,e))})}),e._uniformMap=n}function h4e(e,t){return $t.createUniformsForQuantizedAttributes(e.gltf,t,e._quantizedUniforms)}function m4e(e,t){switch(e.mode){case Me.TRIANGLES:return t/3;case Me.TRIANGLE_STRIP:case Me.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function p4e(e){let t=e._batchTable,n=e._uniformMap,i=e._vertexArray,r=e.gltf,o=r.accessors,a=r.meshes[0].primitives[0],c=o[a.indices],u=a.attributes.POSITION,f=$t.getAccessorMinMax(r,u),d=re.fromCornerPoints(h.fromArray(f.min),h.fromArray(f.max)),p,g;if(l(c)?(g=c.count,p=c.byteOffset/Le.getSizeInBytes(c.componentType)):(g=o[a.attributes.POSITION].count,p=0),e._trianglesLength+=m4e(a,g),l(e._uniformMapLoaded)&&(n=e._uniformMapLoaded(n)),e.extensionsUsed.WEB3D_quantized_attributes){let q=h4e(e,a);n=rt(n,q)}let m=i.attributes.POSITION,x=m.componentDatatype,C=m.vertexBuffer,A=C.byteOffset,b=C.byteLength/K.getSizeInBytes(x),T=K.createArrayBufferView(x,C.buffer,A,b);m=i.attributes._BATCHID,x=m.componentDatatype,C=m.vertexBuffer,A=C.byteOffset,b=C.byteLength/K.getSizeInBytes(x);let S=K.createArrayBufferView(x,C.buffer,A,b),w=i.indexBuffer.typedArray,D;i.indexBuffer.indexDatatype===Le.UNSIGNED_SHORT?D=new Uint16Array(w.buffer,w.byteOffset,w.byteLength/Uint16Array.BYTES_PER_ELEMENT):D=new Uint32Array(w.buffer,w.byteOffset,w.byteLength/Uint32Array.BYTES_PER_ELEMENT),T=T.slice(),S=S.slice(),D=D.slice(p,p+g);let I=[],O=[],B=[],L=[],_=S[D[0]];I.push(_),B.push(0);let E,v,P,R=D.length;for(let q=1;q<R;++q)E=S[D[q]],E!==_&&(v=B[B.length-1],P=q-v,I.push(E),O.push(P),B.push(q),L.push(new rf({offset:v,count:P,batchIds:[_],color:z.WHITE})),_=E);v=B[B.length-1],P=R-v,O.push(P),L.push(new rf({offset:v,count:P,batchIds:[_],color:z.WHITE}));let F=e._shaderProgram,U=F.vertexShaderSource,k=F.fragmentShaderSource,H=F.attributeLocations,V=l(e._pickIdLoaded)?e._pickIdLoaded():void 0;e._primitive=new Eg({classificationType:e._classificationType,positions:T,indices:D,indexOffsets:B,indexCounts:O,batchIds:I,vertexBatchIds:S,batchedIndices:L,batchTable:t,boundingVolume:new re,_vertexShaderSource:U,_fragmentShaderSource:k,_attributeLocations:H,_uniformMap:n,_pickId:V,_modelMatrix:new N,_boundingSphere:d}),e._buffers=void 0,e._vertexArray=void 0,e._shaderProgram=void 0,e._uniformMap=void 0}function _4e(e){if(!e._loadResources.finished()||l(e._primitive))return;let r=e.gltf.nodes[0];e._nodeMatrix=$t.getTransform(r,e._nodeMatrix),p4e(e)}function Roe(e,t){let n=t.context;$t.checkSupportedGlExtensions(e.gltf.glExtensionsUsed,n),a4e(e),l4e(e),f4e(e),d4e(e,n),_4e(e)}var g4e=new se,U6=new N;function y4e(e,t,n,i){let r=e._computedModelMatrix;if(e._mode!==te.SCENE3D&&!e._ignoreCommands){let s=N.getColumn(r,3,g4e);if(!se.equals(s,se.UNIT_W))r=yt.basisTo2D(i,r,U6),e._rtcCenter=e._rtcCenter3D;else{let a=e.boundingSphereInternal.center,c=yt.wgs84To2DModelMatrix(i,a,U6);r=N.multiply(c,r,U6),l(e._rtcCenter)&&(N.setTranslation(r,se.UNIT_W,r),e._rtcCenter=e._rtcCenter2D)}}let o=e._primitive;(t||n)&&(N.multiplyTransformation(r,e._nodeMatrix,o._modelMatrix),re.transform(o._boundingSphere,o._modelMatrix,o._boundingVolume),l(e._rtcCenter)&&h.add(e._rtcCenter,o._boundingVolume.center,o._boundingVolume.center))}ZT.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};ZT.prototype.update=function(e){if(e.mode===te.MORPHING)return;if(!Et.supportsWebP.initialized){Et.supportsWebP.initialize();return}let t=Et.supportsWebP();if(this._state===Sg.NEEDS_LOAD&&l(this.gltf)&&(this._state=Sg.LOADING,this._state!==Sg.FAILED)){let o=this.gltf.extensions;if(l(o)&&l(o.CESIUM_RTC)){let s=h.fromArray(o.CESIUM_RTC.center);if(!h.equals(s,h.ZERO)){this._rtcCenter3D=s;let a=e.mapProjection,u=a.ellipsoid.cartesianToCartographic(this._rtcCenter3D),f=a.project(u);h.fromElements(f.z,f.x,f.y,f),this._rtcCenter2D=f,this._rtcCenterEye=new h,this._rtcCenter=this._rtcCenter3D}}this._loadResources=new jT,$t.parseBuffers(this)}let n=this._loadResources,i=!1;this._state===Sg.LOADING&&(n.pendingBufferLoads===0&&($t.checkSupportedExtensions(this.extensionsRequired,t),i4e(this),r4e(this),this._boundingSphere=$t.computeBoundingSphere(this),this._initialRadius=this._boundingSphere.radius,Roe(this,e)),n.finished()&&(this._state=Sg.LOADED,i=!0)),l(n)&&this._state===Sg.LOADED&&(i||Roe(this,e),n.finished()&&(this._loadResources=void 0));let r=this.show;if(r&&this._state===Sg.LOADED||i){this._dirty=!1;let o=this.modelMatrix,s=e.mode!==this._mode;this._mode=e.mode;let a=!N.equals(this._modelMatrix,o)||s;if(a||i){N.clone(o,this._modelMatrix);let c=this._computedModelMatrix;N.clone(o,c),this._upAxis===On.Y?N.multiplyTransformation(c,On.Y_UP_TO_Z_UP,c):this._upAxis===On.X&&N.multiplyTransformation(c,On.X_UP_TO_Z_UP,c)}(a||i)&&(y4e(this,a,i,e.mapProjection),this._dirty=!0)}if(i){this._completeLoad(e);return}r&&!this._ignoreCommands&&(this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.debugWireframe=this.debugWireframe,this._primitive.update(e))};ZT.prototype.isDestroyed=function(){return!1};ZT.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var cN=ZT;function JT(e,t){this._distance=t,this._normal=new Moe(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(JT.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!h.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),h.clone(e,this._normal._cartesian3)}}});JT.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new JT(e.normal,e.distance),t};JT.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new JT(e.normal,e.distance)};function Moe(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(Moe.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var QT=JT;function qa(e){e=y(e,y.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=y(e.enabled,!0),this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this.edgeColor=z.clone(y(e.edgeColor,z.WHITE)),this.edgeWidth=y(e.edgeWidth,0),this.planeAdded=new ge,this.planeRemoved=new ge,this._owner=void 0;let t=y(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?Voe:koe,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let r=0;r<i;++r)this.add(n[r])}}function Voe(e){return e===Jt.OUTSIDE}function koe(e){return e===Jt.INSIDE}Object.defineProperties(qa.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?Voe:koe)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});function Boe(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}qa.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){Boe(n,i)},e.index=t,Boe(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};qa.prototype.get=function(e){return this._planes[e]};function Uoe(e,t){let n=e.length;for(let i=0;i<n;++i)if(an.equals(e[i],t))return i;return-1}qa.prototype.contains=function(e){return Uoe(this._planes,e)!==-1};qa.prototype.remove=function(e){let t=this._planes,n=Uoe(t,e);if(n===-1)return!1;e instanceof QT&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let r=n;r<i;++r){let o=t[r+1];t[r]=o,o instanceof QT&&(o.index=r)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};qa.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof QT&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var x4e=new se,C4e=new se;function Loe(e,t,n){let i=e._uint8View,r=e._planes,o=0;for(let s=t;s<n;++s){let a=r[s],c=In.octEncodeToCartesian4(a.normal,C4e);i[o]=c.x,i[o+1]=c.y,i[o+2]=c.z,i[o+3]=c.w;let u=se.packFloat(a.distance,x4e);i[o+4]=u.x,i[o+5]=u.y,i[o+6]=u.z,i[o+7]=u.w,o+=8}}function Noe(e,t,n){let i=e._float32View,r=e._planes,o=0;for(let s=t;s<n;++s){let a=r[s],c=a.normal;i[o]=c.x,i[o+1]=c.y,i[o+2]=c.z,i[o+3]=a.distance,o+=4}}function zoe(e,t){let n=Bt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var A4e=new W;qa.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=qa.useFloatTexture(n),r=i?this.length:this.length*2;if(l(t)){let s=t.width*t.height;(s<r||r<.25*s)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let s=zoe(r,A4e);s.y*=2,i?(t=new wt({context:n,width:s.x,height:s.y,pixelFormat:ct.RGBA,pixelDatatype:qe.FLOAT,sampler:on.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new wt({context:n,width:s.x,height:s.y,pixelFormat:ct.RGBA,pixelDatatype:qe.UNSIGNED_BYTE,sampler:on.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(s.x*s.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let o=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&o===-1)){if(this._multipleDirtyPlanes)i?(Noe(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(Loe(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let s=0,a=0;i?(a=Math.floor(o/t.width),s=Math.floor(o-a*t.width),Noe(this,o,o+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:s,yOffset:a})):(a=Math.floor(o*2/t.width),s=Math.floor(o*2-a*t.width),Loe(this,o,o+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:s,yOffset:a}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var T4e=new N,Foe=new an(h.UNIT_X,0);qa.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,r=this.modelMatrix;l(t)&&(r=N.multiply(t,r,T4e));let o=Jt.INSIDE;!this.unionClippingRegions&&i>0&&(o=Jt.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];an.transform(a,r,Foe);let c=e.intersectPlane(Foe);if(c===Jt.INTERSECTING)o=c;else if(this._testIntersection(c))return c}return o};qa.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};qa.useFloatTexture=function(e){return e.floatingPointTexture};qa.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let r=qa.useFloatTexture(t)?e.length:e.length*2,o=zoe(r,n);return o.y*=2,o};qa.prototype.isDestroyed=function(){return!1};qa.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ue(this)};var vs=qa;var Yw={HIGHLIGHT:0,REPLACE:1,MIX:2};Yw.getColorBlend=function(e,t){if(e===Yw.HIGHLIGHT)return 0;if(e===Yw.REPLACE)return 1;if(e===Yw.MIX)return M.clamp(t,M.EPSILON4,1)};var Ds=Object.freeze(Yw);function Si(){}Si._maxDecodingConcurrency=Math.max(Et.hardwareConcurrency-1,1);Si._decoderTaskProcessor=void 0;Si._taskProcessorReady=!1;Si._getDecoderTaskProcessor=function(){if(!l(Si._decoderTaskProcessor)){let e=new Mi("decodeDraco",Si._maxDecodingConcurrency);e.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_decoder_nodejs.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(){Si._taskProcessorReady=!0}),Si._decoderTaskProcessor=e}return Si._decoderTaskProcessor};Si.hasExtension=function(e){return l(e.extensionsRequired.KHR_draco_mesh_compression)||l(e.extensionsUsed.KHR_draco_mesh_compression)};function Goe(e,t){let n=`runtime.${Object.keys(e.createdBufferViews).length}`,i=e.buffers,r=Object.keys(i).length;return i[r]=t,e.createdBufferViews[n]={buffer:r,byteOffset:0,byteLength:t.byteLength},n}function b4e(e,t,n){let i=t._loadResources,r=Goe(i,e);return i.vertexBuffersToCreate.enqueue(r),r}function E4e(e,t,n){let i=e.typedArray,r=t._loadResources,o=Goe(r,i);return r.indexBuffersToCreate.enqueue({id:o,componentType:K.fromTypedArray(i)}),{bufferViewId:o,numberOfIndices:e.numberOfIndices}}function Hoe(e,t,n,i){if(!Si._taskProcessorReady)return;let r=n.primitivesToDecode.peek();if(!l(r))return;let o=e.scheduleTask(r,[r.array.buffer]);if(!!l(o))return n.activeDecodingTasks++,n.primitivesToDecode.dequeue(),o.then(function(s){n.activeDecodingTasks--;let a=E4e(s.indexArray,t,i),c={},u=s.attributeData;for(let f in u)if(u.hasOwnProperty(f)){let d=u[f],p=d.array,g=b4e(p,t,i),m=d.data;m.bufferView=g,c[f]=m}t._decodedData[`${r.mesh}.primitive.${r.primitive}`]={bufferView:a.bufferViewId,numberOfIndices:a.numberOfIndices,attributes:c}})}Si._decodedModelResourceCache=void 0;Si.parse=function(e,t){if(!Si.hasExtension(e))return;let n=e._loadResources,i=e.cacheKey;if(l(i)){l(Si._decodedModelResourceCache)||(l(t.cache.modelDecodingCache)||(t.cache.modelDecodingCache={}),Si._decodedModelResourceCache=t.cache.modelDecodingCache);let s=Si._decodedModelResourceCache[i];if(l(s)){s.count++,n.pendingDecodingCache=!0;return}}let r=e._dequantizeInShader,o=e.gltfInternal;Ae.mesh(o,function(s,a){Ae.meshPrimitive(s,function(c,u){if(!l(c.extensions))return;let f=c.extensions.KHR_draco_mesh_compression;if(!l(f))return;let d=o.bufferViews[f.bufferView],g=o.buffers[d.buffer].extras._pipeline.source.slice(d.byteOffset,d.byteOffset+d.byteLength);n.primitivesToDecode.enqueue({mesh:a,primitive:u,array:g,bufferView:d,compressedAttributes:f.attributes,dequantizeInShader:r})})})};Si.decodeModel=function(e,t){if(!Si.hasExtension(e))return Promise.resolve();let n=e._loadResources,i=e.cacheKey;if(l(i)&&l(Si._decodedModelResourceCache)){let a=Si._decodedModelResourceCache[i];if(l(a)&&n.pendingDecodingCache)return Promise.resolve(a.ready).then(function(){e._decodedData=a.data,n.pendingDecodingCache=!1});Si._decodedModelResourceCache[i]={ready:!1,count:1,data:void 0}}if(n.primitivesToDecode.length===0)return Promise.resolve();let r=Si._getDecoderTaskProcessor(),o=[],s=Hoe(r,e,n,t);for(;l(s);)o.push(s),s=Hoe(r,e,n,t);return Promise.all(o)};Si.decodePointCloud=function(e){let t=Si._getDecoderTaskProcessor();if(!!Si._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};Si.decodeBufferView=function(e){let t=Si._getDecoderTaskProcessor();if(!!Si._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};Si.cacheDataForModel=function(e){let t=e.cacheKey;if(l(t)&&l(Si._decodedModelResourceCache)){let n=Si._decodedModelResourceCache[t];l(n)&&(n.ready=!0,n.data=e._decodedData)}};Si.destroyCachedDataForModel=function(e){let t=e.cacheKey;if(l(t)&&l(Si._decodedModelResourceCache)){let n=Si._decodedModelResourceCache[t];l(n)&&--n.count===0&&delete Si._decodedModelResourceCache[t]}};var _l=Si;function S4e(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t});
- vec4 clippingPlanesEdgeColor = vec4(1.0);
- clippingPlanesEdgeColor.rgb = ${n}.rgb;
- float clippingPlanesEdgeWidth = ${n}.a;
- if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth)
- {
- gl_FragColor = clippingPlanesEdgeColor;
- }
- `}var eb=S4e;var w4e=new W;function v4e(e,t){let n=e.unionClippingRegions,i=e.length,r=vs.useFloatTexture(t),o=vs.getTextureResolution(e,t,w4e),s=o.x,a=o.y,c=r?I4e(s,a):O4e(s,a);return c+=`
- `,c+=n?D4e(i):P4e(i),c}function D4e(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
- {
- vec4 position = czm_windowToEyeCoordinates(fragCoord);
- vec3 clipNormal = vec3(0.0);
- vec3 clipPosition = vec3(0.0);
- float clipAmount;
- float pixelWidth = czm_metersPerPixel(position);
- bool breakAndDiscard = false;
- for (int i = 0; i < ${e}; ++i)
- {
- vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
- clipNormal = clippingPlane.xyz;
- clipPosition = -clippingPlane.w * clipNormal;
- float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
- clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
- if (amount <= 0.0)
- {
- breakAndDiscard = true;
- break;
- }
- }
- if (breakAndDiscard) {
- discard;
- }
- return clipAmount;
- }
- `}function P4e(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
- {
- bool clipped = true;
- vec4 position = czm_windowToEyeCoordinates(fragCoord);
- vec3 clipNormal = vec3(0.0);
- vec3 clipPosition = vec3(0.0);
- float clipAmount = 0.0;
- float pixelWidth = czm_metersPerPixel(position);
- for (int i = 0; i < ${e}; ++i)
- {
- vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
- clipNormal = clippingPlane.xyz;
- clipPosition = -clippingPlane.w * clipNormal;
- float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
- clipAmount = max(amount, clipAmount);
- clipped = clipped && (amount <= 0.0);
- }
- if (clipped)
- {
- discard;
- }
- return clipAmount;
- }
- `}function I4e(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
- {
- int pixY = clippingPlaneNumber / ${e};
- int pixX = clippingPlaneNumber - (pixY * ${e});
- float u = (float(pixX) + 0.5) * ${r};
- float v = (float(pixY) + 0.5) * ${o};
- vec4 plane = texture2D(packedClippingPlanes, vec2(u, v));
- return czm_transformPlane(plane, transform);
- }
- `}function O4e(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
- {
- int clippingPlaneStartIndex = clippingPlaneNumber * 2;
- int pixY = clippingPlaneStartIndex / ${e};
- int pixX = clippingPlaneStartIndex - (pixY * ${e});
- float u = (float(pixX) + 0.5) * ${r};
- float v = (float(pixY) + 0.5) * ${o};
- vec4 oct32 = texture2D(packedClippingPlanes, vec2(u, v)) * 255.0;
- vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
- vec4 plane;
- plane.xyz = czm_octDecode(oct, 65535.0);
- plane.w = czm_unpackFloat(texture2D(packedClippingPlanes, vec2(u + ${r}, v)));
- return czm_transformPlane(plane, transform);
- }
- `}var wg=v4e;var R4e={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},ss=Object.freeze(R4e);function lN(){}var M4e=/^data\:/i;function Yoe(e,t){let n=e.gltfInternal,i=n.buffers,o=n.bufferViews[t.bufferView],s=i[o.buffer],a=o.byteOffset+t.byteOffset,c=t.count*ps(t.type),u=M4e.test(s.uri)?"":s.uri;return`${e.cacheKey}//${u}/${a}/${c}`}var Woe={};lN.getAnimationParameterValues=function(e,t){let n=Yoe(e,t),i=Woe[n];if(!l(i)){let r=e.gltfInternal,o=r.buffers,a=r.bufferViews[t.bufferView],c=a.buffer,f=o[c].extras._pipeline.source,d=t.componentType,p=t.type,g=ps(p),m=t.count,x=_s(r,t);i=new Array(m);let C=y(t.byteOffset,0),A=a.byteOffset+C;for(let b=0;b<m;b++){let T=K.createArrayBufferView(d,f.buffer,f.byteOffset+A,g);p==="SCALAR"?i[b]=T[0]:p==="VEC3"?i[b]=h.fromArray(T):p==="VEC4"&&(i[b]=Re.unpack(T)),A+=x}l(e.cacheKey)&&(Woe[n]=i)}return i};var joe={};function B4e(e,t,n){return`${e.cacheKey}//${t}/${n}`}function tb(e){this._spline=e,this._lastTimeIndex=0}tb.prototype.findTimeInterval=qi.prototype.findTimeInterval;tb.prototype.evaluate=function(e,t){let n=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),i=this._spline.times,r=e>=i[n+1]?i[n+1]:i[n];return this._spline.evaluate(r,t)};Object.defineProperties(tb.prototype,{times:{get:function(){return this._spline.times}}});tb.prototype.wrapTime=function(e){return this._spline.wrapTime(e)};tb.prototype.clampTime=function(e){return this._spline.clampTime(e)};lN.getAnimationSpline=function(e,t,n,i,r,o,s,a){let c=B4e(e,t,i),u=joe[c];if(!l(u)){let f=o,d=a;f.length===1&&d.length===1?u=new vA(d[0]):(r.interpolation==="LINEAR"||r.interpolation==="STEP")&&(s==="translation"||s==="scale"?u=new jm({times:f,points:d}):s==="rotation"?u=new iT({times:f,points:d}):s==="weights"&&(u=new EO({times:f,weights:d})),l(u)&&r.interpolation==="STEP"&&(u=new tb(u))),l(e.cacheKey)&&(joe[c]=u)}return u};var qoe={};lN.getSkinInverseBindMatrices=function(e,t){let n=Yoe(e,t),i=qoe[n];if(!l(i)){let r=e.gltfInternal,o=r.buffers,s=r.bufferViews,a=t.bufferView,c=s[a],u=c.buffer,d=o[u].extras._pipeline.source,p=t.componentType,g=t.type,m=t.count,x=_s(r,t),C=c.byteOffset+t.byteOffset,A=ps(g);if(i=new Array(m),p===Z.FLOAT&&g===qt.MAT4)for(let b=0;b<m;++b){let T=K.createArrayBufferView(p,d.buffer,d.byteOffset+C,A);i[b]=N.fromArray(T),C+=x}qoe[n]=i}return i};var ux=lN;var L4e={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},Xr=Object.freeze(L4e);var Ws=Object.freeze({STOPPED:0,ANIMATING:1});function Xoe(e,t,n){this._name=n.name,this._startTime=ee.clone(e.startTime),this._delay=y(e.delay,0),this._stopTime=e.stopTime,this.removeOnStop=y(e.removeOnStop,!1),this._multiplier=y(e.multiplier,1),this._reverse=y(e.reverse,!1),this._loop=y(e.loop,Xr.NONE),this._animationTime=e.animationTime,this._prevAnimationDelta=void 0,this.start=new ge,this.update=new ge,this.stop=new ge,this._state=Ws.STOPPED,this._runtimeAnimation=n,this._computedStartTime=void 0,this._duration=void 0;let i=this;this._raiseStartEvent=function(){i.start.raiseEvent(t,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(t,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(t,i)}}Object.defineProperties(Xoe.prototype,{name:{get:function(){return this._name}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},animationTime:{get:function(){return this._animationTime}}});var uN=Xoe;function Tp(e){this.animationAdded=new ge,this.animationRemoved=new ge,this.animateWhilePaused=!1,this._model=e,this._scheduledAnimations=[],this._previousTime=void 0}Object.defineProperties(Tp.prototype,{length:{get:function(){return this._scheduledAnimations.length}}});function z6(e,t,n){let i=e._model,o=i._runtime.animations[t],s=new uN(n,i,o);return e._scheduledAnimations.push(s),e.animationAdded.raiseEvent(i,s),s}Tp.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model._runtime.animations;if(l(e.index))return z6(this,e.index,e);let i,r=n.length;for(let o=0;o<r;++o)if(n[o].name===e.name){i=o;break}return z6(this,i,e)};Tp.prototype.addAll=function(e){e=y(e,y.EMPTY_OBJECT);let t=[],r=this._model._runtime.animations.length;for(let o=0;o<r;++o)t.push(z6(this,o,e));return t};Tp.prototype.remove=function(e){if(l(e)){let t=this._scheduledAnimations,n=t.indexOf(e);if(n!==-1)return t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0}return!1};Tp.prototype.removeAll=function(){let e=this._model,t=this._scheduledAnimations,n=t.length;this._scheduledAnimations=[];for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])};Tp.prototype.contains=function(e){return l(e)?this._scheduledAnimations.indexOf(e)!==-1:!1};Tp.prototype.get=function(e){return this._scheduledAnimations[e]};function N4e(e,t){let n=e.channelEvaluators,i=n.length;for(let r=0;r<i;++r)n[r](t)}var fN=[];function F4e(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}Tp.prototype.update=function(e){let t=this._scheduledAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&ee.equals(e.time,this._previousTime))return!1;this._previousTime=ee.clone(e.time,this._previousTime);let i=!1,r=e.time,o=this._model;for(let s=0;s<n;++s){let a=t[s],c=a._runtimeAnimation;l(a._computedStartTime)||(a._computedStartTime=ee.addSeconds(y(a.startTime,r),a.delay,new ee)),l(a._duration)||(a._duration=c.stopTime*(1/a.multiplier));let u=a._computedStartTime,f=a._duration,d=a.stopTime,p=ee.lessThanOrEquals(u,r),g=l(d)&&ee.greaterThan(r,d),m=0;if(f!==0){let A=ee.secondsDifference(g?d:r,u);m=l(a._animationTime)?a._animationTime(f,A):A/f}let x=a.loop===Xr.REPEAT||a.loop===Xr.MIRRORED_REPEAT,C=(p||x&&!l(a.startTime))&&(m<=1||x)&&!g;if(m===a._prevAnimationDelta){let A=a._state===Ws.STOPPED;if(C!==A)continue}if(a._prevAnimationDelta=m,C||a._state===Ws.ANIMATING){if(C&&a._state===Ws.STOPPED&&(a._state=Ws.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Xr.REPEAT)m=m-Math.floor(m);else if(a.loop===Xr.MIRRORED_REPEAT){let b=Math.floor(m),T=m-b;m=b%2===1?1-T:T}a.reverse&&(m=1-m);let A=m*f*a.multiplier;A=M.clamp(A,c.startTime,c.stopTime),N4e(c,A),a.update.numberOfListeners>0&&(a._updateEventTime=A,e.afterRender.push(a._raiseUpdateEvent)),i=!0,C||(a._state=Ws.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&fN.push(a))}}n=fN.length;for(let s=0;s<n;++s){let a=fN[s];t.splice(t.indexOf(a),1),e.afterRender.push(F4e(this,o,a))}return fN.length=0,i};var dN=Tp;function hN(e,t,n){this._name=t.name,this._id=n,this._uniformMap=e._uniformMaps[n],this._technique=void 0,this._program=void 0,this._values=void 0}Object.defineProperties(hN.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}}});hN.prototype.setValue=function(e,t){let n=`u_${e}`,i=this._uniformMap.values[n];i.value=i.clone(t,i.value)};hN.prototype.getValue=function(e){let t=`u_${e}`,n=this._uniformMap.values[t];if(!!l(n))return n.value};var mN=hN;function Koe(e,t,n){let i=[],r=e.primitives,o=r.length;for(let s=0;s<o;++s){let a=r[s];i[s]=t[a.material]}this._name=e.name,this._materials=i,this._id=n}Object.defineProperties(Koe.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},materials:{get:function(){return this._materials}}});var pN=Koe;function H6(e,t,n,i,r){this._model=e,this._runtimeNode=n,this._name=t.name,this._id=i,this.useMatrix=!1,this._show=!0,this._matrix=N.clone(r),this._originalMatrix=N.clone(r)}Object.defineProperties(H6.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,this._model._perNodeShowDirty=!0)}},matrix:{get:function(){return this._matrix},set:function(e){this._matrix=N.clone(e,this._matrix),this.useMatrix=!0;let t=this._model;t._cesiumAnimationsDirty=!0,this._runtimeNode.dirtyNumber=t._maxDirtyNumber}},originalMatrix:{get:function(){return this._originalMatrix}}});H6.prototype.setMatrix=function(e){N.clone(e,this._matrix)};var _N=H6;var V4e=65534;function Xw(){}Xw.hasExtension=function(e){return l(e.extensionsRequired.CESIUM_primitive_outline)||l(e.extensionsUsed.CESIUM_primitive_outline)};Xw.outlinePrimitives=function(e){if(!Xw.hasExtension(e))return;let t=e.gltfInternal,n=[];Ae.mesh(t,function(i,r){Ae.meshPrimitive(i,function(o,s){if(!l(o.extensions))return;let a=o.extensions.CESIUM_primitive_outline;if(!l(a))return;let c=G4e(e,o);c!==void 0&&(n.indexOf(c)<0&&n.push(c),k4e(e,r,s,a.indices,c))})});for(let i=0;i<n.length;++i)U4e(e,n[i].bufferViews);z4e(e)};Xw.createTexture=function(e,t){let n=t.cache.modelOutliningCache;if(l(n)||(n=t.cache.modelOutliningCache={}),l(n.outlineTexture))return n.outlineTexture;let i=Math.min(4096,Bt.maximumTextureSize),r=i,o=Zoe(r),s=[];for(;r>1;)r>>=1,s.push(Zoe(r));let a=new wt({context:t,source:{arrayBufferView:o,mipLevels:s},width:i,height:1,pixelFormat:ct.LUMINANCE,sampler:new on({wrapS:mn.CLAMP_TO_EDGE,wrapT:mn.CLAMP_TO_EDGE,minificationFilter:It.LINEAR_MIPMAP_LINEAR,magnificationFilter:Xi.LINEAR})});return n.outlineTexture=a,a};function k4e(e,t,n,i,r){let o=r.vertexCopies,s=r.extraVertices,a=r.outlineCoordinates,c=e.gltfInternal,f=c.meshes[t].primitives[n],d=c.accessors,p=c.bufferViews,g;for(let L in f.attributes)if(f.attributes.hasOwnProperty(L)){let _=f.attributes[L],E=d[_];if(l(E)){g=E.count;break}}if(!l(g))return;let m=d[f.indices],x=p[m.bufferView],C=d[i],A=p[C.bufferView],b=e._loadResources,T=b.getBuffer(x),S=b.getBuffer(A),w=m.componentType===5123?new Uint16Array(T.buffer,T.byteOffset+m.byteOffset,m.count):new Uint32Array(T.buffer,T.byteOffset+m.byteOffset,m.count),D=C.componentType===5123?new Uint16Array(S.buffer,S.byteOffset+C.byteOffset,C.count):new Uint32Array(S.buffer,S.byteOffset+C.byteOffset,C.count),I=g,O=[I],B;for(B=0;B<D.length;B+=2){let L=D[B],_=D[B+1],E=Math.min(L,_),v=Math.max(L,_);O[E*I+v]=1}for(B=0;B<w.length;B+=3){let L=w[B],_=w[B+1],E=w[B+2],v=!1,P=v||j6(O,L,_),R=v||j6(O,_,E),F=v||j6(O,E,L),U=$oe(a,L,_,E,P,R,F);for(;U>=0;){let k;if(U===L?k=o[L]:U===_?k=o[_]:k=o[E],k===void 0){k=g+s.length;let H=U;for(;H>=g;)H=s[H-g];s.push(H),o[U]=k}k>V4e&&w instanceof Uint16Array&&(w=new Uint32Array(w),m.componentType=5125,x.buffer=c.buffers.push({byteLength:w.byteLength,extras:{_pipeline:{source:w.buffer}}})-1,x.byteLength=w.byteLength,x.byteOffset=0,e._loadResources.buffers[x.buffer]=new Uint8Array(w.buffer,0,w.byteLength),b.indexBuffersToCreate._array.forEach(function(H){!l(H)||H.id===m.bufferView&&(H.componentType=m.componentType)})),U===L?(L=k,w[B]=k):U===_?(_=k,w[B+1]=k):(E=k,w[B+2]=k),l(m.max)&&(m.max[0]=Math.max(m.max[0],k)),U=$oe(a,L,_,E,P,R,F)}}}function G6(e,t,n,i,r){let o=t*3,s=e[o],a=e[o+1],c=e[o+2];return s===void 0?63:((s===n&&a===i&&c===r)<<0)+((s===n&&a===r&&c===i)<<1)+((s===i&&a===n&&c===r)<<2)+((s===i&&a===r&&c===n)<<3)+((s===r&&a===n&&c===i)<<4)+((s===r&&a===i&&c===n)<<5)}function W6(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}function $oe(e,t,n,i,r,o,s){let a=s?1:0,c=r?1:0,u=0,f=G6(e,t,a,c,u);if(f===0)return t;let d=0,p=r?1:0,g=o?1:0,m=G6(e,n,d,p,g);if(m===0)return n;let x=s?1:0,C=0,A=o?1:0,b=G6(e,i,x,C,A);if(b===0)return i;let T=f&m&b,S,w,D;if(T&1<<0)S=0,w=1,D=2;else if(T&1<<1)S=0,D=1,w=2;else if(T&1<<2)w=0,S=1,D=2;else if(T&1<<3)w=0,D=1,S=2;else if(T&1<<4)D=0,S=1,w=2;else if(T&1<<5)D=0,w=1,S=2;else{let L=W6(f),_=W6(m),E=W6(b);return L<_&&L<E?t:_<E?n:i}let I=t*3;e[I+S]=a,e[I+w]=c,e[I+D]=u;let O=n*3;e[O+S]=d,e[O+w]=p,e[O+D]=g;let B=i*3;return e[B+S]=x,e[B+w]=C,e[B+D]=A,-1}function j6(e,t,n){let i=e[0],r=Math.min(t,n)*i+Math.max(t,n);return e[r]===1}function Zoe(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function U4e(e,t){let n=e.gltfInternal,i=e._loadResources,r,o;for(r=0;r<t.length;++r){let s=t[r],a=s.extras._pipeline.vertexNumberingScope;s.extras._pipeline.vertexNumberingScope=void 0;let c=a.extraVertices,u=i.getBuffer(s),f=s.byteStride||4,d=c.length,p=new Uint8Array(u.byteLength+d*f);for(p.set(u),o=0;o<d;++o){let x=c[o]*f,C=u.length+o*f;for(let A=0;A<f;++A)p[C+A]=p[x+A]}s.byteOffset=0,s.byteLength=p.byteLength;let g=n.buffers.push({byteLength:p.byteLength,extras:{_pipeline:{source:p.buffer}}})-1;s.buffer=g,i.buffers[g]=p;let m=a.accessors;for(o=0;o<m.length;++o){let x=m[o];n.accessors[x].count+=d}if(!a.createdOutlines){let x=a.outlineCoordinates,C=new Float32Array(x),A=e.gltfInternal.buffers.push({byteLength:C.byteLength,extras:{_pipeline:{source:C.buffer}}})-1;i.buffers[A]=new Uint8Array(C.buffer,0,C.byteLength);let b=e.gltfInternal.bufferViews.push({buffer:A,byteLength:C.byteLength,byteOffset:0,byteStride:3*Float32Array.BYTES_PER_ELEMENT,target:34962})-1,T=e.gltfInternal.accessors.push({bufferView:b,byteOffset:0,componentType:5126,count:C.length/3,type:"VEC3",min:[0,0,0],max:[1,1,1]})-1,S=a.primitives;for(o=0;o<S.length;++o)S[o].attributes._OUTLINE_COORDINATES=T;i.vertexBuffersToCreate.enqueue(b),a.createdOutlines=!0}}}function z4e(e){let t=e.gltfInternal,n=e._loadResources,i;for(i=0;i<t.buffers.length;++i){let r=t.buffers[i],o=t.bufferViews.filter(H4e.bind(void 0,i)),s=o.reduce(function(u,f){return u+f.byteLength},0);if(s===r.byteLength)continue;let a=new Uint8Array(s),c=0;for(let u=0;u<o.length;++u){let f=o[u],d=n.getBuffer(f);a.set(d,c),f.byteOffset=c,c+=d.byteLength}n.buffers[i]=a,r.extras._pipeline.source=a.buffer,r.byteLength=s}}function H4e(e,t){return t.buffer===e}function G4e(e,t){let n=t.attributes;if(n===void 0)return;let i=e.gltfInternal,r;for(let o in n){if(!n.hasOwnProperty(o))continue;let s=n[o],c=i.accessors[s].bufferView,u=i.bufferViews[c];if(l(u.extras)||(u.extras={}),l(u.extras._pipeline)||(u.extras._pipeline={}),!l(u.extras._pipeline.vertexNumberingScope))u.extras._pipeline.vertexNumberingScope=r||{vertexCopies:[],extraVertices:[],outlineCoordinates:[],accessors:[],bufferViews:[],primitives:[],createdOutlines:!1};else if(r!==void 0&&u.extras._pipeline.vertexNumberingScope!==r)return;r=u.extras._pipeline.vertexNumberingScope,r.bufferViews.indexOf(u)<0&&r.bufferViews.push(u),r.accessors.indexOf(s)<0&&r.accessors.push(s)}return r.primitives.push(t),r}var Kw=Xw;var W4e={LEFT:-1,NONE:0,RIGHT:1},as=Object.freeze(W4e);var j4e={modifyFragmentShader:function(t){return t=Fe.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection;
- void main()
- {
- #ifndef SHADOW_MAP
- if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
- if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
- #endif
- czm_splitter_main();
- }
- `,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},vg=j4e;var q4e=new h,Dg=$t.ModelState,Y4e="model/gltf-binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01",X4e=M.EPSILON16;function J6(e,t){e._cachedGltf=t}function Zw(e){this._gltf=e.gltf,this.ready=e.ready,this.modelsToLoad=[],this.count=0}Object.defineProperties(Zw.prototype,{gltf:{set:function(e){this._gltf=e},get:function(){return this._gltf}}});Zw.prototype.makeReady=function(e){this.gltf=e;let t=this.modelsToLoad,n=t.length;for(let i=0;i<n;++i){let r=t[i];r.isDestroyed()||J6(r,this)}this.modelsToLoad=void 0,this.ready=!0};var Ig={},Joe={};function qs(e){e=y(e,y.EMPTY_OBJECT);let t=e.cacheKey;this._cacheKey=t,this._cachedGltf=void 0,this._releaseGltfJson=y(e.releaseGltfJson,!1),this._marsOptions=y(e.marsOptions,{}),this._marsOptions.edit=y(this._marsOptions.edit,!0);let n;if(l(t)&&l(Ig[t])&&Ig[t].ready)n=Ig[t],++n.count;else{let s=e.gltf;if(l(s)){if(s instanceof ArrayBuffer&&(s=new Uint8Array(s)),s instanceof Uint8Array){let a=xp(s);n=new Zw({gltf:a,ready:!0})}else n=new Zw({gltf:e.gltf,ready:!0});n.count=1,l(t)&&(Ig[t]=n)}}J6(this,n);let i=y(e.basePath,"");this._resource=De.createIfNeeded(i);let r=e.credit;typeof r=="string"&&(r=new Gt(r)),this._credit=r,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this.show=y(e.show,!0),this.silhouetteColor=y(e.silhouetteColor,z.RED),this._silhouetteColor=new z,this._silhouetteColorPreviousAlpha=1,this._normalAttributeName=void 0,this.silhouetteSize=y(e.silhouetteSize,0),this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this._modelMatrix=N.clone(this.modelMatrix),this._clampedModelMatrix=void 0,this.scale=y(e.scale,1),this._scale=this.scale,this.minimumPixelSize=y(e.minimumPixelSize,0),this._minimumPixelSize=this.minimumPixelSize,this.maximumScale=e.maximumScale,this._maximumScale=this.maximumScale,this.id=e.id,this._id=e.id,this.heightReference=y(e.heightReference,ze.NONE),this._heightReference=this.heightReference,this._heightChanged=!1,this._removeUpdateHeightCallback=void 0;let o=e.scene;this._scene=o,l(o)&&l(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(function(){this._heightChanged=!0},this)),this._pickObject=e.pickObject,this._allowPicking=y(e.allowPicking,!0),this._ready=!1,this._readyPromise=ts(),this.activeAnimations=new dN(this),this.clampAnimations=y(e.clampAnimations,!0),this._defaultTexture=void 0,this._incrementallyLoadTextures=y(e.incrementallyLoadTextures,!0),this._asynchronous=y(e.asynchronous,!0),this.shadows=y(e.shadows,Zt.ENABLED),this._shadows=this.shadows,this.color=z.clone(y(e.color,z.WHITE)),this._colorPreviousAlpha=1,this.colorBlendMode=y(e.colorBlendMode,Ds.HIGHLIGHT),this.colorBlendAmount=y(e.colorBlendAmount,.5),this._colorShadingEnabled=!1,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._clippingPlanesState=0,this.referenceMatrix=void 0,this.backFaceCulling=y(e.backFaceCulling,!0),this.showOutline=y(e.showOutline,!0),this.splitDirection=y(e.splitDirection,as.NONE),this._splittingEnabled=!1,this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=y(e.debugWireframe,!1),this._debugWireframe=!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._addBatchIdToGeneratedShaders=e.addBatchIdToGeneratedShaders,this._precreatedAttributes=e.precreatedAttributes,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._pickIdLoaded=e.pickIdLoaded,this._ignoreCommands=y(e.ignoreCommands,!1),this._requestType=e.requestType,this._upAxis=y(e.upAxis,On.Y),this._gltfForwardAxis=On.Z,this._forwardAxis=e.forwardAxis,this.cull=y(e.cull,!0),this.opaquePass=y(e.opaquePass,Ce.OPAQUE),this._computedModelMatrix=new N,this._clippingPlanesMatrix=N.clone(N.IDENTITY),this._iblReferenceFrameMatrix=Q.clone(Q.IDENTITY),this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new re,this._state=Dg.NEEDS_LOAD,this._loadResources=void 0,this._mode=void 0,this._perNodeShowDirty=!1,this._cesiumAnimationsDirty=!1,this._dirty=!1,this._maxDirtyNumber=0,this._runtime={animations:void 0,articulationsByName:void 0,articulationsByStageKey:void 0,stagesByKey:void 0,rootNodes:void 0,nodes:void 0,nodesByName:void 0,skinnedNodes:void 0,meshesByName:void 0,materialsByName:void 0,materialsById:void 0},this._uniformMaps={},this._extensionsUsed=void 0,this._extensionsRequired=void 0,this._quantizedUniforms={},this._programPrimitives={},this._rendererResources={buffers:{},vertexArrays:{},programs:{},sourceShaders:{},silhouettePrograms:{},textures:{},samplers:{},renderStates:{}},this._cachedRendererResources=void 0,this._loadRendererResourcesFromCache=!1,e.dequantizeInShader&&di("Model.dequantizeInShader","The Model dequantizeInShader constructor parameter was deprecated in CesiumJS 1.94 and will be removed in 1.97"),this._dequantizeInShader=y(e.dequantizeInShader,!0),this._decodedData={},this._cachedGeometryByteLength=0,this._cachedTexturesByteLength=0,this._geometryByteLength=0,this._texturesByteLength=0,this._trianglesLength=0,this._pointsLength=0,this._sourceTechniques={},this._sourcePrograms={},this._quantizedVertexShaders={},this._nodeCommands=[],this._pickIds=[],this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._rtcCenter3D=void 0,this._rtcCenter2D=void 0,this._sourceVersion=void 0,this._sourceKHRTechniquesWebGL=void 0,this._lightColor=h.clone(e.lightColor),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new Pc,this._shouldDestroyImageBasedLighting=!0),this._shouldRegenerateShaders=!1}Object.defineProperties(qs.prototype,{gltf:{get:function(){return di("Model.gltf","Model.gltf getter was deprecated in CesiumJS 1.94 and will be removed in 1.97"),this.gltfInternal}},gltfInternal:{get:function(){return l(this._cachedGltf)?this._cachedGltf.gltf:void 0}},releaseGltfJson:{get:function(){return this._releaseGltfJson}},cacheKey:{get:function(){return this._cacheKey}},basePath:{get:function(){return di("model.basePath","Model.basePath getter is deprecated in CesiumJS 1.94. It will be removed in CesiumJS 1.97"),this.basePathInternal}},basePathInternal:{get:function(){return this._resource.url}},boundingSphere:{get:function(){let e=this.modelMatrix;this.heightReference!==ze.NONE&&this._clampedModelMatrix&&(e=this._clampedModelMatrix);let t=l(this.maximumScale)?Math.min(this.maximumScale,this.scale):this.scale,n=re.clone(this._boundingSphere,this._scaledBoundingSphere);return n.radius*=t,re.transform(n,e,n),l(this._rtcCenter)&&h.add(this._rtcCenter,n.center,n.center),n}},boundingSphereInternal:{get:function(){let e=this.modelMatrix;this.heightReference!==ze.NONE&&this._clampedModelMatrix&&(e=this._clampedModelMatrix);let t=N.getScale(e,q4e),n=l(this.maximumScale)?Math.min(this.maximumScale,this.scale):this.scale;h.multiplyByScalar(t,n,t);let i=this._scaledBoundingSphere;return i.center=h.multiplyComponents(this._boundingSphere.center,t,i.center),i.radius=h.maximumComponent(t)*this._initialRadius,l(this._rtcCenter)&&h.add(this._rtcCenter,i.center,i.center),i}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},asynchronous:{get:function(){return this._asynchronous}},allowPicking:{get:function(){return this._allowPicking}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},pendingTextureLoads:{get:function(){return di("Model.pendingTextureLoads","The Model.pendingTextureLoads getter was deprecated in CesiumJS 1.94 and will be removed in CesiumJS 1.97"),this.pendingTextureLoadsInternal}},pendingTextureLoadsInternal:{get:function(){return l(this._loadResources)?this._loadResources.pendingTextureLoads:0}},dirty:{get:function(){return this._dirty}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Tt.clone(e,this._distanceDisplayCondition)}},extensionsUsed:{get:function(){return l(this._extensionsUsed)||(this._extensionsUsed=$t.getUsedExtensions(this.gltfInternal)),this._extensionsUsed}},extensionsRequired:{get:function(){return l(this._extensionsRequired)||(this._extensionsRequired=$t.getRequiredExtensions(this.gltfInternal)),this._extensionsRequired}},upAxis:{get:function(){return this._upAxis}},forwardAxis:{get:function(){return l(this._forwardAxis)?this._forwardAxis:this._gltfForwardAxis}},trianglesLength:{get:function(){return this._trianglesLength}},pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},texturesByteLength:{get:function(){return this._texturesByteLength}},cachedGeometryByteLength:{get:function(){return this._cachedGeometryByteLength}},cachedTexturesByteLength:{get:function(){return this._cachedTexturesByteLength}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&vs.setOwner(e,this,"_clippingPlanes")}},pickIds:{get:function(){return this._pickIds}},lightColor:{get:function(){return this._lightColor},set:function(e){let t=this._lightColor;e===t||h.equals(e,t)||(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(t)&&!l(e)||l(e)&&!l(t),this._lightColor=h.clone(e,t))}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this._shouldRegenerateShaders=!0)}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){if(this._showCreditsOnScreen!==e){l(this._credit)&&(this._credit.showOnScreen=e);let t=this._resourceCredits.length;for(let i=0;i<t;i++)this._resourceCredits[i].showOnScreen=e;let n=this._gltfCredits.length;for(let i=0;i<n;i++)this._gltfCredits[i].showOnScreen=e}this._showCreditsOnScreen=e}}});function use(e){return e.stencilBuffer}function Q6(e){return!z.equals(e.color,z.WHITE)||e.colorBlendMode!==Ds.HIGHLIGHT}function e9(e){let t=e._clippingPlanes;return l(t)&&t.enabled&&t.length!==0}qs.silhouetteSupported=function(e){return use(e.context)};function K4e(e){return Gu(e)==="glTF"}qs.fromGltf=function(e){let t=e.url;e=$e(e);let n=De.createIfNeeded(t),i=y(e.basePath,n.clone()),r=De.createIfNeeded(i),o=y(e.cacheKey,Joe[Wf(n.url)]);l(o)||(o=Ln(),Joe[Wf(n.url)]=o),l(e.basePath)&&!l(e.cacheKey)&&(o+=r.url),e.cacheKey=o,e.basePath=r;let s=new qs(e),a=Ig[o];return l(a)?a.ready||(++a.count,a.modelsToLoad.push(s)):(a=new Zw({ready:!1}),a.count=1,a.modelsToLoad.push(s),J6(s,a),Ig[o]=a,l(n.headers.Accept)||(n.headers.Accept=Y4e),n.fetchArrayBuffer().then(function(c){let u=new Uint8Array(c);if(K4e(u)){let p=xp(u);a.makeReady(p)}else{let p=Vr(u);a.makeReady(p)}let f=s._resourceCredits,d=n.credits;if(l(d)){let p=d.length;for(let g=0;g<p;g++)f.push(d[g])}}).catch($t.getFailedLoadFunction(s,"model",n.url))),s};qs._gltfCache=Ig;function Jw(e,t,n){return e._runtime[t][n]}qs.prototype.getNode=function(e){let t=Jw(this,"nodesByName",e);return l(t)?t.publicNode:void 0};qs.prototype.getMesh=function(e){return Jw(this,"meshesByName",e)};qs.prototype.getMaterial=function(e){return Jw(this,"materialsByName",e)};qs.prototype.setArticulationStage=function(e,t){let n=Jw(this,"stagesByKey",e),i=Jw(this,"articulationsByStageKey",e);l(n)&&l(i)&&(t=M.clamp(t,n.minimumValue,n.maximumValue),M.equalsEpsilon(n.currentValue,t,X4e)||(n.currentValue=t,i.isDirty=!0))};var $4e=new h,q6=new Q;function fse(e,t){let n=e.currentValue,i=$4e,r;switch(e.type){case"xRotate":r=Q.fromRotationX(M.toRadians(n),q6),N.multiplyByMatrix3(t,r,t);break;case"yRotate":r=Q.fromRotationY(M.toRadians(n),q6),N.multiplyByMatrix3(t,r,t);break;case"zRotate":r=Q.fromRotationZ(M.toRadians(n),q6),N.multiplyByMatrix3(t,r,t);break;case"xTranslate":i.x=n,i.y=0,i.z=0,N.multiplyByTranslation(t,i,t);break;case"yTranslate":i.x=0,i.y=n,i.z=0,N.multiplyByTranslation(t,i,t);break;case"zTranslate":i.x=0,i.y=0,i.z=n,N.multiplyByTranslation(t,i,t);break;case"xScale":i.x=n,i.y=1,i.z=1,N.multiplyByScale(t,i,t);break;case"yScale":i.x=1,i.y=n,i.z=1,N.multiplyByScale(t,i,t);break;case"zScale":i.x=1,i.y=1,i.z=n,N.multiplyByScale(t,i,t);break;case"uniformScale":N.multiplyByUniformScale(t,n,t);break;default:break}return t}var Z4e=new N;qs.prototype.applyArticulations=function(){let e=this._runtime.articulationsByName;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];if(n.isDirty){n.isDirty=!1;let i=n.nodes.length;for(let r=0;r<i;++r){let o=n.nodes[r],s=N.clone(o.originalMatrix,Z4e),a=n.stages.length;for(let c=0;c<a;++c){let u=n.stages[c];s=fse(u,s)}o.matrix=s}}}};function J4e(e){let t=e.gltfInternal,n=e._loadResources;Ae.buffer(t,function(i,r){n.buffers[r]=i.extras._pipeline.source})}function Q4e(e,t){return function(n){let i=e._loadResources,r=new Uint8Array(n);--i.pendingBufferLoads,e.gltfInternal.buffers[t].extras._pipeline.source=r}}function eze(e){let t=e.gltfInternal.bufferViews,n=e._loadResources.vertexBuffersToCreate;Ae.bufferView(e.gltfInternal,function(o,s){o.target===Z.ARRAY_BUFFER&&n.enqueue(s)});let i=e._loadResources.indexBuffersToCreate,r={};Ae.accessor(e.gltfInternal,function(o){let s=o.bufferView;if(!l(s))return;t[s].target===Z.ELEMENT_ARRAY_BUFFER&&!l(r[s])&&(r[s]=!0,i.enqueue({id:s,componentType:o.componentType}))})}function tze(e){let t=e.gltfInternal;if(!Ur(t,"KHR_techniques_webgl"))return;let n=e._sourcePrograms,i=e._sourceTechniques,r=t.extensions.KHR_techniques_webgl.programs;Ae.technique(t,function(o,s){i[s]=$e(o);let a=o.program;l(n[a])||(n[a]=$e(r[a]))})}function nze(e,t,n){return function(i){let r=e._loadResources;r.shaders[n]={source:i,type:t,bufferView:void 0},--r.pendingShaderLoads,e._rendererResources.sourceShaders[n]=i}}function ize(e){let t=e.gltfInternal,n=t.buffers,i=t.bufferViews,r=e._rendererResources.sourceShaders;Ae.shader(t,function(o,s){if(l(o.bufferView)){let a=o.bufferView,c=i[a],u=c.buffer,f=n[u],d=fa(f.extras._pipeline.source,c.byteOffset,c.byteLength);r[s]=d}else if(l(o.extras._pipeline.source))r[s]=o.extras._pipeline.source;else{++e._loadResources.pendingShaderLoads;let a=e._resource.getDerivedResource({url:o.uri});a.fetchText().then(nze(e,o.type,s)).catch($t.getFailedLoadFunction(e,"shader",a.url))}})}function rze(e){let t=e._sourceTechniques;for(let n in t)if(t.hasOwnProperty(n)){let i=t[n];e._loadResources.programsToCreate.enqueue({programId:i.program,techniqueId:n})}}function oze(e){let t={},n={},i={};e._runtime.articulationsByName=t,e._runtime.articulationsByStageKey=n,e._runtime.stagesByKey=i;let r=e.gltfInternal;if(!Ur(r,"AGI_articulations")||!l(r.extensions)||!l(r.extensions.AGI_articulations))return;let o=r.extensions.AGI_articulations.articulations;if(!l(o))return;let s=o.length;for(let a=0;a<s;++a){let c=$e(o[a]);c.nodes=[],c.isDirty=!0,t[c.name]=c;let u=c.stages.length;for(let f=0;f<u;++f){let d=c.stages[f];d.currentValue=d.initialValue;let p=`${c.name} ${d.name}`;n[p]=c,i[p]=d}}}function dse(e,t){return function(n){let i=e._loadResources;--i.pendingTextureLoads;let r;Array.isArray(n)&&(r=n.slice(1,n.length).map(function(o){return o.bufferView}),n=n[0]),i.texturesToCreate.enqueue({id:t,image:n,bufferView:n.bufferView,width:n.width,height:n.height,internalFormat:n.internalFormat,mipLevels:r})}}var sze=/(^data:image\/ktx2)|(\.ktx2$)/i;function aze(e,t,n){let i=e.gltfInternal,r=i.images,o;Ae.texture(i,function(s,a){let c=s.source;l(s.extensions)&&l(s.extensions.EXT_texture_webp)&&n?c=s.extensions.EXT_texture_webp.source:l(s.extensions)&&l(s.extensions.KHR_texture_basisu)&&t.supportsBasis&&(c=s.extensions.KHR_texture_basisu.source);let u=r[c],f=u.bufferView,d=u.mimeType;if(o=u.uri,l(f))e._loadResources.texturesToCreateFromBufferView.enqueue({id:a,image:void 0,bufferView:f,mimeType:d});else{++e._loadResources.pendingTextureLoads;let p=e._resource.getDerivedResource({url:o}),g;sze.test(o)?g=Ua(p):g=p.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0}),g.then(dse(e,a,c)).catch($t.getFailedLoadFunction(e,"image",p.url))}})}var cze=new N;function lze(e){let t={},n={},i=[],r=e._loadResources.skinnedNodesIds,o=e._runtime.articulationsByName;Ae.node(e.gltfInternal,function(s,a){let c={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,computedShow:!0,transformToRoot:new N,computedMatrix:new N,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointName:s.jointName,weights:[],children:[],parents:[],publicNode:void 0};if(c.publicNode=new _N(e,s,c,a,$t.getTransform(s)),t[a]=c,n[s.name]=c,l(s.skin)&&(r.push(a),i.push(c)),l(s.extensions)&&l(s.extensions.AGI_articulations)){let u=s.extensions.AGI_articulations.articulationName;if(l(u)){let f=N.clone(c.publicNode.originalMatrix,cze),d=o[u];d.nodes.push(c.publicNode);let p=d.stages.length;for(let g=0;g<p;++g){let m=d.stages[g];f=fse(m,f)}c.publicNode.matrix=f}}}),e._runtime.nodes=t,e._runtime.nodesByName=n,e._runtime.skinnedNodes=i}function uze(e){let t=e.gltfInternal,n=e._sourceTechniques,i={},r={},o=e._uniformMaps;Ae.material(t,function(s,a){o[a]={uniformMap:void 0,values:void 0,jointMatrixUniformName:void 0,morphWeightsUniformName:void 0};let c=new mN(e,s,a);if(l(s.extensions)&&l(s.extensions.KHR_techniques_webgl)){let u=s.extensions.KHR_techniques_webgl.technique;c._technique=u,c._program=n[u].program,Ae.materialValue(s,function(f,d){l(c._values)||(c._values={}),c._values[d]=$e(f)})}i[s.name]=c,r[a]=c}),e._runtime.materialsByName=i,e._runtime.materialsById=r}function fze(e){let t={},n=e._runtime.materialsById;Ae.mesh(e.gltfInternal,function(i,r){t[i.name]=new pN(i,n,r),(l(e.extensionsUsed.WEB3D_quantized_attributes)||e._dequantizeInShader)&&Ae.meshPrimitive(i,function(o,s){let a=i9(e,o),c=e._programPrimitives[a];l(c)||(c={},e._programPrimitives[a]=c),c[`${r}.primitive.${s}`]=o})}),e._runtime.meshesByName=t}function dze(e){let n=e.gltfInternal.asset.copyright;if(!l(n))return;let i=e._showCreditsOnScreen,r=n.split(";").map(function(o){return new Gt(o.trim(),i)});e._gltfCredits=r}var t9=function(){this.id=void 0,this.model=void 0,this.context=void 0};t9.prototype.set=function(e,t,n){this.id=e,this.model=t,this.context=n};t9.prototype.execute=function(){hse(this.id,this.model,this.context)};function hse(e,t,n){let i=t._loadResources,o=t.gltfInternal.bufferViews[e];l(o)||(o=i.createdBufferViews[e]);let s=at.createVertexBuffer({context:n,typedArray:i.getBuffer(o),usage:Ne.STATIC_DRAW});s.vertexArrayDestroyable=!1,t._rendererResources.buffers[e]=s,t._geometryByteLength+=s.sizeInBytes}var n9=function(){this.id=void 0,this.componentType=void 0,this.model=void 0,this.context=void 0};n9.prototype.set=function(e,t,n,i){this.id=e,this.componentType=t,this.model=n,this.context=i};n9.prototype.execute=function(){mse(this.id,this.componentType,this.model,this.context)};function mse(e,t,n,i){let r=n._loadResources,s=n.gltfInternal.bufferViews[e];l(s)||(s=r.createdBufferViews[e]);let a=at.createIndexBuffer({context:i,typedArray:r.getBuffer(s),usage:Ne.STATIC_DRAW,indexDatatype:t});a.vertexArrayDestroyable=!1,n._rendererResources.buffers[e]=a,n._geometryByteLength+=a.sizeInBytes}var Qoe=new t9,ese=new n9;function hze(e,t){let n=e._loadResources;if(n.pendingBufferLoads!==0)return;let i=t.context,r=n.vertexBuffersToCreate,o=n.indexBuffersToCreate,s;if(e.asynchronous){for(;r.length>0&&(Qoe.set(r.peek(),e,i),!!t.jobScheduler.execute(Qoe,ss.BUFFER));)r.dequeue();for(;o.length>0&&(s=o.peek(),ese.set(s.id,s.componentType,e,i),!!t.jobScheduler.execute(ese,ss.BUFFER));)o.dequeue()}else{for(;r.length>0;)hse(r.dequeue(),e,i);for(;o.length>0;)s=o.dequeue(),mse(s.id,s.componentType,e,i)}}function i9(e,t){let n=e._runtime.materialsById[t.material];if(!!l(n))return n._program}function pse(e,t,n){let i,r=n._programPrimitives[t];if(!l(r))return e;let o;for(o in r)if(r.hasOwnProperty(o)&&(i=r[o],i9(n,i)===t))break;n._programPrimitives[t]=void 0;let s;if(n.extensionsUsed.WEB3D_quantized_attributes)s=$t.modifyShaderForQuantizedAttributes(n.gltfInternal,i,e),n._quantizedUniforms[t]=s.uniforms;else{let a=n._decodedData[o];if(l(a))s=$t.modifyShaderForDracoQuantizedAttributes(n.gltfInternal,i,e,a.attributes);else return e}return s.shader}function mze(e){return e=Fe.replaceMain(e,"gltf_blend_main"),e+=`uniform vec4 gltf_color;
- uniform float gltf_colorBlend;
- void main()
- {
- gltf_blend_main();
- gl_FragColor.rgb = mix(gl_FragColor.rgb, gltf_color.rgb, gltf_colorBlend);
- float highlight = ceil(gltf_colorBlend);
- gl_FragColor.rgb *= mix(gltf_color.rgb, vec3(1.0), highlight);
- gl_FragColor.a *= gltf_color.a;
- }
- `,e}function Qw(e,t,n){return l(n)&&(e=n(e,t)),e}var r9=function(){this.programToCreate=void 0,this.model=void 0,this.context=void 0};r9.prototype.set=function(e,t,n){this.programToCreate=e,this.model=t,this.context=n};r9.prototype.execute=function(){_se(this.programToCreate,this.model,this.context)};function _se(e,t,n){let i=e.programId,r=e.techniqueId,o=t._sourcePrograms[i],s=t._rendererResources.sourceShaders,a=s[o.vertexShader],c=s[o.fragmentShader],u=t._quantizedVertexShaders;if(t.extensionsUsed.WEB3D_quantized_attributes||t._dequantizeInShader){let m=u[i];l(m)||(m=pse(a,i,t),u[i]=m),a=m}let f=Qw(a,i,t._vertexShaderLoaded),d=Qw(c,i,t._fragmentShaderLoaded);t._marsOptions&&t._marsOptions.updateModelVS&&(f=t._marsOptions.updateModelVS(f)),t._marsOptions&&t._marsOptions.updateModelFS&&(d=t._marsOptions.updateModelFS(d)),l(t._uniformMapLoaded)||(d=`uniform vec4 czm_pickColor;
- ${d}`);let p=t._imageBasedLighting,g=p.enabled;if(g&&(d=`#define USE_IBL_LIGHTING
- ${d}`),l(t._lightColor)&&(d=`#define USE_CUSTOM_LIGHT_COLOR
- ${d}`),(t._sourceVersion!=="2.0"||t._sourceKHRTechniquesWebGL)&&(d=Fe.replaceMain(d,"non_gamma_corrected_main"),d=`${d}
- void main() {
- non_gamma_corrected_main();
- gl_FragColor = czm_gammaCorrect(gl_FragColor);
- }
- `),Xl.isSupported(n)){let m=p.useSphericalHarmonicCoefficients,x=p.useSpecularEnvironmentMaps;(m||x||g)&&(d=`uniform mat3 gltf_iblReferenceFrameMatrix;
- ${d}`),l(p.sphericalHarmonicCoefficients)?d=`#define DIFFUSE_IBL
- #define CUSTOM_SPHERICAL_HARMONICS
- uniform vec3 gltf_sphericalHarmonicCoefficients[9];
- ${d}`:p.useDefaultSphericalHarmonics&&(d=`#define DIFFUSE_IBL
- ${d}`),l(p.specularEnvironmentMapAtlas)&&p.specularEnvironmentMapAtlas.ready?d=`#define SPECULAR_IBL
- #define CUSTOM_SPECULAR_IBL
- uniform sampler2D gltf_specularMap;
- uniform vec2 gltf_specularMapSize;
- uniform float gltf_maxSpecularLOD;
- ${d}`:p.useDefaultSpecularMaps&&(d=`#define SPECULAR_IBL
- ${d}`)}l(p.luminanceAtZenith)&&(d=`#define USE_SUN_LUMINANCE
- uniform float gltf_luminanceAtZenith;
- ${d}`),gse(i,r,d,f,t,n)}function pze(e,t,n){let i=e.programId,r=e.techniqueId,o=t._sourcePrograms[i],s=t._rendererResources.sourceShaders,a=t._quantizedVertexShaders,c=t.clippingPlanes,u=e9(t),f=s[o.vertexShader],d=s[o.fragmentShader];(t.extensionsUsed.WEB3D_quantized_attributes||t._dequantizeInShader)&&(f=a[i]);let p=d;Q6(t)&&(p=qs._modifyShaderForColor(p)),u&&(p=y8e(p,c,n)),t.splitDirection!==as.NONE&&(p=vg.modifyFragmentShader(p));let g=Qw(f,i,t._vertexShaderLoaded),m=Qw(p,i,t._fragmentShaderLoaded);l(t._uniformMapLoaded)||(m=`uniform vec4 czm_pickColor;
- ${m}`);let x=t._imageBasedLighting,C=x.enabled;if(C&&(m=`#define USE_IBL_LIGHTING
- ${m}`),l(t._lightColor)&&(m=`#define USE_CUSTOM_LIGHT_COLOR
- ${m}`),(t._sourceVersion!=="2.0"||t._sourceKHRTechniquesWebGL)&&(m=Fe.replaceMain(m,"non_gamma_corrected_main"),m=`${m}
- void main() {
- non_gamma_corrected_main();
- gl_FragColor = czm_gammaCorrect(gl_FragColor);
- }
- `),Xl.isSupported(n)){let A=x.useSphericalHarmonicCoefficients,b=x.useSpecularEnvironmentMaps;(A||b||C)&&(m=`uniform mat3 gltf_iblReferenceFrameMatrix;
- ${m}`),l(x.sphericalHarmonicCoefficients)?m=`#define DIFFUSE_IBL
- #define CUSTOM_SPHERICAL_HARMONICS
- uniform vec3 gltf_sphericalHarmonicCoefficients[9];
- ${m}`:x.useDefaultSphericalHarmonics&&(m=`#define DIFFUSE_IBL
- ${m}`),l(x.specularEnvironmentMapAtlas)&&x.specularEnvironmentMapAtlas.ready?m=`#define SPECULAR_IBL
- #define CUSTOM_SPECULAR_IBL
- uniform sampler2D gltf_specularMap;
- uniform vec2 gltf_specularMapSize;
- uniform float gltf_maxSpecularLOD;
- ${m}`:x.useDefaultSpecularMaps&&(m=`#define SPECULAR_IBL
- ${m}`)}l(x.luminanceAtZenith)&&(m=`#define USE_SUN_LUMINANCE
- uniform float gltf_luminanceAtZenith;
- ${m}`),gse(i,r,m,g,t,n)}function gse(e,t,n,i,r,o){let s=r._sourceTechniques[t],a=$t.createAttributeLocations(s,r._precreatedAttributes);r._rendererResources.programs[e]=Wt.fromCache({context:o,vertexShaderSource:i,fragmentShaderSource:n,attributeLocations:a})}var tse=new r9;function _ze(e,t){let n=e._loadResources,i=n.programsToCreate;if(n.pendingShaderLoads!==0||n.pendingBufferLoads!==0)return;let r=t.context;if(e.asynchronous)for(;i.length>0&&(tse.set(i.peek(),e,r),!!t.jobScheduler.execute(tse,ss.PROGRAM));)i.dequeue();else for(;i.length>0;)_se(i.dequeue(),e,r)}function gze(e,t){return function(n){e.texturesToCreate.enqueue({id:t.id,image:n,bufferView:void 0}),--e.pendingBufferViewToImage}}function yze(e){let t=e._loadResources;if(t.pendingBufferLoads===0)for(;t.texturesToCreateFromBufferView.length>0;){let n=t.texturesToCreateFromBufferView.dequeue(),i=e.gltfInternal,r=i.bufferViews[n.bufferView],o=i.textures[n.id].source,s=$t.getFailedLoadFunction(e,"image",`id: ${n.id}, bufferView: ${n.bufferView}`);if(n.mimeType==="image/ktx2"){let a=new Uint8Array(t.getBuffer(r));Ua(a).then(dse(e,n.id,o)).catch(s),++e._loadResources.pendingTextureLoads}else{let a=gze(t,n);Y_({uint8Array:t.getBuffer(r),format:n.mimeType,flipY:!1,skipColorSpaceConversion:!0}).then(a).catch(s),++t.pendingBufferViewToImage}}}function xze(e){let t=e._loadResources;if(t.createSamplers){t.createSamplers=!1;let n=e._rendererResources.samplers;Ae.sampler(e.gltfInternal,function(i,r){n[r]=new on({wrapS:i.wrapS,wrapT:i.wrapT,minificationFilter:i.minFilter,magnificationFilter:i.magFilter})})}}var o9=function(){this.gltfTexture=void 0,this.model=void 0,this.context=void 0};o9.prototype.set=function(e,t,n){this.gltfTexture=e,this.model=t,this.context=n};o9.prototype.execute=function(){yse(this.gltfTexture,this.model,this.context)};function yse(e,t,n){let r=t.gltfInternal.textures[e.id],s=t._rendererResources.samplers[r.sampler];l(s)||(s=new on({wrapS:mn.REPEAT,wrapT:mn.REPEAT}));let a=!1,c=t.gltfInternal.materials,u=c.length;for(let T=0;T<u;++T){let S=c[T];if(l(S.extensions)&&l(S.extensions.KHR_techniques_webgl)){let w=S.extensions.KHR_techniques_webgl.values;for(let D in w)if(w.hasOwnProperty(D)&&D.indexOf("Texture")!==-1){let I=w[D];if(I.index===e.id&&l(I.extensions)&&l(I.extensions.KHR_texture_transform)){a=!0;break}}}if(a)break}let f=s.wrapS,d=s.wrapT,p=s.minificationFilter;a&&p!==It.LINEAR&&p!==It.NEAREST&&(p===It.NEAREST_MIPMAP_NEAREST||p===It.NEAREST_MIPMAP_LINEAR?p=It.NEAREST:p=It.LINEAR,s=new on({wrapS:s.wrapS,wrapT:s.wrapT,minificationFilter:p,magnificationFilter:s.magnificationFilter}));let g=e.internalFormat,m=!(l(g)&&ct.isCompressedFormat(g))&&(p===It.NEAREST_MIPMAP_NEAREST||p===It.NEAREST_MIPMAP_LINEAR||p===It.LINEAR_MIPMAP_NEAREST||p===It.LINEAR_MIPMAP_LINEAR),x=m||f===mn.REPEAT||f===mn.MIRRORED_REPEAT||d===mn.REPEAT||d===mn.MIRRORED_REPEAT,C,A,b=e.image;if(l(g)){C=!M.isPowerOfTwo(e.width)||!M.isPowerOfTwo(e.height),!n.webgl2&&ct.isCompressedFormat(g)&&C&&x&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly. See the Model.js constructor documentation for more information.");let T=s.minificationFilter;!l(e.mipLevels)&&(p===It.NEAREST_MIPMAP_NEAREST||p===It.NEAREST_MIPMAP_LINEAR)?T=It.NEAREST:!l(e.mipLevels)&&(p===It.LINEAR_MIPMAP_NEAREST||p===It.LINEAR_MIPMAP_LINEAR)&&(T=It.LINEAR),s=new on({wrapS:s.wrapS,wrapT:s.wrapT,minificationFilter:T,magnificationFilter:s.magnificationFilter}),A=new wt({context:n,source:{arrayBufferView:e.bufferView,mipLevels:e.mipLevels},width:e.width,height:e.height,pixelFormat:g,sampler:s})}else if(l(b)){if(C=!M.isPowerOfTwo(b.width)||!M.isPowerOfTwo(b.height),x&&C){let T=document.createElement("canvas");T.width=M.nextPowerOfTwo(b.width),T.height=M.nextPowerOfTwo(b.height),T.getContext("2d").drawImage(b,0,0,b.width,b.height,0,0,T.width,T.height),b=T}A=new wt({context:n,source:b,pixelFormat:r.internalFormat,pixelDatatype:r.type,sampler:s,flipY:!1,skipColorSpaceConversion:!0}),m&&A.generateMipmap()}l(A)&&(t._rendererResources.textures[e.id]=A,t._texturesByteLength+=A.sizeInBytes)}var nse=new o9;function Cze(e,t){let n=t.context,i=e._loadResources.texturesToCreate;if(e.asynchronous)for(;i.length>0&&(nse.set(i.peek(),e,n),!!t.jobScheduler.execute(nse,ss.TEXTURE));)i.dequeue();else for(;i.length>0;)yse(i.dequeue(),e,n)}function Aze(e,t){let n=e._sourceTechniques,i={},r,o,s=e._runtime.materialsById[t.material];if(!l(s))return i;let a=n[s._technique];if(!l(a))return i;let c=a.attributes,f=e._rendererResources.programs[a.program]._attributeLocations;for(r in f)if(f.hasOwnProperty(r)){let p=c[r];l(p)&&(o=f[r],i[p.semantic]=o)}let d=e._precreatedAttributes;if(l(d))for(r in d)d.hasOwnProperty(r)&&(o=f[r],i[r]=o);return i}function Tze(e,t){let n=e.gltfInternal,i=n.skins,r=n.nodes,o=e._runtime.nodes,s=e._loadResources.skinnedNodesIds,a=s.length;for(let c=0;c<a;++c){let u=s[c],f=o[u],d=r[u],p=t[d.skin];f.inverseBindMatrices=p.inverseBindMatrices,f.bindShapeMatrix=p.bindShapeMatrix;let g=i[d.skin].joints,m=g.length;for(let x=0;x<m;++x){let C=g[x],A=o[C];f.joints.push(A)}}}function bze(e){let t=e._loadResources;if(t.pendingBufferLoads!==0||!t.createSkins)return;t.createSkins=!1;let n=e.gltfInternal,i=n.accessors,r={};Ae.skin(n,function(o,s){let a=i[o.inverseBindMatrices],c;N.equals(o.bindShapeMatrix,N.IDENTITY)||(c=N.clone(o.bindShapeMatrix)),r[s]={inverseBindMatrices:ux.getSkinInverseBindMatrices(e,a),bindShapeMatrix:c}}),Tze(e,r)}function Eze(e,t,n,i){return function(r){l(i)&&(r=e.clampAnimations?i.clampTime(r):i.wrapTime(r),t[n]=i.evaluate(r,t[n]),t.dirtyNumber=e._maxDirtyNumber)}}function Sze(e){let t=e._loadResources;if(!t.finishedPendingBufferLoads()||!t.createRuntimeAnimations)return;t.createRuntimeAnimations=!1,e._runtime.animations=[];let n=e._runtime.nodes,i=e.gltfInternal.accessors;Ae.animation(e.gltfInternal,function(r,o){let s=r.channels,a=r.samplers,c=Number.MAX_VALUE,u=-Number.MAX_VALUE,f=s.length,d=new Array(f);for(let p=0;p<f;++p){let g=s[p],m=g.target,x=m.path,C=a[g.sampler],A=ux.getAnimationParameterValues(e,i[C.input]),b=ux.getAnimationParameterValues(e,i[C.output]);c=Math.min(c,A[0]),u=Math.max(u,A[A.length-1]);let T=ux.getAnimationSpline(e,o,r,g.sampler,C,A,x,b);d[p]=Eze(e,n[m.node],m.path,T)}e._runtime.animations[o]={name:r.name,startTime:c,stopTime:u,channelEvaluators:d}})}function ise(e,t){let n=e._loadResources;if(!n.finishedBuffersCreation()||!n.finishedProgramCreation()||!n.createVertexArrays)return;n.createVertexArrays=!1;let i=e._rendererResources.buffers,r=e._rendererResources.vertexArrays,o=e.gltfInternal,s=o.accessors;Ae.mesh(o,function(a,c){Ae.meshPrimitive(a,function(u,f){let d=[],p,g=Aze(e,u),m=e._decodedData[`${c}.primitive.${f}`];Ae.meshPrimitiveAttribute(u,function(T,S){if(p=g[S],l(p)){if(l(m)){let I=m.attributes;if(I.hasOwnProperty(S)){let O=I[S];d.push({index:p,vertexBuffer:i[O.bufferView],componentsPerAttribute:O.componentsPerAttribute,componentDatatype:O.componentDatatype,normalize:O.normalized,offsetInBytes:O.byteOffset,strideInBytes:O.byteStride});return}}let w=s[T],D=l(w.normalized)&&w.normalized;d.push({index:p,vertexBuffer:i[w.bufferView],componentsPerAttribute:ps(w.type),componentDatatype:w.componentType,normalize:D,offsetInBytes:w.byteOffset,strideInBytes:_s(o,w)})}});let x,C,A=e._precreatedAttributes;if(l(A))for(C in A)A.hasOwnProperty(C)&&(p=g[C],l(p)&&(x=A[C],x.index=p,d.push(x)));let b;if(l(u.indices)){let S=s[u.indices].bufferView;l(m)&&(S=m.bufferView),b=i[S]}r[`${c}.primitive.${f}`]=new Qn({context:t,attributes:d,indexBuffer:b})})})}function wze(e){let t=e._loadResources;t.createRenderStates&&(t.createRenderStates=!1,Ae.material(e.gltfInternal,function(n,i){vze(e,n,i)}))}function vze(e,t,n){let i=e._rendererResources.renderStates,r=[Z.FUNC_ADD,Z.FUNC_ADD],o=[Z.ONE,Z.ONE_MINUS_SRC_ALPHA,Z.ONE,Z.ONE_MINUS_SRC_ALPHA];l(t.extensions)&&l(t.extensions.KHR_blend)&&(r=t.extensions.KHR_blend.blendEquation,o=t.extensions.KHR_blend.blendFactors);let s=!t.doubleSided,a=t.alphaMode==="BLEND";i[n]=Ve.fromCache({cull:{enabled:s},depthTest:{enabled:!0,func:wc.LESS_OR_EQUAL},depthMask:!a,blending:{enabled:a,equationRgb:r[0],equationAlpha:r[1],functionSourceRgb:o[0],functionDestinationRgb:o[1],functionSourceAlpha:o[2],functionDestinationAlpha:o[3]}})}var Dze={MODEL:function(e,t,n){return function(){return n.computedMatrix}},VIEW:function(e,t,n){return function(){return e.view}},PROJECTION:function(e,t,n){return function(){return e.projection}},MODELVIEW:function(e,t,n){let i=new N;return function(){return N.multiplyTransformation(e.view,n.computedMatrix,i)}},CESIUM_RTC_MODELVIEW:function(e,t,n){let i=new N;return function(){return N.multiplyTransformation(e.view,n.computedMatrix,i),N.setTranslation(i,t._rtcCenterEye,i)}},MODELVIEWPROJECTION:function(e,t,n){let i=new N;return function(){return N.multiplyTransformation(e.view,n.computedMatrix,i),N.multiply(e._projection,i,i)}},MODELINVERSE:function(e,t,n){let i=new N;return function(){return N.inverse(n.computedMatrix,i)}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t,n){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t,n){let i=new N,r=new N;return function(){return N.multiplyTransformation(e.view,n.computedMatrix,i),N.inverse(i,r)}},MODELVIEWPROJECTIONINVERSE:function(e,t,n){let i=new N,r=new N;return function(){return N.multiplyTransformation(e.view,n.computedMatrix,i),N.multiply(e._projection,i,i),N.inverse(i,r)}},MODELINVERSETRANSPOSE:function(e,t,n){let i=new N,r=new Q;return function(){return N.inverse(n.computedMatrix,i),N.getMatrix3(i,r),Q.transpose(r,r)}},MODELVIEWINVERSETRANSPOSE:function(e,t,n){let i=new N,r=new N,o=new Q;return function(){return N.multiplyTransformation(e.view,n.computedMatrix,i),N.inverse(i,r),N.getMatrix3(r,o),Q.transpose(o,o)}},VIEWPORT:function(e,t,n){return function(){return e.viewportCartesian4}}};function Pze(e,t,n,i){let r=t._runtime.nodes[e];return Dze[n](i,t,r)}function Ize(e,t,n,i,r,o,s){let a={},c={},u,f;return Ae.techniqueUniform(n,function(d,p){let g;if(l(i)&&l(i[p]))g=$t.createUniformFunction(d.type,i[p],o,s),a[p]=g.func,c[p]=g;else if(l(d.node))a[p]=Pze(d.node,e,d.semantic,r.uniformState);else if(l(d.semantic))if(d.semantic==="JOINTMATRIX")u=p;else if(d.semantic==="MORPHWEIGHTS")f=p;else if(d.semantic==="ALPHACUTOFF"){let m=t.alphaMode;if(l(m)&&m==="MASK"){let x=y(t.alphaCutoff,.5);g=$t.createUniformFunction(d.type,x,o,s),a[p]=g.func,c[p]=g}}else a[p]=$t.getGltfSemanticUniforms()[d.semantic](r.uniformState,e);else if(l(d.value)){let m=$t.createUniformFunction(d.type,d.value,o,s);a[p]=m.func,c[p]=m}}),{map:a,values:c,jointMatrixUniformName:u,morphWeightsUniformName:f}}function Oze(e,t){let n=e._loadResources;if(!n.finishedProgramCreation()||!n.createUniformMaps)return;n.createUniformMaps=!1;let i=e.gltfInternal,r=e._sourceTechniques,o=e._uniformMaps,s=e._rendererResources.textures,a=e._defaultTexture;Ae.material(i,function(c,u){let f=e._runtime.materialsById[u],d=r[f._technique],p=f._values,g=Ize(e,c,d,p,t,s,a),m=o[u];if(m.uniformMap=g.map,m.values=g.values,m.jointMatrixUniformName=g.jointMatrixUniformName,m.morphWeightsUniformName=g.morphWeightsUniformName,l(d.attributes.a_outlineCoordinates)){let x=Kw.createTexture(e,t);m.uniformMap.u_outlineTexture=function(){return x}}})}function Rze(e){return $t.createUniformsForDracoQuantizedAttributes(e.attributes)}function Mze(e,t){let n=i9(e,t),i=e._quantizedUniforms[n];return $t.createUniformsForQuantizedAttributes(e.gltfInternal,t,i)}function Bze(e){return function(){return e}}function Lze(e){return function(){return e.computedJointMatrices}}function Nze(e){return function(){return e.weights}}function Fze(e){return function(){return e.silhouetteColor}}function Vze(e){return function(){return e.silhouetteSize}}function kze(e){return function(){return e.color}}function Uze(e){return function(){return e._clippingPlanesMatrix}}function zze(e){return function(){return e._iblReferenceFrameMatrix}}function Hze(e){return function(){let t=e.clippingPlanes;return!l(t)||!t.enabled?e._defaultTexture:t.texture}}function Gze(e){return function(){let t=e.clippingPlanes;if(!l(t))return z.WHITE.withAlpha(0);let n=z.clone(t.edgeColor);return n.alpha=t.edgeWidth,n}}function Wze(e){return function(){return Ds.getColorBlend(e.colorBlendMode,e.colorBlendAmount)}}function jze(e){return function(){return e._imageBasedLighting.imageBasedLightingFactor}}function qze(e){return function(){return e._lightColor}}function Yze(e){return function(){return e._imageBasedLighting.luminanceAtZenith}}function Xze(e){return function(){return e._imageBasedLighting.sphericalHarmonicCoefficients}}function Kze(e){return function(){return e._imageBasedLighting.specularEnvironmentMapAtlas.texture}}function $ze(e){return function(){return e._imageBasedLighting.specularEnvironmentMapAtlas.texture.dimensions}}function Zze(e){return function(){return e._imageBasedLighting.specularEnvironmentMapAtlas.maximumMipmapLevel}}function Jze(e,t){switch(e.mode){case Me.TRIANGLES:return t/3;case Me.TRIANGLE_STRIP:case Me.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function Qze(e,t,n,i,r){let o=e._nodeCommands,s=e._pickIds,a=e.allowPicking,c=e._runtime.meshesByName,u=e._rendererResources,f=u.vertexArrays,d=u.programs,p=u.renderStates,g=e._uniformMaps,m=e.gltfInternal,x=m.accessors,C=m.meshes,A=t.mesh,b=C[A],T=b.primitives,S=T.length;for(let w=0;w<S;++w){let D=T[w],I=x[D.indices],B=e._runtime.materialsById[D.material]._program,L=e._decodedData[`${A}.primitive.${w}`],_,E=D.attributes.POSITION;if(l(E)){let de=$t.getAccessorMinMax(m,E);_=re.fromCornerPoints(h.fromArray(de.min),h.fromArray(de.max))}let v=f[`${A}.primitive.${w}`],P,R;l(L)?(R=L.numberOfIndices,P=0):l(I)?(R=I.count,P=I.byteOffset/Le.getSizeInBytes(I.componentType)):(R=x[D.attributes.POSITION].count,P=0),e._trianglesLength+=Jze(D,R),D.mode===Me.POINTS&&(e._pointsLength+=R);let F=g[D.material],U=F.uniformMap;if(e._marsOptions&&e._marsOptions.updateModelUniformMap&&(U=rt(U,e._marsOptions.updateModelUniformMap)),e._marsOptions&&e._marsOptions.edit&&(U=rt(U,{u_mars_polygonTexture:function(){return i.defaultTexture},u_mars_polygonBounds:function(){return se.ZERO},u_mars_modelInverseMatrix:function(){return N.ZERO},u_mars_modelUpZ:function(){return!1},u_mars_heightVar:function(){return W.ZERO},u_mars_IsYaPing:function(){return se.ZERO},u_mars_editVar:function(){return se.ZERO},u_mars_floodVar:function(){return se.ZERO},u_mars_floodColor:function(){return se.ZERO},u_mars_offset:function(){return h.ZERO}})),l(F.jointMatrixUniformName)){let de={};de[F.jointMatrixUniformName]=Lze(n),U=rt(U,de)}if(l(F.morphWeightsUniformName)){let de={};de[F.morphWeightsUniformName]=Nze(n),U=rt(U,de)}U=rt(U,{gltf_color:kze(e),gltf_colorBlend:Wze(e),gltf_clippingPlanes:Hze(e),gltf_clippingPlanesEdgeStyle:Gze(e),gltf_clippingPlanesMatrix:Uze(e),gltf_iblReferenceFrameMatrix:zze(e),gltf_iblFactor:jze(e),gltf_lightColor:qze(e),gltf_sphericalHarmonicCoefficients:Xze(e),gltf_specularMap:Kze(e),gltf_specularMapSize:$ze(e),gltf_maxSpecularLOD:Zze(e),gltf_luminanceAtZenith:Yze(e)}),vg.addUniforms(e,U),l(e._uniformMapLoaded)&&(U=e._uniformMapLoaded(U,B,n));let k={};e.extensionsUsed.WEB3D_quantized_attributes?k=Mze(e,D):e._dequantizeInShader&&l(L)&&(k=Rze(L)),U=rt(U,k);let H=p[D.material],V=H.blending.enabled,q=e._pickObject;l(q)||(q={primitive:e,id:e.id,node:n.publicNode,mesh:c[b.name]});let j=Zt.castShadows(e._shadows),X=Zt.receiveShadows(e._shadows),G;if(a&&!l(e._uniformMapLoaded)){G=i.createPickId(q),s.push(G);let de={czm_pickColor:Bze(G.color)};U=rt(U,de)}a&&(l(e._pickIdLoaded)&&l(e._uniformMapLoaded)?G=e._pickIdLoaded():G="czm_pickColor");let $=new Ze({boundingVolume:new re,cull:e.cull,modelMatrix:new N,primitiveType:D.mode,vertexArray:v,count:R,offset:P,shaderProgram:d[B],castShadows:j,receiveShadows:X,uniformMap:U,renderState:H,owner:q,pass:V?Ce.TRANSLUCENT:e.opaquePass,pickId:G}),J;r||(J=Ze.shallowClone($),J.boundingVolume=new re,J.modelMatrix=new N);let ce={show:!0,boundingSphere:_,command:$,command2D:J,silhouetteModelCommand:void 0,silhouetteModelCommand2D:void 0,silhouetteColorCommand:void 0,silhouetteColorCommand2D:void 0,translucentCommand:void 0,translucentCommand2D:void 0,disableCullingCommand:void 0,disableCullingCommand2D:void 0,programId:B};n.commands.push(ce),o.push(ce)}}function e8e(e,t,n){let i=e._loadResources;if(!i.finishedEverythingButTextureCreation()||!i.createRuntimeNodes)return;i.createRuntimeNodes=!1;let r=[],o=e._runtime.nodes,s=e.gltfInternal,a=s.nodes,u=s.scenes[s.scene].nodes,f=u.length,d=[],p={};for(let g=0;g<f;++g)for(d.push({parentRuntimeNode:void 0,gltfNode:a[u[g]],id:u[g]});d.length>0;){let m=d.pop();p[m.id]=!0;let x=m.parentRuntimeNode,C=m.gltfNode,A=o[m.id];if(A.parents.length===0)if(l(C.matrix))A.matrix=N.fromColumnMajorArray(C.matrix);else{let T=C.rotation;A.translation=h.fromArray(C.translation),A.rotation=Re.unpack(T),A.scale=h.fromArray(C.scale)}l(x)?(x.children.push(A),A.parents.push(x)):r.push(A),l(C.mesh)&&Qze(e,C,A,t,n);let b=C.children;if(l(b)){let T=b.length;for(let S=0;S<T;S++){let w=b[S];p[w]||d.push({parentRuntimeNode:A,gltfNode:a[w],id:b[S]})}}}e._runtime.rootNodes=r,e._runtime.nodes=o}function t8e(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].sizeInBytes);return t}function n8e(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].sizeInBytes);return t}function rse(e,t){let n=t.context,i=t.scene3DOnly,r=e._quantizedVertexShaders,o=e._sourceTechniques,s=e._sourcePrograms,a=e._rendererResources,c=a.sourceShaders;e._loadRendererResourcesFromCache&&(c=a.sourceShaders=e._cachedRendererResources.sourceShaders);for(let u in o)if(o.hasOwnProperty(u)){let f=o[u].program,d=s[f],p=c[d.vertexShader];if($t.checkSupportedGlExtensions(d.glExtensions,n),e.extensionsUsed.WEB3D_quantized_attributes||e._dequantizeInShader){let g=r[f];l(g)||(g=pse(p,f,e),r[f]=g),p=g}p=Qw(p,f,e._vertexShaderLoaded)}if(e._loadRendererResourcesFromCache){let u=e._cachedRendererResources;a.buffers=u.buffers,a.vertexArrays=u.vertexArrays,a.programs=u.programs,a.silhouettePrograms=u.silhouettePrograms,a.textures=u.textures,a.samplers=u.samplers,a.renderStates=u.renderStates,l(e._precreatedAttributes)&&ise(e,n),e._cachedGeometryByteLength+=t8e(u.buffers),e._cachedTexturesByteLength+=n8e(u.textures)}else hze(e,t),_ze(e,t),xze(e,n),yze(e),Cze(e,t);bze(e),Sze(e),e._loadRendererResourcesFromCache||(ise(e,n),wze(e)),Oze(e,n),e8e(e,n,i)}function ose(e,t){let n=e.publicNode,i=n.matrix;n.useMatrix&&l(i)?N.clone(i,t):l(e.matrix)?N.clone(e.matrix,t):(N.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t),n.setMatrix(t))}var xse=[],i8e=new se,Y6=new N;function r8e(e,t,n,i){let r=e._maxDirtyNumber,o=e._runtime.rootNodes,s=o.length,a=xse,c=e._computedModelMatrix;if(e._mode!==te.SCENE3D&&!e._ignoreCommands){let u=N.getColumn(c,3,i8e);if(!se.equals(u,se.UNIT_W))c=yt.basisTo2D(i,c,Y6),e._rtcCenter=e._rtcCenter3D;else{let f=e.boundingSphereInternal.center,d=yt.wgs84To2DModelMatrix(i,f,Y6);c=N.multiply(d,c,Y6),l(e._rtcCenter)&&(N.setTranslation(c,se.UNIT_W,c),e._rtcCenter=e._rtcCenter2D)}}for(let u=0;u<s;++u){let f=o[u];for(ose(f,f.transformToRoot),a.push(f);a.length>0;){f=a.pop();let d=f.transformToRoot,p=f.commands;if(f.dirtyNumber===r||t||n){let m=N.multiplyTransformation(c,d,f.computedMatrix),x=p.length;if(x>0)for(let C=0;C<x;++C){let A=p[C],b=A.command;N.clone(m,b.modelMatrix),re.transform(A.boundingSphere,b.modelMatrix,b.boundingVolume),l(e._rtcCenter)&&h.add(e._rtcCenter,b.boundingVolume.center,b.boundingVolume.center),b=A.command2D,l(b)&&e._mode===te.SCENE2D&&(N.clone(m,b.modelMatrix),b.modelMatrix[13]-=M.sign(b.modelMatrix[13])*2*M.PI*i.ellipsoid.maximumRadius,re.transform(A.boundingSphere,b.modelMatrix,b.boundingVolume))}}let g=f.children;if(l(g)){let m=g.length;for(let x=0;x<m;++x){let C=g[x];C.dirtyNumber=Math.max(C.dirtyNumber,f.dirtyNumber),(C.dirtyNumber===r||n)&&(ose(C,C.transformToRoot),N.multiplyTransformation(d,C.transformToRoot,C.transformToRoot)),a.push(C)}}}}++e._maxDirtyNumber}var X6=new N;function o8e(e){let t=e._runtime.skinnedNodes,n=t.length;for(let i=0;i<n;++i){let r=t[i];X6=N.inverseTransformation(r.transformToRoot,X6);let o=r.computedJointMatrices,s=r.joints,a=r.bindShapeMatrix,c=r.inverseBindMatrices,u=c.length;for(let f=0;f<u;++f)l(o[f])||(o[f]=new N),o[f]=N.multiplyTransformation(X6,s[f].transformToRoot,o[f]),o[f]=N.multiplyTransformation(o[f],c[f],o[f]),l(a)&&(o[f]=N.multiplyTransformation(o[f],a,o[f]))}}function s8e(e){let t=e._runtime.rootNodes,n=t.length,i=xse;for(let r=0;r<n;++r){let o=t[r];for(o.computedShow=o.publicNode.show,i.push(o);i.length>0;){o=i.pop();let s=o.computedShow,a=o.commands,c=a.length;for(let f=0;f<c;++f)a[f].show=s;let u=o.children;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let p=u[d];p.computedShow=s&&p.publicNode.show,i.push(p)}}}}}function a8e(e,t){let n=e.id;if(e._id!==n){e._id=n;let i=e._pickIds,r=i.length;for(let o=0;o<r;++o)i[o].object.id=n}}function c8e(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;let t=e.debugWireframe?Me.LINES:Me.TRIANGLES,n=e._nodeCommands,i=n.length;for(let r=0;r<i;++r)n[r].command.primitiveType=t}}function l8e(e){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume){e._debugShowBoundingVolume=e.debugShowBoundingVolume;let t=e.debugShowBoundingVolume,n=e._nodeCommands,i=n.length;for(let r=0;r<i;++r)n[r].command.debugShowBoundingVolume=t}}function u8e(e){if(e.shadows!==e._shadows){e._shadows=e.shadows;let t=Zt.castShadows(e.shadows),n=Zt.receiveShadows(e.shadows),i=e._nodeCommands,r=i.length;for(let o=0;o<r;o++){let s=i[o];s.command.castShadows=t,s.command.receiveShadows=n}}}function f8e(e,t){let n=$e(t,!0);return n.cull.enabled=!1,n.depthTest.enabled=!0,n.depthMask=!1,n.blending=hn.ALPHA_BLEND,e.opaquePass===Ce.CESIUM_3D_TILE&&(n.stencilTest=tn.setCesium3DTileBit(),n.stencilMask=tn.CESIUM_3D_TILE_MASK),Ve.fromCache(n)}function sse(e,t){let n=Ze.shallowClone(t);return n.pass=Ce.TRANSLUCENT,n.renderState=f8e(e,t.renderState),n}function Cse(e,t,n){let i=t.scene3DOnly,r=e.color.alpha;if(r>0&&r<1){let o=e._nodeCommands,s=o.length;if(s>0&&(!l(o[0].translucentCommand)||n))for(let a=0;a<s;++a){let c=o[a],u=c.command;if(c.translucentCommand=sse(e,u),!i){let f=c.command2D;c.translucentCommand2D=sse(e,f)}}}}function d8e(e){let t=$e(e,!0);return t.cull.enabled=!1,Ve.fromCache(t)}function ase(e){let t=Ze.shallowClone(e);return t.renderState=d8e(e.renderState),t}function Ase(e,t,n){let i=t.scene3DOnly;if(!e.backFaceCulling){let o=e._nodeCommands,s=o.length;if(s>0&&(!l(o[0].disableCullingCommand)||n))for(let a=0;a<s;++a){let c=o[a],u=c.command;if(c.disableCullingCommand=ase(u),!i){let f=c.command2D;c.disableCullingCommand2D=ase(f)}}}}function h8e(e,t){let n=e._rendererResources.programs;for(let i in n)if(n.hasOwnProperty(i)&&n[i]===t)return i}function m8e(e,t,n){let i=t.vertexShaderSource.sources[0],r=t._attributeLocations,o=e._normalAttributeName;i=Fe.replaceMain(i,"gltf_silhouette_main"),i+=`uniform float gltf_silhouetteSize;
- void main()
- {
- gltf_silhouette_main();
- vec3 n = normalize(czm_normal3D * ${o});
- n.x *= czm_projection[0][0];
- n.y *= czm_projection[1][1];
- vec4 clip = gl_Position;
- clip.xy += n.xy * clip.w * gltf_silhouetteSize * czm_pixelRatio / czm_viewport.z;
- gl_Position = clip;
- }`;let s=`uniform vec4 gltf_silhouetteColor;
- void main()
- {
- gl_FragColor = czm_gammaCorrect(gltf_silhouetteColor);
- }`;return Wt.fromCache({context:n.context,vertexShaderSource:i,fragmentShaderSource:s,attributeLocations:r})}function Tse(e,t){return use(t.context)&&e.silhouetteSize>0&&e.silhouetteColor.alpha>0&&l(e._normalAttributeName)}function p8e(e){let t=e._nodeCommands,n=t.length;for(let i=0;i<n;++i)if(t[i].command.pass===Ce.TRANSLUCENT)return!0;return!1}function $6(e){return e.color.alpha>0&&e.color.alpha<1}function bse(e){return e.color.alpha===0}function cse(e,t){return Math.floor(e)!==Math.floor(t)||Math.ceil(e)!==Math.ceil(t)}var _8e=0;function g8e(e,t){let n=++_8e%255,i=p8e(e)||$6(e)||e.silhouetteColor.alpha<1,r=e._rendererResources.silhouettePrograms,o=t.scene3DOnly,s=e._nodeCommands,a=s.length;for(let c=0;c<a;++c){let u=s[c],f=u.command,d=$6(e)?u.translucentCommand:f,p=Ze.shallowClone(d),g=$e(d.renderState);g.stencilTest={enabled:!0,frontFunction:Z.ALWAYS,backFunction:Z.ALWAYS,reference:n,mask:-1,frontOperation:{fail:Z.KEEP,zFail:Z.KEEP,zPass:Z.REPLACE},backOperation:{fail:Z.KEEP,zFail:Z.KEEP,zPass:Z.REPLACE}},bse(e)&&(g.colorMask={red:!1,green:!1,blue:!1,alpha:!1},g.depthMask=!1),g=Ve.fromCache(g),p.renderState=g,u.silhouetteModelCommand=p;let m=Ze.shallowClone(f);g=$e(f.renderState,!0),g.depthTest.enabled=!0,g.cull.enabled=!1,i&&(m.pass=Ce.TRANSLUCENT,g.depthMask=!1,g.blending=hn.ALPHA_BLEND),g.stencilTest={enabled:!0,frontFunction:Z.NOTEQUAL,backFunction:Z.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:Z.KEEP,zFail:Z.KEEP,zPass:Z.KEEP},backOperation:{fail:Z.KEEP,zFail:Z.KEEP,zPass:Z.KEEP}},g=Ve.fromCache(g);let x=f.shaderProgram,C=h8e(e,x),A=r[C];l(A)||(A=m8e(e,x,t),r[C]=A);let b=rt(f.uniformMap,{gltf_silhouetteColor:Fze(e),gltf_silhouetteSize:Vze(e)});if(m.renderState=g,m.shaderProgram=A,m.uniformMap=b,m.castShadows=!1,m.receiveShadows=!1,u.silhouetteColorCommand=m,!o){let T=u.command2D,S=Ze.shallowClone(p);S.boundingVolume=T.boundingVolume,S.modelMatrix=T.modelMatrix,u.silhouetteModelCommand2D=S;let w=Ze.shallowClone(m);S.boundingVolume=T.boundingVolume,S.modelMatrix=T.modelMatrix,u.silhouetteColorCommand2D=w}}}function y8e(e,t,n){return e=Fe.replaceMain(e,"gltf_clip_main"),e+=`${qs._getClippingFunction(t,n)}
- `,e+=`uniform highp sampler2D gltf_clippingPlanes;
- uniform mat4 gltf_clippingPlanesMatrix;
- uniform vec4 gltf_clippingPlanesEdgeStyle;
- void main()
- {
- gltf_clip_main();
- ${eb("gltf_clippingPlanes","gltf_clippingPlanesMatrix","gltf_clippingPlanesEdgeStyle")}}
- `,e}function Ese(e,t,n){if(!Tse(e,t))return;let i=e._nodeCommands,r=i.length>0&&(cse(e.color.alpha,e._colorPreviousAlpha)||cse(e.silhouetteColor.alpha,e._silhouetteColorPreviousAlpha)||!l(i[0].silhouetteModelCommand));e._colorPreviousAlpha=e.color.alpha,e._silhouetteColorPreviousAlpha=e.silhouetteColor.alpha,(r||n)&&g8e(e,t)}function x8e(e,t){let n=e._clippingPlanes;l(n)&&n.owner===e&&n.enabled&&n.update(t)}var K6=new re;function C8e(e,t,n){return K6.center=e,K6.radius=t,n.camera.getPixelSize(K6,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var js=new h,$w=new me;function A8e(e,t){let n=e.scale;if(e.minimumPixelSize!==0){let i=t.context,r=Math.max(i.drawingBufferWidth,i.drawingBufferHeight),o=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;if(js.x=o[12],js.y=o[13],js.z=o[14],l(e._rtcCenter)&&h.add(e._rtcCenter,js,js),e._mode!==te.SCENE3D){let f=t.mapProjection,d=f.ellipsoid.cartesianToCartographic(js,$w);d&&(f.project(d,js),h.fromElements(js.z,js.x,js.y,js))}let s=e.boundingSphereInternal.radius,a=C8e(js,s,t),c=1/a;Math.min(c*(2*s),r)<e.minimumPixelSize&&(n=e.minimumPixelSize*a/(2*e._initialRadius))}return l(e.maximumScale)?Math.min(e.maximumScale,n):n}function Sse(e){l(e._cacheKey)&&l(e._cachedGltf)&&--e._cachedGltf.count===0&&delete Ig[e._cacheKey],e._cachedGltf=void 0}function Z6(e,t){this.buffers=void 0,this.vertexArrays=void 0,this.programs=void 0,this.sourceShaders=void 0,this.silhouettePrograms=void 0,this.textures=void 0,this.samplers=void 0,this.renderStates=void 0,this.ready=!1,this.context=e,this.cacheKey=t,this.count=0}function Pg(e){for(let t in e)e.hasOwnProperty(t)&&e[t].destroy()}function T8e(e){Pg(e.buffers),Pg(e.vertexArrays),Pg(e.programs),Pg(e.silhouettePrograms),Pg(e.textures)}Z6.prototype.release=function(){if(--this.count===0)return l(this.cacheKey)&&delete this.context.cache.modelRendererResourceCache[this.cacheKey],T8e(this),ue(this)};function lse(e,t,n){return function(i){if(e.heightReference===ze.RELATIVE_TO_GROUND){let o=t.cartesianToCartographic(i,$w);o.height+=n.height,t.cartographicToCartesian(o,i)}let r=e._clampedModelMatrix;N.clone(e.modelMatrix,r),r[12]=i.x,r[13]=i.y,r[14]=i.z,e._heightChanged=!0}}function b8e(e){l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!l(t)||!l(t.globe)||e.heightReference===ze.NONE){e._clampedModelMatrix=void 0;return}let n=t.globe,i=n.ellipsoid,r=e.modelMatrix;js.x=r[12],js.y=r[13],js.z=r[14];let o=i.cartesianToCartographic(js);if(!o)return;l(e._clampedModelMatrix)||(e._clampedModelMatrix=N.clone(r,new N));let s=n._surface;e._removeUpdateHeightCallback=s.updateHeight(o,lse(e,i,o));let a=n.getHeight(o);if(l(a)){let c=lse(e,i,o);me.clone(o,$w),$w.height=a,i.cartographicToCartesian($w,js),c(js)}}var E8e=new h,S8e=new me;function w8e(e,t){let n,i=e.distanceDisplayCondition,r=i.near*i.near,o=i.far*i.far;if(t.mode===te.SCENE2D)n=(t.camera.frustum.right-t.camera.frustum.left)*.5,n=n*n;else{let s=N.getTranslation(e.modelMatrix,E8e);if(t.mode===te.COLUMBUS_VIEW){let a=t.mapProjection,u=a.ellipsoid.cartesianToCartographic(s,S8e);s=a.project(u,s),h.fromElements(s.z,s.x,s.y,s)}n=h.distanceSquared(s,t.camera.positionWC)}return n>=r&&n<=o}var v8e=new N,D8e=new Q,P8e=new N;qs.prototype.update=function(e){if(e.mode===te.MORPHING)return;if(!Et.supportsWebP.initialized){Et.supportsWebP.initialize();return}let t=e.context;this._defaultTexture=t.defaultTexture;let n=Et.supportsWebP();if(this._state===Dg.NEEDS_LOAD&&l(this.gltfInternal)){let A,b=this.cacheKey;if(l(b)){t.cache.modelRendererResourceCache=y(t.cache.modelRendererResourceCache,{});let T=t.cache.modelRendererResourceCache;if(A=T[this.cacheKey],l(A)){if(!A.ready)return;++A.count,this._loadRendererResourcesFromCache=!0}else A=new Z6(t,b),A.count=1,T[this.cacheKey]=A;this._cachedRendererResources=A}else A=new Z6(t),A.count=1,this._cachedRendererResources=A;if(this._state=Dg.LOADING,this._state!==Dg.FAILED){let T=this.gltfInternal.extensions;if(l(T)&&l(T.CESIUM_RTC)){let S=h.fromArray(T.CESIUM_RTC.center);if(!h.equals(S,h.ZERO)){this._rtcCenter3D=S;let w=e.mapProjection,I=w.ellipsoid.cartesianToCartographic(this._rtcCenter3D),O=w.project(I);h.fromElements(O.z,O.x,O.y,O),this._rtcCenter2D=O,this._rtcCenterEye=new h,this._rtcCenter=this._rtcCenter3D}}yp(this.gltfInternal),this._loadResources=new jT,this._loadRendererResourcesFromCache||$t.parseBuffers(this,Q4e)}}let i=this._loadResources,r=this._incrementallyLoadTextures,o=!1;if(this._state===Dg.LOADING){if(i.pendingBufferLoads===0){if(!i.initialized){if(e.brdfLutGenerator.update(e),$t.checkSupportedExtensions(this.extensionsRequired,n),$t.updateForwardAxis(this),!l(this.gltfInternal.extras.sourceVersion)){let A=this.gltfInternal,b=$t.getAssetVersion(A),T=l($t.getUsedExtensions(A).KHR_techniques_webgl);b!=="2.0"&&di("gltf-1.0","glTF 1.0 assets were deprecated in CesiumJS 1.94. They will be removed in 1.97. Please convert any glTF 1.0 assets to glTF 2.0."),T&&di("KHR_techniques_webgl","Support for glTF 1.0 techniques and the KHR_techniques_webgl glTF extension were deprecated in CesiumJS 1.94. It will be removed in 1.97. If custom GLSL shaders are needed, use CustomShader instead."),A.extras.sourceVersion=b,A.extras.sourceKHRTechniquesWebGL=T,this._sourceVersion=b,this._sourceKHRTechniquesWebGL=T,Tg(A),Cg(A);let S={addBatchIdToGeneratedShaders:this._addBatchIdToGeneratedShaders,marsOptions:this._marsOptions};KT(A,S),$T(A,S)}this._sourceVersion=this.gltfInternal.extras.sourceVersion,this._sourceKHRTechniquesWebGL=this.gltfInternal.extras.sourceKHRTechniquesWebGL,this._dequantizeInShader=this._dequantizeInShader&&_l.hasExtension(this),J4e(this),oze(this),tze(this),this._loadRendererResourcesFromCache||(eze(this),ize(this),rze(this),aze(this,t,n)),uze(this),fze(this),lze(this),dze(this),_l.parse(this,t),i.initialized=!0}i.finishedDecoding()||_l.decodeModel(this,t).catch($t.getFailedLoadFunction(this,"model",this.basePathInternal)),i.finishedDecoding()&&!i.resourcesParsed&&(this._boundingSphere=$t.computeBoundingSphere(this),this._initialRadius=this._boundingSphere.radius,_l.cacheDataForModel(this),i.resourcesParsed=!0),i.resourcesParsed&&i.pendingShaderLoads===0&&(this.showOutline&&Kw.outlinePrimitives(this),rse(this,e))}(i.finished()||r&&i.finishedEverythingButTextureCreation())&&(this._state=Dg.LOADED,o=!0)}if(l(i)&&this._state===Dg.LOADED&&(r&&!o&&rse(this,e),i.finished())){this._loadResources=void 0;let A=this._rendererResources,b=this._cachedRendererResources;b.buffers=A.buffers,b.vertexArrays=A.vertexArrays,b.programs=A.programs,b.sourceShaders=A.sourceShaders,b.silhouettePrograms=A.silhouettePrograms,b.textures=A.textures,b.samplers=A.samplers,b.renderStates=A.renderStates,b.ready=!0,this._normalAttributeName=$t.getAttributeOrUniformBySemantic(this.gltfInternal,"NORMAL"),l(this._precreatedAttributes)&&(b.vertexArrays={}),this.releaseGltfJson&&Sse(this)}let s=Tse(this,e),a=$6(this),c=bse(this),u=this.backFaceCulling,f=l(this.distanceDisplayCondition)?w8e(this,e):!0,d=this.show&&f&&this.scale!==0&&(!c||s);if(this._imageBasedLighting.update(e),d&&this._state===Dg.LOADED||o){let A=this.activeAnimations.update(e)||this._cesiumAnimationsDirty;this._cesiumAnimationsDirty=!1,this._dirty=!1;let b=this.modelMatrix,T=e.mode!==this._mode;this._mode=e.mode;let S=!N.equals(this._modelMatrix,b)||this._scale!==this.scale||this._minimumPixelSize!==this.minimumPixelSize||this.minimumPixelSize!==0||this._maximumScale!==this.maximumScale||this._heightReference!==this.heightReference||this._heightChanged||T;if(S||o){N.clone(b,this._modelMatrix),b8e(this),l(this._clampedModelMatrix)&&(b=this._clampedModelMatrix),this._scale=this.scale,this._minimumPixelSize=this.minimumPixelSize,this._maximumScale=this.maximumScale,this._heightReference=this.heightReference,this._heightChanged=!1;let L=A8e(this,e),_=this._computedModelMatrix;N.multiplyByUniformScale(b,L,_),this._upAxis===On.Y?N.multiplyTransformation(_,On.Y_UP_TO_Z_UP,_):this._upAxis===On.X&&N.multiplyTransformation(_,On.X_UP_TO_Z_UP,_),this.forwardAxis===On.Z&&N.multiplyTransformation(_,On.Z_UP_TO_X_UP,_)}(A||S||o)&&(r8e(this,S,o,e.mapProjection),this._dirty=!0,(A||o)&&o8e(this)),this._perNodeShowDirty&&(this._perNodeShowDirty=!1,s8e(this)),a8e(this,t),c8e(this),l8e(this),u8e(this),x8e(this,e);let w=this._clippingPlanes,D=0,I=y(this.referenceMatrix,b);if(this._imageBasedLighting.useSphericalHarmonicCoefficients||this._imageBasedLighting.useSpecularEnvironmentMaps){let L=D8e,_=v8e;_=N.multiply(t.uniformState.view3D,I,_),L=N.getMatrix3(_,L),L=Q.getRotation(L,L),this._iblReferenceFrameMatrix=Q.transpose(L,this._iblReferenceFrameMatrix)}if(this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._imageBasedLighting.shouldRegenerateShaders,e9(this)){let L=P8e;L=N.multiply(t.uniformState.view3D,I,L),L=N.multiply(L,w.modelMatrix,L),this._clippingPlanesMatrix=N.inverseTranspose(L,this._clippingPlanesMatrix),D=w.clippingPlanesState}this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._clippingPlanesState!==D,this._clippingPlanesState=D;let O=Q6(this);O!==this._colorShadingEnabled&&(this._colorShadingEnabled=O,this._shouldRegenerateShaders=!0);let B=this.splitDirection!==as.NONE;this._splittingEnabled!==B&&(this._splittingEnabled=B,this._shouldRegenerateShaders=!0),this._shouldRegenerateShaders?I8e(this,e):(Cse(this,e,!1),Ase(this,e,!1),Ese(this,e,!1))}if(o){let A=this;e.afterRender.push(function(){A._ready=!0,A._readyPromise.resolve(A)});return}if(d&&!this._ignoreCommands){let A=e.commandList,b=e.passes,T=this._nodeCommands,S=T.length,w,D,I=e.mapProjection.ellipsoid.maximumRadius*M.PI,O;if(b.render||b.pick&&this.allowPicking){for(w=0;w<S;++w)if(D=T[w],D.show){let B=D.command;s?B=D.silhouetteModelCommand:a?B=D.translucentCommand:u||(B=D.disableCullingCommand),A.push(B),O=D.command.boundingVolume;let L=O.center.y-O.radius,_=O.center.y+O.radius,E=L<I&&_>I||L<-I&&_>-I;if(e.mode===te.SCENE2D&&E){let v=D.command2D;s?v=D.silhouetteModelCommand2D:a?v=D.translucentCommand2D:u||(v=D.disableCullingCommand2D),A.push(v)}}if(s&&!b.pick){for(w=0;w<S;++w)if(D=T[w],D.show){A.push(D.silhouetteColorCommand),O=D.command.boundingVolume;let B=O.center.y-O.radius,L=O.center.y+O.radius,_=B<I&&L>I||B<-I&&L>-I;e.mode===te.SCENE2D&&_&&A.push(D.silhouetteColorCommand2D)}}}}let p=this._credit;l(p)&&e.creditDisplay.addCredit(p);let g=this._resourceCredits,m=g.length;for(let A=0;A<m;A++)e.creditDisplay.addCredit(g[A]);let x=this._gltfCredits,C=x.length;for(let A=0;A<C;A++)e.creditDisplay.addCredit(x[A])};function wse(e,t){e.programs!==t.programs&&Pg(e.programs),e.silhouettePrograms!==t.silhouettePrograms&&Pg(e.silhouettePrograms)}function I8e(e,t){let n=e._rendererResources,i=e._cachedRendererResources;wse(n,i);let r;if(e9(e)||Q6(e)||e.splitDirection!==as.NONE||e._shouldRegenerateShaders){e._shouldRegenerateShaders=!1,n.programs={},n.silhouettePrograms={};let c={},u=e._sourceTechniques,f;for(let d in u)u.hasOwnProperty(d)&&(f=u[d],r=f.program,c[r]||(c[r]=!0,pze({programId:r,techniqueId:d},e,t.context)))}else n.programs=i.programs,n.silhouettePrograms=i.silhouettePrograms;let o=n.programs,s=e._nodeCommands,a=s.length;for(let c=0;c<a;++c){let u=s[c];r=u.programId;let f=o[r];u.command.shaderProgram=f,l(u.command2D)&&(u.command2D.shaderProgram=f)}Cse(e,t,!0),Ase(e,t,!0),Ese(e,t,!0)}qs.prototype.isDestroyed=function(){return!1};qs.prototype.destroy=function(){l(this._precreatedAttributes)&&Pg(this._rendererResources.vertexArrays),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0),l(this._cachedRendererResources)&&wse(this._rendererResources,this._cachedRendererResources),this._rendererResources=void 0,this._cachedRendererResources=this._cachedRendererResources&&this._cachedRendererResources.release(),_l.destroyCachedDataForModel(this);let e=this._pickIds,t=e.length;for(let i=0;i<t;++i)e[i].destroy();Sse(this),this._quantizedVertexShaders=void 0;let n=this._clippingPlanes;return l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,ue(this)};qs._getClippingFunction=wg;qs._modifyShaderForColor=mze;var bp=qs;function fd(e,t,n,i,r){this._tileset=e,this._tile=t,this._resource=n,this._model=void 0,this._batchTable=void 0,this._features=void 0,this._classificationType=e.vectorClassificationOnly?void 0:e.classificationType,this._metadata=void 0,this._batchIdAttributeName=void 0,this._diffuseAttributeOrUniformName={},this._rtcCenterTransform=void 0,this._contentModelMatrix=void 0,this.featurePropertiesDirty=!1,this._group=void 0,L8e(this,i,r)}fd._deprecationWarning=di;Object.defineProperties(fd.prototype,{featuresLength:{get:function(){return this.batchTable.featuresLength}},pointsLength:{get:function(){return this._model.pointsLength}},trianglesLength:{get:function(){return this._model.trianglesLength}},geometryByteLength:{get:function(){return this._model.geometryByteLength}},texturesByteLength:{get:function(){return this._model.texturesByteLength}},batchTableByteLength:{get:function(){return this.batchTable.batchTableByteLength}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._model.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function O8e(e){let t=$t.getAttributeOrUniformBySemantic(e,"_BATCHID");return l(t)||(t=$t.getAttributeOrUniformBySemantic(e,"BATCHID"),l(t)&&fd._deprecationWarning("b3dm-legacy-batchid","The glTF in this b3dm uses the semantic `BATCHID`. Application-specific semantics should be prefixed with an underscore: `_BATCHID`.")),t}function vse(e){return function(t,n){let i=e._batchTable,r=!l(e._classificationType),o=e._model.gltfInternal;l(o)&&(e._batchIdAttributeName=O8e(o),e._diffuseAttributeOrUniformName[n]=$t.getDiffuseAttributeOrUniform(o,n));let s=i.getVertexShaderCallback(r,e._batchIdAttributeName,e._diffuseAttributeOrUniformName[n]);return l(s)?s(t):t}}function R8e(e){return function(t,n){let i=e._batchTable,r=!l(e._classificationType),o=e._model.gltfInternal;l(o)&&(e._diffuseAttributeOrUniformName[n]=$t.getDiffuseAttributeOrUniform(o,n));let s=i.getFragmentShaderCallback(r,e._diffuseAttributeOrUniformName[n],!1);return l(s)?s(t):t}}function Dse(e){return function(){return e._batchTable.getPickId()}}function M8e(e){return function(t){let i=e._batchTable.getClassificationFragmentShaderCallback();return l(i)?i(t):t}}function B8e(e){return function(t,n){e._model.updateCommands(t,n)}}function L8e(e,t,n){let i=e._tileset,r=e._tile,o=e._resource,s=WT.parse(t,n),a=s.batchLength,c=s.featureTableJson,u=s.featureTableBinary,f=new pl(c,u);a=f.getGlobalProperty("BATCH_LENGTH"),f.featuresLength=a;let d=s.batchTableJson,p=s.batchTableBinary,g;l(e._classificationType)&&(g=B8e(e));let m=new ml(e,a,d,p,g);e._batchTable=m;let x=s.gltf,C={content:e,primitive:i};e._rtcCenterTransform=N.IDENTITY;let A=f.getGlobalProperty("RTC_CENTER",K.FLOAT,3);l(A)&&(e._rtcCenterTransform=N.fromTranslation(h.fromArray(A))),e._contentModelMatrix=N.multiply(r.computedTransform,e._rtcCenterTransform,new N),l(e._classificationType)?e._model=new cN({gltf:x,cull:!1,basePath:o,requestType:ro.TILES3D,modelMatrix:e._contentModelMatrix,upAxis:i._modelUpAxis,forwardAxis:i._modelForwardAxis,debugWireframe:i.debugWireframe,vertexShaderLoaded:vse(e),classificationShaderLoaded:M8e(e),uniformMapLoaded:m.getUniformMapCallback(),pickIdLoaded:Dse(e),classificationType:e._classificationType,batchTable:m}):(e._model=new bp({gltf:x,cull:!1,releaseGltfJson:!0,opaquePass:Ce.CESIUM_3D_TILE,basePath:o,requestType:ro.TILES3D,modelMatrix:e._contentModelMatrix,upAxis:i._modelUpAxis,forwardAxis:i._modelForwardAxis,shadows:i.shadows,debugWireframe:i.debugWireframe,incrementallyLoadTextures:!1,vertexShaderLoaded:vse(e),fragmentShaderLoaded:R8e(e),uniformMapLoaded:m.getUniformMapCallback(),pickIdLoaded:Dse(e),addBatchIdToGeneratedShaders:a>0,pickObject:C,lightColor:i.lightColor,imageBasedLighting:i.imageBasedLighting,backFaceCulling:i.backFaceCulling,showOutline:i.showOutline,showCreditsOnScreen:i.showCreditsOnScreen,marsOptions:i._marsOptions}),e._model.readyPromise.then(function(b){b.activeAnimations.addAll({loop:Xr.REPEAT})}))}function N8e(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);for(let i=0;i<t;++i)n[i]=new bo(e,i);e._features=n}}fd.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};fd.prototype.getFeature=function(e){return N8e(this),this._features[e]};fd.prototype.applyDebugSettings=function(e,t){t=e?t:z.WHITE,this.featuresLength===0?this._model.color=t:this._batchTable.setAllColor(t)};fd.prototype.applyStyle=function(e){if(this.featuresLength===0){let t=l(e)&&l(e.color),n=l(e)&&l(e.show);this._model.color=t?e.color.evaluateColor(void 0,this._model.color):z.clone(z.WHITE,this._model.color),this._model.show=n?e.show.evaluate(void 0):!0}else this._batchTable.applyStyle(e)};fd.prototype.update=function(e,t){let n=t.commandList.length,i=this._model,r=this._tile,o=this._batchTable;o.update(e,t),this._contentModelMatrix=N.multiply(r.computedTransform,this._rtcCenterTransform,this._contentModelMatrix),i.modelMatrix=this._contentModelMatrix,i.shadows=e.shadows,i.lightColor=e.lightColor,i.imageBasedLighting=e.imageBasedLighting,i.backFaceCulling=e.backFaceCulling,i.debugWireframe=e.debugWireframe,i.showCreditsOnScreen=e.showCreditsOnScreen,i.splitDirection=e.splitDirection;let s=e.clippingPlanes;i.referenceMatrix=e.clippingPlanesOriginMatrix,l(s)&&r.clippingPlanesDirty&&(i._clippingPlanes=s.enabled&&r._isClipped?s:void 0),l(s)&&l(i._clippingPlanes)&&i._clippingPlanes!==s&&(i._clippingPlanes=s),i.update(t);let a=t.commandList.length;n<a&&(t.passes.render||t.passes.pick)&&!l(this._classificationType)&&o.addDerivedCommands(t,n)};fd.prototype.isDestroyed=function(){return!1};fd.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};var gN=fd;function Ep(e,t,n,i,r,o){this._tileset=e,this._tile=t,this._resource=n,this._contents=[],this._metadata=void 0,this._group=void 0,this._readyPromise=F8e(this,i,r,o)}Object.defineProperties(Ep.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},readyPromise:{get:function(){return this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].metadata=e}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].group=e}}});var ev=Uint32Array.BYTES_PER_ELEMENT;function F8e(e,t,n,i){n=y(n,0);let r=new Uint8Array(t),o=new DataView(t);n+=ev;let s=o.getUint32(n,!0);if(s!==1)throw new fe(`Only Composite Tile version 1 is supported. Version ${s} is not.`);n+=ev,n+=ev;let a=o.getUint32(n,!0);n+=ev;let c=[],u=e._resource,f=u.queryParameters.compositeIndex;l(f)?f=`${f}_`:f="";for(let d=0;d<a;++d){let p=Gu(r,n),g=o.getUint32(n+ev*2,!0),m=i[p],x=`${f}${d}`,C=u.getDerivedResource({queryParameters:{compositeIndex:x}});if(l(m)){let A=m(e._tileset,e._tile,C,t,n);e._contents.push(A),c.push(A.readyPromise)}else throw new fe(`Unknown tile content type, ${p}, inside Composite tile`);n+=g}return Promise.all(c).then(function(){return e})}Ep.prototype.hasProperty=function(e,t){return!1};Ep.prototype.getFeature=function(e){};Ep.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyDebugSettings(e,t)};Ep.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Ep.prototype.update=function(e,t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].update(e,t)};Ep.prototype.isDestroyed=function(){return!1};Ep.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var yN=Ep;function Zl(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,l(this._center)||(l(this._boundingVolume)?this._center=h.clone(this._boundingVolume.center):this._center=h.clone(h.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._update=function(t,n){},this._readyPromise=W8e(this),this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=qn.BOTH}Object.defineProperties(Zl.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},readyPromise:{get:function(){return this._readyPromise}}});Zl.packedBoxLength=N.packedLength+h.packedLength;Zl.packedCylinderLength=N.packedLength+2;Zl.packedEllipsoidLength=N.packedLength+h.packedLength;Zl.packedSphereLength=h.packedLength+1;function V8e(e){let t=new Float64Array(N.packedLength+h.packedLength),n=0;return h.pack(e._center,t,n),n+=h.packedLength,N.pack(e._modelMatrix,t,n),t}function k8e(e,t){let n=0,i=t[n++],r=t[n++],o=e._boundingVolumes=new Array(r);for(let c=0;c<r;++c)o[c]=re.unpack(t,n),n+=re.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let u=z.unpack(t,n);n+=z.packedLength;let f=t[n++],d=t[n++],p=t[n++],g=new Array(p);for(let m=0;m<p;++m)g[m]=t[n++];a[c]=new rf({color:u,offset:f,count:d,batchIds:g})}return i}var U8e=new Mi("createVectorTileGeometries",5),z8e=new z;function H8e(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,r=e._cylinderBatchIds,o=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!l(u)){let m=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),m+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),r=e._cylinderBatchIds=r.slice(),m+=r.length),l(e._ellipsoids)&&(o=e._ellipsoids=o.slice(),s=e._ellipsoidBatchIds=s.slice(),m+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),m+=c.length),u=e._batchTableColors=new Uint32Array(m);let x=e._batchTable;for(let C=0;C<m;++C){let A=x.getColor(C,z8e);u[C]=A.toRgba()}f=e._packedBuffer=V8e(e)}let d=[];l(t)&&d.push(t.buffer,n.buffer),l(i)&&d.push(i.buffer,r.buffer),l(o)&&d.push(o.buffer,s.buffer),l(a)&&d.push(a.buffer,c.buffer),d.push(u.buffer,f.buffer);let p={boxes:l(t)?t.buffer:void 0,boxBatchIds:l(t)?n.buffer:void 0,cylinders:l(i)?i.buffer:void 0,cylinderBatchIds:l(i)?r.buffer:void 0,ellipsoids:l(o)?o.buffer:void 0,ellipsoidBatchIds:l(o)?s.buffer:void 0,spheres:l(a)?a.buffer:void 0,sphereBatchIds:l(a)?c.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},g=e._verticesPromise=U8e.scheduleTask(p,d);return l(g)?g.then(function(m){let x=new Float64Array(m.packedBuffer);k8e(e,x)===2?e._indices=new Uint16Array(m.indices):e._indices=new Uint32Array(m.indices),e._indexOffsets=new Uint32Array(m.indexOffsets),e._indexCounts=new Uint32Array(m.indexCounts),e._positions=new Float32Array(m.positions),e._vertexBatchIds=new Uint16Array(m.vertexBatchIds),e._batchIds=new Uint16Array(m.batchIds),e._ready=!0}):void 0}}function G8e(e){e._ready&&!l(e._primitive)&&(e._primitive=new Eg({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:y(e._pickObject,e)}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}Zl.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Zl.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Zl.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Zl.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};function W8e(e){return new Promise(function(t,n){e._update=function(i,r){let o=H8e(i);i._ready&&(i._primitive.debugWireframe=i.debugWireframe,i._primitive.forceRebatch=i.forceRebatch,i._primitive.classificationType=i.classificationType,i._primitive.update(r)),l(o)&&o.then(function(){G8e(i),t(i)}).catch(function(s){n(s)})}})}Zl.prototype.update=function(e){this._update(this,e)};Zl.prototype.isDestroyed=function(){return!1};Zl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var Og=Zl;function Sp(e,t,n,i,r){this._tileset=e,this._tile=t,this._resource=n,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._readyPromise=Y8e(this,i,r)}Object.defineProperties(Sp.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return l(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function j8e(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function q8e(e,t){let n,i,r,o,s,a=y(e.BOXES_LENGTH,0),c=y(e.CYLINDERS_LENGTH,0),u=y(e.ELLIPSOIDS_LENGTH,0),f=y(e.SPHERES_LENGTH,0);if(a>0&&l(e.BOX_BATCH_IDS)){let m=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,m,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let m=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,m,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let m=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,m,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let m=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,m,f)}let d=l(n)||l(i)||l(r)||l(o),p=a>0&&!l(n)||c>0&&!l(i)||u>0&&!l(r)||f>0&&!l(o);if(d&&p)throw new fe("If one group of batch ids is defined, then all batch ids must be defined.");if(!l(n)&&!l(i)&&!l(r)&&!l(o)){let m=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=m++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=m++;if(!l(r)&&u>0)for(r=new Uint16Array(u),s=0;s<u;++s)r[s]=m++;if(!l(o)&&f>0)for(o=new Uint16Array(f),s=0;s<f;++s)o[s]=m++}return{boxes:n,cylinders:i,ellipsoids:r,spheres:o}}var fx=Uint32Array.BYTES_PER_ELEMENT;function Y8e(e,t,n){n=y(n,0);let i=new Uint8Array(t),r=new DataView(t);n+=fx;let o=r.getUint32(n,!0);if(o!==1)throw new fe(`Only Geometry tile version 1 is supported. Version ${o} is not.`);n+=fx;let s=r.getUint32(n,!0);if(n+=fx,s===0){e._readyPromise.resolve(e);return}let a=r.getUint32(n,!0);if(n+=fx,a===0)throw new fe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=fx;let u=r.getUint32(n,!0);n+=fx;let f=r.getUint32(n,!0);n+=fx;let d=Vr(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let g,m;u>0&&(g=Vr(i,n,u),n+=u,f>0&&(m=new Uint8Array(t,n,f),m=new Uint8Array(m)));let x=y(d.BOXES_LENGTH,0),C=y(d.CYLINDERS_LENGTH,0),A=y(d.ELLIPSOIDS_LENGTH,0),b=y(d.SPHERES_LENGTH,0),T=x+C+A+b,S=new ml(e,T,g,m,j8e(e));if(e._batchTable=S,T===0)return;let w=e.tile.computedTransform,D;l(d.RTC_CENTER)&&(D=h.unpack(d.RTC_CENTER),N.multiplyByPoint(w,D,D));let I=q8e(d,p);if(x>0||C>0||A>0||b>0){let O,B,L,_;if(x>0){let E=p.byteOffset+d.BOXES.byteOffset;O=new Float32Array(p.buffer,E,Og.packedBoxLength*x)}if(C>0){let E=p.byteOffset+d.CYLINDERS.byteOffset;B=new Float32Array(p.buffer,E,Og.packedCylinderLength*C)}if(A>0){let E=p.byteOffset+d.ELLIPSOIDS.byteOffset;L=new Float32Array(p.buffer,E,Og.packedEllipsoidLength*A)}if(b>0){let E=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,E,Og.packedSphereLength*b)}return e._geometries=new Og({boxes:O,boxBatchIds:I.boxes,cylinders:B,cylinderBatchIds:I.cylinders,ellipsoids:L,ellipsoidBatchIds:I.ellipsoids,spheres:_,sphereBatchIds:I.spheres,center:D,modelMatrix:w,batchTable:S,boundingVolume:e.tile.boundingVolume.boundingVolume}),e._geometries.readyPromise.then(function(){return e})}return Promise.resolve(e)}function Pse(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}Sp.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Sp.prototype.getFeature=function(e){return Pse(this),this._features[e]};Sp.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};Sp.prototype.applyStyle=function(e){Pse(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};Sp.prototype.update=function(e,t){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),l(this._batchTable)&&this._geometries._ready&&this._batchTable.update(e,t)};Sp.prototype.isDestroyed=function(){return!1};Sp.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};var xN=Sp;function ir(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}function Rg(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,r=e.bitstream;if(l(i))n=t;else{let o=Math.ceil(t/8);if(r.length!==o)throw new fe(`Availability bitstream must be exactly ${o} bytes long to store ${t} bits. Actual bitstream was ${r.length} bytes long.`);let s=y(e.computeAvailableCountEnabled,!1);!l(n)&&s&&(n=X8e(r,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=r}function X8e(e,t){let n=0;for(let i=0;i<t;i++){let r=i>>3,o=i%8;n+=e[r]>>o&1}return n}Object.defineProperties(Rg.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});Rg.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};function gl(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataTable,n=e.class,i=e.entityId,r=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=r.extensions,this._extras=r.extras}Object.defineProperties(gl.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});gl.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};gl.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};gl.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};gl.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};gl.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};gl.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};gl.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var CN={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};CN.getBranchingFactor=function(e){switch(e){case CN.OCTREE:return 8;case CN.QUADTREE:return 4}};var cs=Object.freeze(CN);function Ys(){}Object.defineProperties(Ys.prototype,{class:{get:function(){ye.throwInstantiationError()}}});Ys.prototype.hasProperty=function(e){ye.throwInstantiationError()};Ys.prototype.hasPropertyBySemantic=function(e){ye.throwInstantiationError()};Ys.prototype.getPropertyIds=function(e){ye.throwInstantiationError()};Ys.prototype.getProperty=function(e){ye.throwInstantiationError()};Ys.prototype.setProperty=function(e,t){ye.throwInstantiationError()};Ys.prototype.getPropertyBySemantic=function(e){ye.throwInstantiationError()};Ys.prototype.setPropertyBySemantic=function(e,t){ye.throwInstantiationError()};Ys.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let r=i[e];return!!(l(r)&&l(r.default))};Ys.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let r=i[e];return l(r)};Ys.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let r in e)e.hasOwnProperty(r)&&l(e[r])&&n.push(r);let i=t.properties;if(l(i))for(let r in i)i.hasOwnProperty(r)&&!l(e[r])&&l(i[r].default)&&n.push(r);return n};Ys.getProperty=function(e,t,n){let i=n.properties[e],r=t[e];Array.isArray(r)&&(r=r.slice());let o=!0;if(r=i.handleNoData(r),!l(r)&&l(i.default))return r=$e(i.default,!0),i.unpackVectorAndMatrixTypes(r,o);if(!!l(r))return r=i.normalize(r),r=i.applyValueTransform(r),i.unpackVectorAndMatrixTypes(r,o)};Ys.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let r,o=i.properties;l(o)&&(r=o[e]);let s=!0;return l(r)&&(t=r.packVectorAndMatrixTypes(t,s),t=r.unapplyValueTransform(t),t=r.unnormalize(t)),n[e]=t,!0};Ys.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let r=i[e];if(l(r))return Ys.getProperty(r.id,t,n)};Ys.setPropertyBySemantic=function(e,t,n,i){let r=i.propertiesBySemantic;if(!l(r))return!1;let o=i.propertiesBySemantic[e];return l(o)?Ys.setProperty(o.id,t,n,i):!1};var Nn=Ys;function wp(e){e=y(e,y.EMPTY_OBJECT);let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(wp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});wp.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};wp.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};wp.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};wp.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};wp.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};wp.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};wp.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};var AN=wp;var Rt={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Rt.getMinimum=function(e){switch(e){case Rt.INT8:return-128;case Rt.UINT8:return 0;case Rt.INT16:return-32768;case Rt.UINT16:return 0;case Rt.INT32:return-2147483648;case Rt.UINT32:return 0;case Rt.INT64:return Et.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Rt.UINT64:return Et.supportsBigInt()?BigInt(0):0;case Rt.FLOAT32:return-34028234663852886e22;case Rt.FLOAT64:return-Number.MAX_VALUE}};Rt.getMaximum=function(e){switch(e){case Rt.INT8:return 127;case Rt.UINT8:return 255;case Rt.INT16:return 32767;case Rt.UINT16:return 65535;case Rt.INT32:return 2147483647;case Rt.UINT32:return 4294967295;case Rt.INT64:return Et.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Rt.UINT64:return Et.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Rt.FLOAT32:return 34028234663852886e22;case Rt.FLOAT64:return Number.MAX_VALUE}};Rt.isNumericType=function(e){switch(e){case Rt.INT8:case Rt.UINT8:case Rt.INT16:case Rt.UINT16:case Rt.INT32:case Rt.UINT32:case Rt.INT64:case Rt.UINT64:case Rt.FLOAT32:case Rt.FLOAT64:return!0;default:return!1}};Rt.isIntegerType=function(e){switch(e){case Rt.INT8:case Rt.UINT8:case Rt.INT16:case Rt.UINT16:case Rt.INT32:case Rt.UINT32:case Rt.INT64:case Rt.UINT64:return!0;default:return!1}};Rt.isUnsignedIntegerType=function(e){switch(e){case Rt.UINT8:case Rt.UINT16:case Rt.UINT32:case Rt.UINT64:return!0;default:return!1}};Rt.isVectorCompatible=function(e){switch(e){case Rt.INT8:case Rt.UINT8:case Rt.INT16:case Rt.UINT16:case Rt.INT32:case Rt.UINT32:case Rt.FLOAT32:case Rt.FLOAT64:return!0;default:return!1}};Rt.normalize=function(e,t){return Math.max(Number(e)/Number(Rt.getMaximum(t)),-1)};Rt.unnormalize=function(e,t){let n=Rt.getMaximum(t),i=Rt.isUnsignedIntegerType(t)?0:-n;return e=M.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Rt.INT64||t===Rt.UINT64)&&Et.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};Rt.applyValueTransform=function(e,t,n){return n*e+t};Rt.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};Rt.getSizeInBytes=function(e){switch(e){case Rt.INT8:case Rt.UINT8:return 1;case Rt.INT16:case Rt.UINT16:return 2;case Rt.INT32:case Rt.UINT32:return 4;case Rt.INT64:case Rt.UINT64:return 8;case Rt.FLOAT32:return 4;case Rt.FLOAT64:return 8}};var Dn=Object.freeze(Rt);var zr={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};zr.isVectorType=function(e){switch(e){case zr.VEC2:case zr.VEC3:case zr.VEC4:return!0;default:return!1}};zr.isMatrixType=function(e){switch(e){case zr.MAT2:case zr.MAT3:case zr.MAT4:return!0;default:return!1}};zr.getComponentCount=function(e){switch(e){case zr.SCALAR:case zr.STRING:case zr.ENUM:case zr.BOOLEAN:return 1;case zr.VEC2:return 2;case zr.VEC3:return 3;case zr.VEC4:return 4;case zr.MAT2:return 4;case zr.MAT3:return 9;case zr.MAT4:return 16}};zr.getMathType=function(e){switch(e){case zr.VEC2:return W;case zr.VEC3:return h;case zr.VEC4:return se;case zr.MAT2:return Ri;case zr.MAT3:return Q;case zr.MAT4:return N;default:return}};var Fn=Object.freeze(zr);function Oc(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.property,i=K8e(n),r=$8e(n,e.enums),o=r.componentType,s=l(o)&&Dn.isIntegerType(o)&&y(n.normalized,!1);this._id=t,this._name=n.name,this._description=n.description,this._semantic=n.semantic,this._isLegacyExtension=i,this._type=r.type,this._componentType=o,this._enumType=r.enumType,this._valueType=r.valueType,this._isArray=r.isArray,this._isVariableLengthArray=r.isVariableLengthArray,this._arrayLength=r.arrayLength,this._min=n.min,this._max=n.max,this._normalized=s;let a=n.offset,c=n.scale,u=l(a)||l(c),f=!0;l(a)||(a=this.expandConstant(0,f)),l(c)||(c=this.expandConstant(1,f)),this._offset=a,this._scale=c,this._hasValueTransform=u,this._noData=n.noData,this._default=n.default;let d;l(i)?i?d=l(n.optional)?!n.optional:!0:d=y(n.required,!1):d=!1,this._required=d,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(Oc.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function K8e(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===Fn.SCALAR||Fn.isMatrixType(t)||Fn.isVectorType(t))return!1;if(Dn.isNumericType(t))return!0;if(l(e.noData)||l(e.scale)||l(e.offset)||l(e.required)||l(e.count)||l(e.array)||l(e.optional))return!1}function $8e(e,t){let n=e.type,i=e.componentType,r=n==="ARRAY",o,s,a;r?(o=!0,s=e.componentCount,a=!l(s)):e.array?(o=!0,s=e.count,a=!l(e.count)):(o=!1,s=void 0,a=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===Fn.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:a,arrayLength:s};if(r&&i===Fn.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:a,arrayLength:s};if(n===Fn.SCALAR||Fn.isMatrixType(n)||Fn.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:a,arrayLength:s};if(n===Fn.BOOLEAN||n===Fn.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:a,arrayLength:s};if(r&&(i===Fn.BOOLEAN||i===Fn.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:a,arrayLength:s};if(l(i)&&Dn.isNumericType(i))return{type:Fn.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:a,arrayLength:s};if(Dn.isNumericType(n))return{type:Fn.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:o,isVariableLengthArray:a,arrayLength:s}}Oc.prototype.normalize=function(e){return this._normalized?s9(e,this._valueType,Dn.normalize):e};Oc.prototype.unnormalize=function(e){return this._normalized?s9(e,this._valueType,Dn.unnormalize):e};Oc.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Oc.valueTransformInPlace(e,this._offset,this._scale,Dn.applyValueTransform)};Oc.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Oc.valueTransformInPlace(e,this._offset,this._scale,Dn.unapplyValueTransform)};Oc.prototype.expandConstant=function(e,t){t=y(t,!1);let n=this._isArray,i=this._arrayLength,r=Fn.getComponentCount(this._type),o=n&&r>1;if(!n&&r===1)return e;if(!n)return new Array(r).fill(e);if(!o)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*r).fill(e);let s=new Array(r).fill(e);return new Array(this._arrayLength).fill(s)};Oc.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!Mse(e,t))return e};function Mse(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Mse(e[n],t[n]))return!1;return!0}Oc.prototype.unpackVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=Fn.getMathType(this._type),i=this._isArray,r=Fn.getComponentCount(this._type),o=i&&r>1;return l(n)?t&&o?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};Oc.prototype.packVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=Fn.getMathType(this._type),i=this._isArray,r=Fn.getComponentCount(this._type),o=i&&r>1;return l(n)?t&&o?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};Oc.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?Z8e(this,e):Bse(this,e)};function Z8e(e,t){if(!Array.isArray(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i<n;i++){let r=Bse(e,t[i]);if(l(r))return r}}function Bse(e,t){let n=e._type,i=e._componentType,r=e._enumType,o=e._normalized;return Fn.isVectorType(n)?J8e(t,n,i):Fn.isMatrixType(n)?Q8e(t,n,i):n===Fn.STRING?eHe(t):n===Fn.BOOLEAN?tHe(t):n===Fn.ENUM?nHe(t,r):iHe(t,i,o)}function J8e(e,t,n){if(!Dn.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===Fn.VEC2&&!(e instanceof W))return`vector value ${e} must be a Cartesian2`;if(t===Fn.VEC3&&!(e instanceof h))return`vector value ${e} must be a Cartesian3`;if(t===Fn.VEC4&&!(e instanceof se))return`vector value ${e} must be a Cartesian4`}function Q8e(e,t,n){if(!Dn.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===Fn.MAT2&&!(e instanceof Ri))return`matrix value ${e} must be a Matrix2`;if(t===Fn.MAT3&&!(e instanceof Q))return`matrix value ${e} must be a Matrix3`;if(t===Fn.MAT4&&!(e instanceof N))return`matrix value ${e} must be a Matrix4`}function eHe(e){if(typeof e!="string")return TN(e,Fn.STRING)}function tHe(e){if(typeof e!="boolean")return TN(e,Fn.BOOLEAN)}function nHe(e,t){let n=typeof e;if(l(t))return n!=="string"||!l(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function iHe(e,t,n){let i=typeof e;switch(t){case Dn.INT8:case Dn.UINT8:case Dn.INT16:case Dn.UINT16:case Dn.INT32:case Dn.UINT32:case Dn.FLOAT32:case Dn.FLOAT64:return i!=="number"?TN(e,t):isFinite(e)?Ose(e,t,n):Rse(e,t);case Dn.INT64:case Dn.UINT64:return i!=="number"&&i!=="bigint"?TN(e,t):i==="number"&&!isFinite(e)?Rse(e,t):Ose(e,t,n)}}function TN(e,t){return`value ${e} does not match type ${t}`}function Ise(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function Ose(e,t,n){if(n){let i=Dn.isUnsignedIntegerType(t)?0:-1,r=1;return e<i||e>r?Ise(e,t,n):void 0}if(e<Dn.getMinimum(t)||e>Dn.getMaximum(t))return Ise(e,t,n)}function Rse(e,t){return`value ${e} of type ${t} must be finite`}function s9(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=s9(e[i],t,n);return e}Oc.valueTransformInPlace=function(e,t,n,i){if(!Array.isArray(e))return i(e,t,n);for(let r=0;r<e.length;r++)e[r]=Oc.valueTransformInPlace(e[r],t[r],n[r],i);return e};var dx=Oc;function tv(e){e=y(e,y.EMPTY_OBJECT);let t=e.count,n=e.property,i=e.classProperty,r=e.bufferViews,o=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,u=i.enumType,f=o===Fn.STRING,d=o===Fn.BOOLEAN,p=0,g;if(a){let _=y(n.arrayOffsetType,n.offsetType);_=y(Dn[_],Dn.UINT32);let E=y(n.arrayOffsets,n.arrayOffsetBufferView);g=new a9(r[E],_,t+1),p+=g.typedArray.byteLength}let m=Fn.getComponentCount(o),x;a?x=g.get(t)-g.get(0):s?x=t*i.arrayLength:x=t;let C=m*x,A;if(f){let _=y(n.stringOffsetType,n.offsetType);_=y(Dn[_],Dn.UINT32);let E=y(n.stringOffsets,n.stringOffsetBufferView);A=new a9(r[E],_,C+1),p+=A.typedArray.byteLength}(f||d)&&(c=Dn.UINT8);let b;f?b=A.get(C)-A.get(0):d?b=Math.ceil(C/8):b=C;let T=y(n.values,n.bufferView),S=new a9(r[T],c,b);p+=S.typedArray.byteLength;let w=n.offset,D=n.scale,I=i.hasValueTransform||l(w)||l(D);w=y(w,i.offset),D=y(D,i.scale),w=Lse(w),D=Lse(D);let O,B,L=this;f?O=function(_){return sHe(_,L._values,L._stringOffsets)}:d?(O=function(_){return aHe(_,L._values)},B=function(_,E){cHe(_,L._values,E)}):l(u)?(O=function(_){let E=L._values.get(_);return u.namesByValue[E]},B=function(_,E){let v=u.valuesByName[E];L._values.set(_,v)}):(O=function(_){return L._values.get(_)},B=function(_,E){L._values.set(_,E)}),this._arrayOffsets=g,this._stringOffsets=A,this._values=S,this._classProperty=i,this._count=t,this._vectorComponentCount=m,this._min=n.min,this._max=n.max,this._offset=w,this._scale=D,this._hasValueTransform=I,this._getValue=O,this._setValue=B,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(tv.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}}});tv.prototype.get=function(e){let t=rHe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=_He(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};tv.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=gHe(this,t),t=n.unnormalize(t),oHe(this,e,t)};tv.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function Lse(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?t.push.apply(t,i):t.push(i)}return t}function rHe(e,t){Fse(e)&&Vse(e);let n=e._classProperty,i=n.isArray,r=n.type,o=Fn.getComponentCount(r);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?$e(s,!0):s}return!i&&o===1?e._getValue(t):Nse(e,n,t)}function Nse(e,t,n){let i,r;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),r=e._arrayOffsets.get(n+1)-i;let s=Fn.getComponentCount(t.type);i*=s,r*=s}else{let a=y(t.arrayLength,1)*e._vectorComponentCount;i=n*a,r=a}let o=new Array(r);for(let s=0;s<r;s++)o[s]=e._getValue(i+s);return o}function oHe(e,t,n){mHe(e,t,n)&&Vse(e);let i=e._classProperty,r=i.isArray,o=i.type,s=Fn.getComponentCount(o);if(l(e._unpackedValues)){i.isArray&&(n=$e(n,!0)),e._unpackedValues[t]=n;return}if(!r&&s===1){e._setValue(t,n);return}let a,c;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-a;else{let f=y(i.arrayLength,1)*e._vectorComponentCount;a=t*f,c=f}for(let u=0;u<c;++u)e._setValue(a+u,n[u])}function sHe(e,t,n){let i=n.get(e),r=n.get(e+1)-i;return fa(t.typedArray,i,r)}function aHe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function cHe(e,t,n){let i=e>>3,r=e%8;n?t.typedArray[i]|=1<<r:t.typedArray[i]&=~(1<<r)}function lHe(e,t){let n=t.dataView,i=e*8,r=0,o=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);o&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),r+=c*Math.pow(256,a)}return o&&(r=-r),r}function uHe(e,t){let n=t.dataView,i=e*8,r=BigInt(0),o=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);o&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),r+=BigInt(c)*(BigInt(1)<<BigInt(a*8))}return o&&(r=-r),r}function fHe(e,t){let n=t.dataView,i=e*8,r=n.getUint32(i,!0),o=n.getUint32(i+4,!0);return r+4294967296*o}function dHe(e,t){let n=t.dataView,i=e*8,r=BigInt(n.getUint32(i,!0)),o=BigInt(n.getUint32(i+4,!0));return r+BigInt(4294967296)*o}function hHe(e){switch(e){case Dn.INT8:return K.BYTE;case Dn.UINT8:return K.UNSIGNED_BYTE;case Dn.INT16:return K.SHORT;case Dn.UINT16:return K.UNSIGNED_SHORT;case Dn.INT32:return K.INT;case Dn.UINT32:return K.UNSIGNED_INT;case Dn.FLOAT32:return K.FLOAT;case Dn.FLOAT64:return K.DOUBLE}}function Fse(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===Fn.STRING||i===Dn.INT64&&!Et.supportsBigInt64Array()||i===Dn.UINT64&&!Et.supportsBigUint64Array()}function mHe(e,t,n){if(Fse(e))return!0;let i=e._arrayOffsets;if(l(i)){let r=i.get(t+1)-i.get(t),o=n.length;if(r!==o)return!0}return!1}function Vse(e){e._unpackedValues=pHe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function pHe(e){let t=e._count,n=new Array(t),i=e._classProperty,r=i.isArray,o=i.type,s=Fn.getComponentCount(o);if(!r&&s===1){for(let a=0;a<t;++a)n[a]=e._getValue(a);return n}for(let a=0;a<t;a++)n[a]=Nse(e,i,a);return n}function _He(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:dx.valueTransformInPlace(t,e._offset,e._scale,Dn.applyValueTransform)}function gHe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:dx.valueTransformInPlace(t,e._offset,e._scale,Dn.unapplyValueTransform)}function a9(e,t,n){let i=this,r,o,s;if(t===Dn.INT64)Et.supportsBigInt()?Et.supportsBigInt64Array()?(r=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return uHe(a,i)}):(Lt("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return lHe(a,i)});else if(t===Dn.UINT64)Et.supportsBigInt()?Et.supportsBigUint64Array()?(r=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return dHe(a,i)}):(Lt("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return fHe(a,i)});else{let a=hHe(t);r=K.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,u){i.typedArray[c]=u}}l(o)||(o=function(a){return i.typedArray[a]}),this.typedArray=r,this.dataView=new DataView(r.buffer,r.byteOffset),this.get=o,this.set=s,this._componentType=t}var bN=tv;function dd(e){e=y(e,y.EMPTY_OBJECT);let t=e.count,n=e.class,i=0,r={};if(l(e.properties)){for(let o in e.properties)if(e.properties.hasOwnProperty(o)){let s=new bN({count:t,property:e.properties[o],classProperty:n.properties[o],bufferViews:e.bufferViews});r[o]=s,i+=s.byteLength}}this._count=t,this._class=n,this._properties=r,this._byteLength=i}Object.defineProperties(dd.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});dd.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};dd.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};dd.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};dd.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=yHe(this._class,t),i};dd.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};dd.prototype.getPropertyBySemantic=function(e,t){let n,i=this._class.propertiesBySemantic;if(l(i)&&(n=i[t]),l(n))return this.getProperty(e,n.id)};dd.prototype.setPropertyBySemantic=function(e,t,n){let i,r=this._class.propertiesBySemantic;return l(r)&&(i=r[t]),l(i)?this.setProperty(e,i.id,n):!1};dd.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};dd.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function yHe(e,t){let n=e.properties;if(!l(n))return;let i=n[t];if(l(i)&&l(i.default)){let r=i.default;return i.isArray&&(r=$e(r,!0)),r=i.normalize(r),i.unpackVectorAndMatrixTypes(r)}}var hd=dd;function hi(){}Object.defineProperties(hi.prototype,{promise:{get:function(){ye.throwInstantiationError()}},cacheKey:{get:function(){ye.throwInstantiationError()}}});hi.prototype.load=function(){ye.throwInstantiationError()};hi.prototype.unload=function(){};hi.prototype.process=function(e){};hi.prototype.getError=function(e,t){l(t)&&(e+=`
- ${t.message}`);let n=new fe(e);return l(t)&&(n.stack=`Original stack:
- ${t.stack}
- Handler stack:
- ${n.stack}`),n};hi.prototype.isDestroyed=function(){return!1};hi.prototype.destroy=function(){return this.unload(),ue(this)};var xHe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},Vt=Object.freeze(xHe);function Rc(e){e=y(e,y.EMPTY_OBJECT);let t=e.typedArray,n=e.resource,i=e.cacheKey;this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=Vt.UNLOADED,this._promise=void 0}l(Object.create)&&(Rc.prototype=Object.create(hi.prototype),Rc.prototype.constructor=Rc);Object.defineProperties(Rc.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});Rc.prototype.load=function(){return l(this._typedArray)?this._promise=Promise.resolve(this):this._promise=CHe(this),this._promise};function CHe(e){let t=e._resource;return e._state=Vt.LOADING,Rc._fetchArrayBuffer(t).then(function(n){if(!e.isDestroyed())return e._typedArray=new Uint8Array(n),e._state=Vt.READY,e}).catch(function(n){if(e.isDestroyed())return;e._state=Vt.FAILED;let i=`Failed to load external buffer: ${t.url}`;return Promise.reject(e.getError(i,n))})}Rc._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};Rc.prototype.unload=function(){this._typedArray=void 0};var rv=Ns(Hse(),1);function Jl(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,r=e.gltfResource,o=e.baseResource,s=e.cacheKey,a=n.bufferViews[i],c=a.buffer,u=a.byteOffset,f=a.byteLength,d=!1,p,g,m,x;if(ir(a,"EXT_meshopt_compression")){let A=a.extensions.EXT_meshopt_compression;c=A.buffer,u=y(A.byteOffset,0),f=A.byteLength,d=!0,p=A.byteStride,g=A.count,m=A.mode,x=y(A.filter,"NONE")}let C=n.buffers[c];this._hasMeshopt=d,this._meshoptByteStride=p,this._meshoptCount=g,this._meshoptMode=m,this._meshoptFilter=x,this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._buffer=C,this._bufferId=c,this._byteOffset=u,this._byteLength=f,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=Vt.UNLOADED,this._promise=void 0,this._process=function(A,b){}}l(Object.create)&&(Jl.prototype=Object.create(hi.prototype),Jl.prototype.constructor=Jl);Object.defineProperties(Jl.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});Jl.prototype.load=function(){let e=bHe(this);this._bufferLoader=e,this._state=Vt.LOADING;let t=this,n=new Promise(function(i){t._process=function(r,o){if(!r._hasMeshopt||!l(r._typedArray)||r._state!==Vt.PROCESSING)return;let s=r._meshoptCount,a=r._meshoptByteStride,c=new Uint8Array(s*a);rv.MeshoptDecoder.decodeGltfBuffer(c,s,a,r._typedArray,r._meshoptMode,r._meshoptFilter),r._typedArray=c,r._state=Vt.READY,i(r)}});return this._promise=e.promise.then(function(){if(t.isDestroyed())return;let i=e.typedArray,r=new Uint8Array(i.buffer,i.byteOffset+t._byteOffset,t._byteLength);return t.unload(),t._typedArray=r,t._hasMeshopt?(t._state=Vt.PROCESSING,n):(t._state=Vt.READY,t)}).catch(function(i){if(t.isDestroyed())return;t.unload(),t._state=Vt.FAILED;let r="Failed to load buffer view";return Promise.reject(t.getError(r,i))}),this._promise};function bHe(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let r=e._baseResource.getDerivedResource({url:n.uri});return t.loadExternalBuffer({resource:r})}return t.loadEmbeddedBuffer({parentResource:e._gltfResource,bufferId:e._bufferId})}Jl.prototype.process=function(e){return this._process(this,e)};Jl.prototype.unload=function(){l(this._bufferLoader)&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};function Ql(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.draco,r=e.gltfResource,o=e.baseResource,s=e.cacheKey;this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._gltf=n,this._draco=i,this._cacheKey=s,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=Vt.UNLOADED,this._promise=void 0,this._process=function(a,c){}}l(Object.create)&&(Ql.prototype=Object.create(hi.prototype),Ql.prototype.constructor=Ql);Object.defineProperties(Ql.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});Ql.prototype.load=function(){let t=this._resourceCache.loadBufferView({gltf:this._gltf,bufferViewId:this._draco.bufferView,gltfResource:this._gltfResource,baseResource:this._baseResource});this._bufferViewLoader=t,this._state=Vt.LOADING;let n=this,i=new Promise(function(r,o){n._process=function(s,a){if(!l(s._bufferViewTypedArray)||l(s._decodePromise))return;let c=s._draco,f=s._gltf.bufferViews,d=c.bufferView,p=f[d],g=c.attributes,m={array:new Uint8Array(s._bufferViewTypedArray),bufferView:p,compressedAttributes:g,dequantizeInShader:!0},x=_l.decodeBufferView(m);!l(x)||(s._decodePromise=x.then(function(C){if(s.isDestroyed()){r();return}s.unload(),s._decodedData={indices:C.indexArray,vertexAttributes:C.attributeData},s._state=Vt.READY,r(s)}).catch(function(C){if(s.isDestroyed()){r();return}o(C)}))}});return this._promise=t.promise.then(function(){if(!n.isDestroyed())return n._bufferViewTypedArray=t.typedArray,n._state=Vt.PROCESSING,i}).catch(function(r){if(!n.isDestroyed())return EHe(n,r)}),this._promise};function EHe(e,t){e.unload(),e._state=Vt.FAILED;let n="Failed to load Draco";return Promise.reject(e.getError(n,t))}Ql.prototype.process=function(e){return this._process(this,e)};Ql.prototype.unload=function(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0};function yl(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.imageId,r=e.gltfResource,o=e.baseResource,s=e.cacheKey,a=n.images[i],c=a.bufferView,u=a.uri;this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._gltf=n,this._bufferViewId=c,this._uri=u,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=Vt.UNLOADED,this._promise=void 0}l(Object.create)&&(yl.prototype=Object.create(hi.prototype),yl.prototype.constructor=yl);Object.defineProperties(yl.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});yl.prototype.load=function(){return l(this._bufferViewId)?(this._promise=SHe(this),this._promise):(this._promise=wHe(this),this._promise)};function Gse(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}function SHe(e){let n=e._resourceCache.loadBufferView({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,e._state=Vt.LOADING,n.promise.then(function(){if(e.isDestroyed())return;let i=n.typedArray;return DHe(i).then(function(r){if(e.isDestroyed())return;let o=Gse(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=Vt.READY,e})}).catch(function(i){if(!e.isDestroyed())return Wse(e,i,"Failed to load embedded image")})}function wHe(e){let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});return e._state=Vt.LOADING,IHe(i).then(function(r){if(e.isDestroyed())return;let o=Gse(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=Vt.READY,e}).catch(function(r){if(!e.isDestroyed())return Wse(e,r,`Failed to load image: ${n}`)})}function Wse(e,t,n){return e.unload(),e._state=Vt.FAILED,Promise.reject(e.getError(n,t))}function vHe(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new fe("Image format is not recognized")}function DHe(e){let t=vHe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Ua(n)}return yl._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var PHe=/(^data:image\/ktx2)|(\.ktx2$)/i;function IHe(e){let t=e.url;return PHe.test(t)?Ua(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}yl.prototype.unload=function(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0};yl._loadImageFromTypedArray=Y_;function eu(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.accessorId,r=e.gltfResource,o=e.baseResource,s=e.draco,a=e.cacheKey,c=y(e.asynchronous,!0),u=y(e.loadBuffer,!1),f=y(e.loadTypedArray,!1),d=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._gltf=n,this._accessorId=i,this._indexDatatype=d,this._draco=s,this._cacheKey=a,this._asynchronous=c,this._loadBuffer=u,this._loadTypedArray=f,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=Vt.UNLOADED,this._promise=void 0,this._process=function(p,g){}}l(Object.create)&&(eu.prototype=Object.create(hi.prototype),eu.prototype.constructor=eu);Object.defineProperties(eu.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});var OHe=new u9;eu.prototype.load=function(){let e;l(this._draco)?e=RHe(this):e=MHe(this);let t=this,n=new Promise(function(i){t._process=function(r,o){if(r._state===Vt.READY)return;let s=r._typedArray,a=r._indexDatatype;if(l(r._dracoLoader)&&r._dracoLoader.process(o),l(r._bufferViewLoader)&&r._bufferViewLoader.process(o),!l(s))return;let c;if(r._loadBuffer&&r._asynchronous){let u=OHe;if(u.set(s,a,o.context),!o.jobScheduler.execute(u,ss.BUFFER))return;c=u.buffer}else r._loadBuffer&&(c=jse(s,a,o.context));r.unload(),r._buffer=c,r._typedArray=r._loadTypedArray?s:void 0,r._state=Vt.READY,i(r)}});return this._promise=e.then(function(){if(!t.isDestroyed())return n}).catch(function(i){if(!t.isDestroyed())return LHe(t,i)}),this._promise};function RHe(e){let n=e._resourceCache.loadDraco({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,e._state=Vt.LOADING,n.promise.then(function(){if(e.isDestroyed())return;let i=n.decodedData.indices.typedArray;return e._typedArray=i,e._indexDatatype=K.fromTypedArray(i),e._state=Vt.PROCESSING,e})}function MHe(e){let t=e._gltf,n=e._accessorId,r=t.accessors[n].bufferView,s=e._resourceCache.loadBufferView({gltf:t,bufferViewId:r,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._state=Vt.LOADING,e._bufferViewLoader=s,s.promise.then(function(){if(e.isDestroyed())return;let a=s.typedArray;return e._typedArray=BHe(e,a),e._state=Vt.PROCESSING,e})}function BHe(e,t){let n=e._gltf,i=e._accessorId,r=n.accessors[i],o=r.count,s=r.componentType,a=t.buffer,c=t.byteOffset+r.byteOffset,u;return s===Le.UNSIGNED_BYTE?u=new Uint8Array(a,c,o):s===Le.UNSIGNED_SHORT?u=new Uint16Array(a,c,o):s===Le.UNSIGNED_INT&&(u=new Uint32Array(a,c,o)),u}function LHe(e,t){e.unload(),e._state=Vt.FAILED;let n="Failed to load index buffer";return t=e.getError(n,t),Promise.reject(t)}function u9(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}u9.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};u9.prototype.execute=function(){this.buffer=jse(this.typedArray,this.indexDatatype,this.context)};function jse(e,t,n){let i=at.createIndexBuffer({typedArray:e,context:n,usage:Ne.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}eu.prototype.process=function(e){return this._process(this,e)};eu.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};function NHe(e){return Ae.shader(e,function(t){wN(t)}),Ae.buffer(e,function(t){wN(t)}),Ae.image(e,function(t){wN(t)}),wN(e),e}function wN(e){!l(e.extras)||(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var vN=NHe;function tu(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltfResource,i=e.baseResource,r=e.typedArray,o=e.gltfJson,s=e.cacheKey;this._resourceCache=t,this._gltfResource=n,this._baseResource=i,this._typedArray=r,this._gltfJson=o,this._cacheKey=s,this._gltf=void 0,this._bufferLoaders=[],this._state=Vt.UNLOADED,this._promise=void 0}l(Object.create)&&(tu.prototype=Object.create(hi.prototype),tu.prototype.constructor=tu);Object.defineProperties(tu.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});tu.prototype.load=function(){this._state=Vt.LOADING;let e;l(this._gltfJson)?e=qse(this,this._gltfJson):l(this._typedArray)?e=Yse(this,this._typedArray):e=FHe(this);let t=this;return this._promise=e.then(function(n){if(!t.isDestroyed())return t._gltf=n,t._state=Vt.READY,t}).catch(function(n){if(!t.isDestroyed())return VHe(t,n)}),this._promise};function FHe(e){return e._fetchGltf().then(function(t){if(e.isDestroyed())return;let n=new Uint8Array(t);return Yse(e,n)})}function VHe(e,t){e.unload(),e._state=Vt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;return Promise.reject(e.getError(n,t))}function kHe(e,t){if(t.asset.version==="2.0")return Promise.resolve();let n=[];return Ae.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let r=e._baseResource.getDerivedResource({url:i.uri}),s=e._resourceCache.loadExternalBuffer({resource:r});e._bufferLoaders.push(s),n.push(s.promise.then(function(a){i.extras._pipeline.source=a.typedArray}))}}),Promise.all(n).then(function(){Tg(t)})}function UHe(e){let t=[];return Ae.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&m_(i)&&(delete n.uri,t.push(De.fetchArrayBuffer(i).then(function(r){n.extras._pipeline.source=new Uint8Array(r)})))}),Promise.all(t)}function zHe(e,t){let n=[];return Ae.buffer(t,function(i,r){let o=i.extras._pipeline.source;if(l(o)&&!l(i.uri)){let a=e._resourceCache.loadEmbeddedBuffer({parentResource:e._gltfResource,bufferId:r,typedArray:o});e._bufferLoaders.push(a),n.push(a.promise)}}),Promise.all(n)}function qse(e,t){return yp(t),UHe(t).then(function(){return kHe(e,t)}).then(function(){return Cg(t),zHe(e,t)}).then(function(){return vN(t),t})}function Yse(e,t){let n;return Gu(t)==="glTF"?n=xp(t):n=Vr(t),qse(e,n)}tu.prototype.unload=function(){let e=this._bufferLoaders,t=e.length;for(let n=0;n<t;++n)this._resourceCache.unload(e[n]);this._bufferLoaders.length=0,this._gltf=void 0};tu.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var HHe={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},vp=Object.freeze(HHe);var Kr={};function GHe(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0}function WHe(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0}function jHe(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function qHe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}function YHe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0}function XHe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}function KHe(){this.attributes=[]}function $He(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0}function ZHe(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function JHe(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function QHe(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0}function e5e(){this.nodes=[]}var t5e={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function n5e(){this.input=[],this.interpolation=void 0,this.output=[]}function i5e(){this.node=void 0,this.path=void 0}function r5e(){this.sampler=void 0,this.target=void 0}function o5e(){this.name=void 0,this.samplers=[],this.channels=[]}function s5e(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function a5e(){this.name=void 0,this.stages=[]}function Xse(){this.credits=[]}function c5e(){this.asset=new Xse,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=N.clone(N.IDENTITY)}function l5e(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=Q.clone(Q.IDENTITY),this.channels=void 0}function Mg(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=se.clone(Mg.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=Mg.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=Mg.DEFAULT_ROUGHNESS_FACTOR}Mg.DEFAULT_BASE_COLOR_FACTOR=se.ONE;Mg.DEFAULT_METALLIC_FACTOR=1;Mg.DEFAULT_ROUGHNESS_FACTOR=1;function hx(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=se.clone(hx.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(hx.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=hx.DEFAULT_GLOSSINESS_FACTOR}hx.DEFAULT_DIFFUSE_FACTOR=se.ONE;hx.DEFAULT_SPECULAR_FACTOR=h.ONE;hx.DEFAULT_GLOSSINESS_FACTOR=1;function f9(){this.metallicRoughness=new Mg,this.specularGlossiness=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=h.clone(f9.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=vp.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}f9.DEFAULT_EMISSIVE_FACTOR=h.ZERO;Kr.Quantization=GHe;Kr.Attribute=WHe;Kr.Indices=jHe;Kr.FeatureIdAttribute=qHe;Kr.FeatureIdTexture=XHe;Kr.FeatureIdImplicitRange=YHe;Kr.MorphTarget=KHe;Kr.Primitive=$He;Kr.Instances=ZHe;Kr.Skin=JHe;Kr.Node=QHe;Kr.Scene=e5e;Kr.AnimatedPropertyType=Object.freeze(t5e);Kr.AnimationSampler=n5e;Kr.AnimationTarget=i5e;Kr.AnimationChannel=r5e;Kr.Animation=o5e;Kr.ArticulationStage=s5e;Kr.Articulation=a5e;Kr.Asset=Xse;Kr.Components=c5e;Kr.TextureReader=l5e;Kr.MetallicRoughness=Mg;Kr.SpecularGlossiness=hx;Kr.Material=f9;var kt=Kr;var DN={};DN.getImageIdFromTexture=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.textureId,i=e.supportedImageFormats,r=t.textures[n],o=r.extensions;if(l(o)){if(i.webp&&l(o.EXT_texture_webp))return o.EXT_texture_webp.source;if(i.basis&&l(o.KHR_texture_basisu))return o.KHR_texture_basisu.source}return r.source};DN.createSampler=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.textureInfo,i=y(e.compressedTextureNoMipmap,!1),r=mn.REPEAT,o=mn.REPEAT,s=It.LINEAR,a=Xi.LINEAR,c=n.index,f=t.textures[c].sampler;if(l(f)){let g=t.samplers[f];r=y(g.wrapS,r),o=y(g.wrapT,o),s=y(g.minFilter,s),a=y(g.magFilter,a)}let d=!1,p=n.extensions;return l(p)&&l(p.KHR_texture_transform)&&(d=!0),(i||d)&&s!==It.LINEAR&&s!==It.NEAREST&&(s===It.NEAREST_MIPMAP_NEAREST||s===It.NEAREST_MIPMAP_LINEAR?s=It.NEAREST:s=It.LINEAR),new on({wrapS:r,wrapT:o,minificationFilter:s,magnificationFilter:a})};var u5e=new W(1,1);DN.createModelTextureReader=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.textureInfo,n=e.channels,i=e.texture,r=y(t.texCoord,0),o,s=y(t.extensions,y.EMPTY_OBJECT).KHR_texture_transform;if(l(s)){r=y(s.texCoord,r);let c=l(s.offset)?W.unpack(s.offset):W.ZERO,u=y(s.rotation,0),f=l(s.scale)?W.unpack(s.scale):u5e;u=-u,o=new Q(Math.cos(u)*f.x,-Math.sin(u)*f.y,c.x,Math.sin(u)*f.x,Math.cos(u)*f.y,c.y,0,0,1)}let a=new kt.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=r,a.transform=o,a.channels=n,a};var nu=DN;function iu(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.textureInfo,r=e.gltfResource,o=e.baseResource,s=e.supportedImageFormats,a=e.cacheKey,c=y(e.asynchronous,!0),u=i.index,f=nu.getImageIdFromTexture({gltf:n,textureId:u,supportedImageFormats:s});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=f,this._gltfResource=r,this._baseResource=o,this._cacheKey=a,this._asynchronous=c,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=Vt.UNLOADED,this._promise=void 0,this._process=function(d,p){}}l(Object.create)&&(iu.prototype=Object.create(hi.prototype),iu.prototype.constructor=iu);Object.defineProperties(iu.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var f5e=new d9;iu.prototype.load=function(){let t=this._resourceCache.loadImage({gltf:this._gltf,imageId:this._imageId,gltfResource:this._gltfResource,baseResource:this._baseResource});this._imageLoader=t,this._state=Vt.LOADING;let n=this,i=new Promise(function(r){n._process=function(o,s){if(l(o._texture)||!l(o._image))return;let a;if(o._asynchronous){let c=f5e;if(c.set(o._gltf,o._textureInfo,o._image,o._mipLevels,s.context),!s.jobScheduler.execute(c,ss.TEXTURE))return;a=c.texture}else a=Kse(o._gltf,o._textureInfo,o._image,o._mipLevels,s.context);o.unload(),o._texture=a,o._state=Vt.READY,r(o)}});return this._promise=t.promise.then(function(){if(!n.isDestroyed())return n._image=t.image,n._mipLevels=t.mipLevels,n._state=Vt.PROCESSING,i}).catch(function(r){if(n.isDestroyed())return;n.unload(),n._state=Vt.FAILED;let o="Failed to load texture";return Promise.reject(n.getError(o,r))}),this._promise};function d9(){this.gltf=void 0,this.textureInfo=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}d9.prototype.set=function(e,t,n,i,r){this.gltf=e,this.textureInfo=t,this.image=n,this.mipLevels=i,this.context=r};d9.prototype.execute=function(){this.texture=Kse(this.gltf,this.textureInfo,this.image,this.mipLevels,this.context)};function Kse(e,t,n,i,r){let o=n.internalFormat,s=!1;ct.isCompressedFormat(o)&&!l(i)&&(s=!0);let a=nu.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:s}),c=a.minificationFilter,u=a.wrapS,f=a.wrapT,d=c===It.NEAREST_MIPMAP_NEAREST||c===It.NEAREST_MIPMAP_LINEAR||c===It.LINEAR_MIPMAP_NEAREST||c===It.LINEAR_MIPMAP_LINEAR,p=!l(o)&&d,g=p||u===mn.REPEAT||u===mn.MIRRORED_REPEAT||f===mn.REPEAT||f===mn.MIRRORED_REPEAT,m=!M.isPowerOfTwo(n.width)||!M.isPowerOfTwo(n.height),x=g&&m,C;return l(o)?(!r.webgl2&&ct.isCompressedFormat(o)&&m&&g&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),C=wt.create({context:r,source:{arrayBufferView:n.bufferView,mipLevels:i},width:n.width,height:n.height,pixelFormat:n.internalFormat,sampler:a})):(x&&(n=zy(n)),C=wt.create({context:r,source:n,sampler:a,flipY:!1,skipColorSpaceConversion:!0})),p&&C.generateMipmap(),C}iu.prototype.process=function(e){return this._process(this,e)};iu.prototype.unload=function(){l(this._texture)&&this._texture.destroy(),l(this._imageLoader)&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0};function ru(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.gltfResource,r=e.baseResource,o=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=e.accessorId,u=e.cacheKey,f=y(e.asynchronous,!0),d=y(e.dequantize,!1),p=y(e.loadBuffer,!1),g=y(e.loadTypedArray,!1);this._resourceCache=t,this._gltfResource=i,this._baseResource=r,this._gltf=n,this._bufferViewId=o,this._draco=s,this._attributeSemantic=a,this._accessorId=c,this._cacheKey=u,this._asynchronous=f,this._dequantize=d,this._loadBuffer=p,this._loadTypedArray=g,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=Vt.UNLOADED,this._promise=void 0,this._process=function(m,x){}}l(Object.create)&&(ru.prototype=Object.create(hi.prototype),ru.prototype.constructor=ru);Object.defineProperties(ru.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},quantization:{get:function(){return this._quantization}}});ru.prototype.load=function(){let e;l(this._draco)?e=h5e(this):e=m5e(this);let t=this,n=new h9,i=new Promise(function(r){t._process=function(o,s){if(o._state===Vt.READY)return;let a=o._typedArray,c=o._dequantize;if(l(o._dracoLoader)&&o._dracoLoader.process(s),l(o._bufferViewLoader)&&o._bufferViewLoader.process(s),!l(a))return;let u=o._gltf.accessors[o._accessorId],f;if(o._loadBuffer&&o._asynchronous){let d=n;if(d.set(a,c,u.componentType,u.type,u.count,s.context),!s.jobScheduler.execute(d,ss.BUFFER))return;f=d.buffer}else o._loadBuffer&&(f=$se(a,c,u.componentType,u.type,u.count,s.context));o.unload(),o._buffer=f,o._typedArray=o._loadTypedArray?a:void 0,o._state=Vt.READY,r(o)}});return this._promise=e.then(function(){if(!t.isDestroyed())return i}).catch(function(r){if(!t.isDestroyed())return p5e(t,r)}),this._promise};function d5e(e,t,n,i){let r=e.quantizationBits,o=(1<<r)-1,s=1/o,a=new kt.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=qt.VEC2,a.normalizationRange=o;else{let c=qt.getMathType(i);if(c===Number){let u=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=u,a.normalizationRange=o,a.quantizedVolumeStepSize=u*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(o));let u=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(u);let f=u.map(function(d){return d*s});a.quantizedVolumeStepSize=c.unpack(f)}}return a}function h5e(e){let n=e._resourceCache.loadDraco({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,e._state=Vt.LOADING,n.promise.then(function(){if(e.isDestroyed())return;let i=n.decodedData.vertexAttributes,r=e._attributeSemantic,o=i[r],s=e._accessorId,c=e._gltf.accessors[s].type,u=o.array,f=o.data.quantization;return l(f)&&(e._quantization=d5e(f,o.data.componentDatatype,o.data.componentsPerAttribute,c)),e._typedArray=new Uint8Array(u.buffer,u.byteOffset,u.byteLength),e._state=Vt.PROCESSING,e})}function m5e(e){let n=e._resourceCache.loadBufferView({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._state=Vt.LOADING,e._bufferViewLoader=n,n.promise.then(function(){if(!e.isDestroyed())return e._typedArray=n.typedArray,e._state=Vt.PROCESSING,e})}function p5e(e,t){e.unload(),e._state=Vt.FAILED;let n="Failed to load vertex buffer";return t=e.getError(n,t),Promise.reject(t)}function h9(){this.typedArray=void 0,this.dequantize=void 0,this.componentType=void 0,this.type=void 0,this.count=void 0,this.context=void 0,this.buffer=void 0}h9.prototype.set=function(e,t,n,i,r,o){this.typedArray=e,this.dequantize=t,this.componentType=n,this.type=i,this.count=r,this.context=o};h9.prototype.execute=function(){this.buffer=$se(this.typedArray,this.dequantize,this.componentType,this.type,this.count,this.context)};function $se(e,t,n,i,r,o){t&&n!==K.FLOAT&&(e=In.dequantize(e,n,i,r));let s=at.createVertexBuffer({typedArray:e,context:o,usage:Ne.STATIC_DRAW});return s.vertexArrayDestroyable=!1,s}ru.prototype.process=function(e){return this._process(this,e)};ru.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};function m9(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.class,i={},r={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let s=new dx({id:o,property:n.properties[o],enums:e.enums});i[o]=s,l(s.semantic)&&(r[s.semantic]=s)}this._properties=i,this._propertiesBySemantic=r,this._id=t,this._name=n.name,this._description=n.description,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(m9.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});m9.BATCH_TABLE_CLASS_NAME="_batchTable";var $h=m9;function Zse(e){this._value=e.value,this._name=e.name,this._description=e.description,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(Zse.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var PN=Zse;function Jse(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.enum,i={},r={},o=n.values.map(function(a){return i[a.value]=a.name,r[a.name]=a.value,new PN(a)}),s=y(Dn[n.valueType],Dn.UINT16);this._values=o,this._namesByValue=i,this._valuesByName=r,this._valueType=s,this._id=t,this._name=n.name,this._description=n.description,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(Jse.prototype,{values:{get:function(){return this._values}},namesByValue:{get:function(){return this._namesByValue}},valuesByName:{get:function(){return this._valuesByName}},valueType:{get:function(){return this._valueType}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var IN=Jse;function Qse(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=new IN({id:i,enum:e.enums[i]}));let n={};if(l(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=new $h({id:i,class:e.classes[i],enums:t}));this._classes=n,this._enums=t,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(Qse.prototype,{classes:{get:function(){return this._classes}},enums:{get:function(){return this._enums}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},version:{get:function(){return this._version}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var Zh=Qse;function of(e){e=y(e,y.EMPTY_OBJECT);let t=e.schema,n=e.resource,i=e.cacheKey;this._schema=l(t)?new Zh(t):void 0,this._resource=n,this._cacheKey=i,this._state=Vt.UNLOADED,this._promise=void 0}l(Object.create)&&(of.prototype=Object.create(hi.prototype),of.prototype.constructor=of);Object.defineProperties(of.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});of.prototype.load=function(){return l(this._schema)?this._promise=Promise.resolve(this):this._promise=_5e(this),this._promise};function _5e(e){let t=e._resource;return e._state=Vt.LOADING,t.fetchJson().then(function(n){if(!e.isDestroyed())return e._schema=new Zh(n),e._state=Vt.READY,e}).catch(function(n){if(e.isDestroyed())return;e._state=Vt.FAILED;let i=`Failed to load schema: ${t.url}`;return Promise.reject(e.getError(i,n))})}of.prototype.unload=function(){this._schema=void 0};var md={};function ov(e){return Wf(e.url)}function ON(e){let t=e.byteOffset,n=e.byteLength;if(ir(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=y(i.byteOffset,0),n=i.byteLength}return`${t}-${t+n}`}function g5e(e,t){let n=t.byteOffset+e.byteOffset,i=e.componentType,r=e.type,o=e.count;return`${n}-${i}-${r}-${o}`}function eae(e){return ov(e)}function tae(e,t){return`${ov(e)}-buffer-id-${t}`}function sv(e,t,n,i){if(l(e.uri)){let r=i.getDerivedResource({url:e.uri});return eae(r)}return tae(n,t)}function p9(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=sv(a,s,n,i),u=ON(o);return`${c}-range-${u}`}function nae(e,t,n,i){let r=e.images[t],o=r.bufferView,s=r.uri;if(l(s)){let p=i.getDerivedResource({url:s});return ov(p)}let a=e.bufferViews[o],c=a.buffer,u=e.buffers[c],f=sv(u,c,n,i),d=ON(a);return`${f}-range-${d}`}function y5e(e,t){let n=nu.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}md.getSchemaCacheKey=function(e){let t=e.schema,n=e.resource;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${ov(n)}`};md.getExternalBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.resource;return`external-buffer:${eae(t)}`};md.getEmbeddedBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.parentResource,n=e.bufferId;return`embedded-buffer:${tae(t,n)}`};md.getGltfCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltfResource;return`gltf:${ov(t)}`};md.getBufferViewCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.bufferViewId,i=e.gltfResource,r=e.baseResource,o=t.bufferViews[n],s=o.buffer,a=t.buffers[s];ir(o,"EXT_meshopt_compression")&&(s=o.extensions.EXT_meshopt_compression.buffer);let c=sv(a,s,i,r),u=ON(o);return`buffer-view:${c}-range-${u}`};md.getDracoCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.draco,i=e.gltfResource,r=e.baseResource;return`draco:${p9(t,n,i,r)}`};md.getVertexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.gltfResource,i=e.baseResource,r=e.bufferViewId,o=e.draco,s=e.attributeSemantic,a=y(e.dequantize,!1),c=y(e.loadBuffer,!1),u=y(e.loadTypedArray,!1),f="";if(a&&(f+="-dequantize"),c&&(f+="-buffer"),u&&(f+="-typed-array"),l(o))return`vertex-buffer:${p9(t,o,n,i)}-draco-${s}${f}`;let d=t.bufferViews[r],p=d.buffer,g=t.buffers[p],m=sv(g,p,n,i),x=ON(d);return`vertex-buffer:${m}-range-${x}${f}`};md.getIndexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.accessorId,i=e.gltfResource,r=e.baseResource,o=e.draco,s=y(e.loadBuffer,!1),a=y(e.loadTypedArray,!1),c="";if(s&&(c+="-buffer"),a&&(c+="-typed-array"),l(o))return`index-buffer:${p9(t,o,i,r)}-draco${c}`;let u=t.accessors[n],f=u.bufferView,d=t.bufferViews[f],p=d.buffer,g=t.buffers[p],m=sv(g,p,i,r),x=g5e(u,d);return`index-buffer:${m}-accessor-${x}${c}`};md.getImageCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.imageId,i=e.gltfResource,r=e.baseResource;return`image:${nae(t,n,i,r)}`};md.getTextureCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.textureInfo,i=e.gltfResource,r=e.baseResource,o=e.supportedImageFormats,s=n.index,a=nu.getImageIdFromTexture({gltf:t,textureId:s,supportedImageFormats:o}),c=nae(t,a,i,r),u=y5e(t,n);return`texture:${c}-sampler-${u}`};var ou=md;function Dp(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}Dp.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};Dp.prototype.addGeometryLoader=function(e){let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=this;return e.promise.then(function(i){if(!n._geometrySizes.hasOwnProperty(t))return;let r=i.buffer,o=i.typedArray,s=0;l(r)&&(s+=r.sizeInBytes),l(o)&&(s+=o.byteLength),n.geometryByteLength+=s,n._geometrySizes[t]=s}).catch(function(){delete n._geometrySizes[t]})};Dp.prototype.addTextureLoader=function(e){let t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;let n=this;return e.promise.then(function(i){if(!n._textureSizes.hasOwnProperty(t))return;let r=i.texture.sizeInBytes;n.texturesByteLength+=i.texture.sizeInBytes,n._textureSizes[t]=r}).catch(function(){delete n._textureSizes[t]})};Dp.prototype.removeLoader=function(e){let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],l(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],l(i)&&(this.texturesByteLength-=i)};function yn(){}yn.cacheEntries={};yn.statistics=new Dp;function x5e(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}yn.get=function(e){let t=yn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};yn.load=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceLoader,n=t.cacheKey;yn.cacheEntries[n]=new x5e(t),t.load()};yn.unload=function(e){let t=e.cacheKey,n=yn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(yn.statistics.removeLoader(e),e.destroy(),delete yn.cacheEntries[t])};yn.loadSchema=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.schema,n=e.resource,i=ou.getSchemaCacheKey({schema:t,resource:n}),r=yn.get(i);return l(r)||(r=new of({schema:t,resource:n,cacheKey:i}),yn.load({resourceLoader:r})),r};yn.loadEmbeddedBuffer=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.parentResource,n=e.bufferId,i=e.typedArray,r=ou.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),o=yn.get(r);return l(o)||(o=new Rc({typedArray:i,cacheKey:r}),yn.load({resourceLoader:o})),o};yn.loadExternalBuffer=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.resource,n=ou.getExternalBufferCacheKey({resource:t}),i=yn.get(n);return l(i)||(i=new Rc({resource:t,cacheKey:n}),yn.load({resourceLoader:i})),i};yn.loadGltfJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltfResource,n=e.baseResource,i=e.typedArray,r=e.gltfJson,o=ou.getGltfCacheKey({gltfResource:t}),s=yn.get(o);return l(s)||(s=new tu({resourceCache:yn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:r,cacheKey:o}),yn.load({resourceLoader:s})),s};yn.loadBufferView=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.bufferViewId,i=e.gltfResource,r=e.baseResource,o=ou.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}),s=yn.get(o);return l(s)||(s=new Jl({resourceCache:yn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:r,cacheKey:o}),yn.load({resourceLoader:s})),s};yn.loadDraco=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.draco,i=e.gltfResource,r=e.baseResource,o=ou.getDracoCacheKey({gltf:t,draco:n,gltfResource:i,baseResource:r}),s=yn.get(o);return l(s)||(s=new Ql({resourceCache:yn,gltf:t,draco:n,gltfResource:i,baseResource:r,cacheKey:o}),yn.load({resourceLoader:s})),s};yn.loadVertexBuffer=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.gltfResource,i=e.baseResource,r=e.bufferViewId,o=e.draco,s=e.attributeSemantic,a=e.accessorId,c=y(e.asynchronous,!0),u=y(e.dequantize,!1),f=y(e.loadBuffer,!1),d=y(e.loadTypedArray,!1),p=ou.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,draco:o,attributeSemantic:s,dequantize:u,loadBuffer:f,loadTypedArray:d}),g=yn.get(p);if(l(g))return g;g=new ru({resourceCache:yn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,draco:o,attributeSemantic:s,accessorId:a,cacheKey:p,asynchronous:c,dequantize:u,loadBuffer:f,loadTypedArray:d}),yn.load({resourceLoader:g});let m=yn.statistics.addGeometryLoader(g);return yn.cacheEntries[p]._statisticsPromise=m,g};yn.loadIndexBuffer=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.accessorId,i=e.gltfResource,r=e.baseResource,o=e.draco,s=y(e.asynchronous,!0),a=y(e.loadBuffer,!1),c=y(e.loadTypedArray,!1),u=ou.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:r,draco:o,loadBuffer:a,loadTypedArray:c}),f=yn.get(u);if(l(f))return f;f=new eu({resourceCache:yn,gltf:t,accessorId:n,gltfResource:i,baseResource:r,draco:o,cacheKey:u,asynchronous:s,loadBuffer:a,loadTypedArray:c}),yn.load({resourceLoader:f});let d=yn.statistics.addGeometryLoader(f);return yn.cacheEntries[u]._statisticsPromise=d,f};yn.loadImage=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.imageId,i=e.gltfResource,r=e.baseResource,o=ou.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:r}),s=yn.get(o);return l(s)||(s=new yl({resourceCache:yn,gltf:t,imageId:n,gltfResource:i,baseResource:r,cacheKey:o}),yn.load({resourceLoader:s})),s};yn.loadTexture=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.textureInfo,i=e.gltfResource,r=e.baseResource,o=e.supportedImageFormats,s=y(e.asynchronous,!0),a=ou.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o}),c=yn.get(a);if(l(c))return c;c=new iu({resourceCache:yn,gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,cacheKey:a,asynchronous:s}),yn.load({resourceLoader:c});let u=yn.statistics.addTextureLoader(c);return yn.cacheEntries[a]._statisticsPromise=u,c};yn.clearForSpecs=function(){let e=[ru,eu,Ql,iu,yl,Jl,Rc,of,tu],t,n=yn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(o,s){let a=e.indexOf(o.resourceLoader.constructor),c=e.indexOf(s.resourceLoader.constructor);return a-c});let r=i.length;for(let o=0;o<r;++o){let s=i[o];t=s.resourceLoader.cacheKey,l(n[t])&&(s.resourceLoader.destroy(),delete n[t])}yn.statistics.clear()};var Ar=yn;function gs(e,t,n,i,r){this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=r,this._subtreeLevels=i.subtreeLevels,this._subdivisionScheme=i.subdivisionScheme,this._branchingFactor=i.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._readyPromise=C5e(this,t,n,i)}Object.defineProperties(gs.prototype,{readyPromise:{get:function(){return this._readyPromise}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}});gs.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};gs.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};gs.prototype.contentIsAvailableAtIndex=function(e,t){return t=y(t,0),this._contentAvailabilityBitstreams[t].getBit(e)};gs.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};gs.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};gs.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};gs.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};gs.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===cs.OCTREE&&(t=3),e>>t};function C5e(e,t,n,i){let r;l(t)?r={json:t,binary:void 0}:r=A5e(n);let o=r.json;e._subtreeJson=o;let s;if(ir(o,"3DTILES_metadata"))s=o.extensions["3DTILES_metadata"];else if(l(o.tileMetadata)){let m=o.tileMetadata;s=o.propertyTables[m]}let a=[];if(l(o.contentMetadata)){let m=o.contentMetadata.length;for(let x=0;x<m;x++){let C=o.contentMetadata[x];a.push(o.propertyTables[C])}}let c,u=i.metadataSchema,f=o.subtreeMetadata;if(l(f)){let m=f.class,x=u.classes[m];c=new AN({subtreeMetadata:f,class:x})}e._metadata=c,e._tilePropertyTableJson=s,e._contentPropertyTableJsons=a;let d={constant:0};o.contentAvailabilityHeaders=[],ir(o,"3DTILES_multiple_contents")?o.contentAvailabilityHeaders=o.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(o.contentAvailability)?o.contentAvailabilityHeaders=o.contentAvailability:o.contentAvailabilityHeaders.push(y(o.contentAvailability,d));let p=T5e(o.buffers),g=b5e(o.bufferViews,p);E5e(o,g),l(s)&&iae(s,g);for(let m=0;m<a.length;m++){let x=a[m];iae(x,g)}return S5e(e,p,r.binary).then(function(m){let x=v5e(g,m);return D5e(e,o,i,x),l(s)&&(P5e(e,i,x),O5e(e)),I5e(e,i,x),R5e(e),e})}function A5e(e){let n=new DataView(e.buffer,e.byteOffset),i=8,r=n.getUint32(i,!0);i+=8;let o=n.getUint32(i,!0);i+=8;let s=Vr(e,i,r);i+=r;let a=e.subarray(i,i+o);return{json:s,binary:a}}function T5e(e){e=l(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=l(n.uri),n.isActive=!1}return e}function b5e(e,t){e=l(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],r=t[i.buffer];i.bufferHeader=r,i.isActive=!1}return e}function E5e(e,t){let n,i=e.tileAvailability;l(i.bitstream)?n=t[i.bitstream]:l(i.bufferView)&&(n=t[i.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let r=e.contentAvailabilityHeaders;for(let s=0;s<r.length;s++)n=void 0,l(r[s].bitstream)?n=t[r[s].bitstream]:l(r[s].bufferView)&&(n=t[r[s].bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let o=e.childSubtreeAvailability;l(o.bitstream)?n=t[o.bitstream]:l(o.bufferView)&&(n=t[o.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function iae(e,t){let n=e.properties,i;for(let r in n)if(n.hasOwnProperty(r)){let o=n[r],s=y(o.values,o.bufferView);i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=y(o.stringOffsets,o.stringOffsetBufferView);l(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=y(o.arrayOffsets,o.arrayOffsetBufferView);l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function S5e(e,t,n){let i=[];for(let r=0;r<t.length;r++){let o=t[r];if(!o.isActive)i.push(Promise.resolve(void 0));else if(o.isExternal){let s=w5e(e,o);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(r){let o={};for(let s=0;s<r.length;s++){let a=r[s];l(a)&&(o[s]=a)}return o})}function w5e(e,t){let i=e._resource.getDerivedResource({url:t.uri}),r=Ar.loadExternalBuffer({resource:i});return e._bufferLoader=r,r.promise.then(function(o){return o.typedArray})}function v5e(e,t){let n={};for(let i=0;i<e.length;i++){let r=e[i];if(!r.isActive)continue;let o=r.byteOffset,s=o+r.byteLength,c=t[r.buffer].subarray(o,s);n[i]=c}return n}function D5e(e,t,n,i){let r=n.branchingFactor,o=n.subtreeLevels,s=(Math.pow(r,o)-1)/(r-1),a=Math.pow(r,o),c=ir(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=_9(t.tileAvailability,i,s,f);let d=e._contentPropertyTableJsons.length>0;f=f||d;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=_9(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=_9(t.childSubtreeAvailability,i,a)}function _9(e,t,n,i){if(l(e.constant))return new Rg({constant:Boolean(e.constant),lengthBits:n,availableCount:e.availableCount});let r;return l(e.bitstream)?r=t[e.bitstream]:l(e.bufferView)&&(r=t[e.bufferView]),new Rg({bitstream:r,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function P5e(e,t,n){let i=e._tilePropertyTableJson,r=e._tileAvailability.availableCount,o=t.metadataSchema,s=i.class,a=o.classes[s];e._tileMetadataTable=new hd({class:a,count:r,properties:i.properties,bufferViews:n})}function I5e(e,t,n){let i=e._contentPropertyTableJsons,r=e._contentAvailabilityBitstreams,o=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],f=r[a].availableCount,d=c.class,p=o.classes[d],g=new hd({class:p,count:f,properties:c.properties,bufferViews:n});s.push(g)}}function rae(e){let t=0,n=e.lengthBits,i=e.availableCount,r;i<256?r=new Uint8Array(n):i<65536?r=new Uint16Array(n):r=new Uint32Array(n);for(let o=0;o<e.lengthBits;o++)e.getBit(o)&&(r[o]=t,t++);return r}function O5e(e){let t=rae(e._tileAvailability);e._tileJumpBuffer=t}function R5e(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let r=n[i],o=rae(r);t.push(o)}}gs.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new fe("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};gs.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new fe("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function M5e(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function B5e(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let r=i[n];if(!l(r))return;let o=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(o.getBit(s))return e._contentJumpBuffers[n][s]}gs.prototype.getTileMetadataView=function(e){let t=M5e(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new gl({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};gs.prototype.getContentMetadataView=function(e,t){let n=B5e(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],r=this._contentPropertyTableJsons[t];return new gl({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:r})};gs.prototype.isDestroyed=function(){return!1};gs.prototype.destroy=function(){return l(this._bufferLoader)&&Ar.unload(this._bufferLoader),ue(this)};var L5e={ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"},RN=Object.freeze(L5e);function av(e){return{tile:{boundingVolume:oae("TILE",e),minimumHeight:sae("TILE",e),maximumHeight:aae("TILE",e)},content:{boundingVolume:oae("CONTENT",e),minimumHeight:sae("CONTENT",e),maximumHeight:aae("CONTENT",e)}}}function oae(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let r=`${e}_BOUNDING_REGION`,o=t.getPropertyBySemantic(r);if(l(o))return{region:o};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(l(a))return{sphere:a}}function sae(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)}function aae(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)}function ga(e,t,n,i,r,o){let s=t.implicitTileset,a=t.implicitCoordinates;this._implicitTileset=s,this._implicitCoordinates=a,this._implicitSubtree=void 0,this._tileset=e,this._tile=t,this._resource=n,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let c=a.getTemplateValues(),u=s.subtreeUriTemplate.getDerivedResource({templateValues:c});this._url=u.getUrlComponent(!0),this._readyPromise=N5e(this,i,r,o)}Object.defineProperties(ga.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._url}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function N5e(e,t,n,i){i=y(i,0);let r;l(n)&&(r=new Uint8Array(n,i));let o=new gs(e._resource,t,r,e._implicitTileset,e._implicitCoordinates);return e._implicitSubtree=o,o.readyPromise.then(function(){return F5e(e,o),e})}function F5e(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,r=k5e(e,t,n,i),o=e._tileset.statistics;n.children.push(r.rootTile),o.numberOfTilesTotal++;let s=V5e(e,t,r.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],u=c.tile,f=X5e(e,u,c.childIndex);u.children.push(f),o.numberOfTilesTotal++}}function V5e(e,t,n){let i=[],r=e._implicitTileset.branchingFactor;for(let o=0;o<n.length;o++){let s=n[o];if(!!l(s))for(let a=0;a<r;a++){let c=o*r+a;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:s,childIndex:a})}}return i}function k5e(e,t,n,i){let s=cae(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],u=[],f=e._implicitTileset;for(let d=1;d<f.subtreeLevels;d++){let p=t.getLevelOffset(d),g=f.branchingFactor*c.length;for(let m=0;m<g;m++){let x=p+m;if(!t.tileIsAvailableAtIndex(x)){u.push(void 0);continue}let C=t.getParentMortonIndex(m),A=c[C],b=m%f.branchingFactor,T=cae(e,t,A,b,x);A.children.push(T),a.numberOfTilesTotal++,u.push(T)}c=u,u=[]}return{rootTile:s,bottomRow:c}}function lae(e,t,n){let i=RN.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function cae(e,t,n,i,r,o){let s=e._implicitTileset,a;y(o,!1)?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,u,f;if(l(t.tilePropertyTableJson)){c=t.getTileMetadataView(a);let D=av(c);u=D.tile,f=D.content}let p=t.contentPropertyTableJsons.length,g=!1;for(let D=0;D<p;D++)if(t.contentIsAvailableAtCoordinates(a,D)){g=!0;break}let m=H5e(s,a,i,o,n,u),x=[];for(let D=0;D<s.contentCount;D++){if(!t.contentIsAvailableAtIndex(r,D))continue;let B={uri:s.contentUriTemplates[D].getDerivedResource({templateValues:a.getTemplateValues()}).url},L=G5e(m,f);l(L)&&(B.boundingVolume=L),x.push(rt(B,s.contentHeaders[D]))}let C=lae(c,s,a),A={boundingVolume:m,geometricError:C,refine:s.refine,contents:x},b=!0,T=$e(s.tileHeader,b);delete T.boundingVolume,delete T.transform;let S=rt(A,T,b),w=mae(e,s.baseResource,S,n);return w.implicitCoordinates=a,w.implicitSubtree=t,w.metadata=c,w.hasImplicitContentMetadata=g,w}function MN(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(ir(e,"3DTILES_bounding_volume_S2")||l(e.region))}function y9(e,t){!l(t)||(ir(e,"3DTILES_bounding_volume_S2")?z5e(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&U5e(e.region,t.minimumHeight,t.maximumHeight))}function U5e(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function z5e(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function H5e(e,t,n,i,r,o){let s;return!l(o)||!l(o.boundingVolume)||!MN(o.boundingVolume,o)&&MN(e.boundingVolume,o)?s=uae(e,t,n,y(i,!1),r):s=o.boundingVolume,y9(s,o),s}function G5e(e,t){let n;return l(t)&&(n=t.boundingVolume),MN(n,t)?y9(n,t):MN(e,t)&&(n=$e(e,!0),y9(n,t)),n}function uae(e,t,n,i,r){let o=e.boundingVolume;return ir(o,"3DTILES_bounding_volume_S2")?fae(i,r,n,t.level,t.x,t.y,t.z):l(o.region)?{region:hae(o.region,t.level,t.x,t.y,t.z)}:{box:dae(o.box,t.level,t.x,t.y,t.z)}}function fae(e,t,n,i,r,o,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:ng.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?XS.encode2D(i,r,o):XS.encode2D(i,o,r),f=ng.fromFacePositionLevel(c,BigInt(u),i),d,p;if(l(s)){let g=(a.maximumHeight+a.minimumHeight)/2;d=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else d=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:ng.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var W5e=new h,j5e=new h,g9=new h,q5e=new Q;function dae(e,t,n,i,r){if(t===0)return e;let o=h.unpack(e,0,j5e),s=Q.unpack(e,3,q5e),a=Math.pow(2,-t),c=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,d=h.fromElements(a,a,1,W5e);l(r)&&(f=-1+(2*r+1)*a,d.z=a);let p=h.fromElements(c,u,f,g9);p=Q.multiplyByVector(s,p,g9),p=h.add(p,o,g9);let g=Q.clone(s);g=Q.multiplyByScale(g,d,g);let m=new Array(12);return h.pack(p,m),Q.pack(g,m,3),m}var Y5e=new he;function hae(e,t,n,i,r){if(t===0)return e.slice();let o=he.unpack(e,0,Y5e),s=e[4],a=e[5],c=Math.pow(2,-t),u=c*o.width,f=M.negativePiToPi(o.west+n*u),d=M.negativePiToPi(f+u),p=c*o.height,g=M.negativePiToPi(o.south+i*p),m=M.negativePiToPi(g+p),x=s,C=a;if(l(r)){let A=c*(a-s);x+=r*A,C=x+A}return[f,g,d,m,x,C]}function X5e(e,t,n){let i=e._implicitTileset,r=t.implicitCoordinates.getChildCoordinates(n),o=uae(i,r,n,!1,t),s=lae(void 0,i,r),a=i.subtreeUriTemplate.getDerivedResource({templateValues:r.getTemplateValues()}).url,c={boundingVolume:o,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=mae(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=r,u}function mae(e,t,n,i){let r=e._tile.constructor;return new r(e._tileset,t,n,i)}ga.prototype.hasProperty=function(e,t){return!1};ga.prototype.getFeature=function(e){};ga.prototype.applyDebugSettings=function(e,t){};ga.prototype.applyStyle=function(e){};ga.prototype.update=function(e,t){};ga.prototype.isDestroyed=function(){return!1};ga.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),ue(this)};ga._deriveBoundingBox=dae;ga._deriveBoundingRegion=hae;ga._deriveBoundingVolumeS2=fae;var BN={};BN._deprecationWarning=di;var Bg=Uint32Array.BYTES_PER_ELEMENT;BN.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),r=new DataView(e);t+=Bg;let o=r.getUint32(t,!0);if(o!==1)throw new fe(`Only Instanced 3D Model version 1 is supported. Version ${o} is not.`);t+=Bg;let s=r.getUint32(t,!0);t+=Bg;let a=r.getUint32(t,!0);if(a===0)throw new fe("featureTableJsonByteLength is zero, the feature table must be defined.");t+=Bg;let c=r.getUint32(t,!0);t+=Bg;let u=r.getUint32(t,!0);t+=Bg;let f=r.getUint32(t,!0);t+=Bg;let d=r.getUint32(t,!0);if(d!==1&&d!==0)throw new fe(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${d} is not.`);t+=Bg;let p=Vr(i,t,a);t+=a;let g=new Uint8Array(e,t,c);t+=c;let m,x;u>0&&(m=Vr(i,t,u),t+=u,f>0&&(x=new Uint8Array(e,t,f),x=new Uint8Array(x),t+=f));let C=n+s-t;if(C===0)throw new fe("glTF byte length must be greater than 0.");let A;return t%4===0?A=new Uint8Array(e,t,C):(BN._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),A=new Uint8Array(i.subarray(t,t+C))),{gltfFormat:d,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:x,gltf:A}};var nb=BN;function pae(e,t,n){this.primitive=e,this._modelMatrix=N.clone(t),this._instanceId=n}Object.defineProperties(pae.prototype,{instanceId:{get:function(){return this._instanceId}},model:{get:function(){return this.primitive._model}},modelMatrix:{get:function(){return N.clone(this._modelMatrix)},set:function(e){N.clone(e,this._modelMatrix),this.primitive.expandBoundingSphere(this._modelMatrix),this.primitive._dirty=!0}}});var LN=pae;var mx={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3};function ib(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this._instancingSupported=!1,this._dynamic=y(e.dynamic,!1),this._allowPicking=y(e.allowPicking,!0),this._ready=!1,this._readyPromise=ts(),this._state=mx.NEEDS_LOAD,this._dirty=!1,this._cull=y(e.cull,!0),this._opaquePass=y(e.opaquePass,Ce.OPAQUE),this._instances=K5e(this,e.instances),this._batchTable=e.batchTable,this._model=void 0,this._vertexBufferTypedArray=void 0,this._vertexBuffer=void 0,this._batchIdBuffer=void 0,this._instancedUniformsByProgram=void 0,this._drawCommands=[],this._modelCommands=void 0,this._renderStates=void 0,this._disableCullingRenderStates=void 0,this._boundingSphere=$5e(this),this._center=h.clone(this._boundingSphere.center),this._rtcTransform=new N,this._rtcModelView=new N,this._mode=void 0,this.modelMatrix=N.clone(N.IDENTITY),this._modelMatrix=N.clone(this.modelMatrix),this._url=De.createIfNeeded(e.url),this._requestType=e.requestType,this._gltf=e.gltf,this._basePath=De.createIfNeeded(e.basePath),this._asynchronous=e.asynchronous,this._incrementallyLoadTextures=e.incrementallyLoadTextures,this._upAxis=e.upAxis,this._forwardAxis=e.forwardAxis,this.shadows=y(e.shadows,Zt.ENABLED),this._shadows=this.shadows,this._pickIdLoaded=e.pickIdLoaded,this.splitDirection=y(e.splitDirection,as.NONE),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=y(e.debugWireframe,!1),this._debugWireframe=!1,l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new Pc,this._shouldDestroyImageBasedLighting=!0),this.backFaceCulling=y(e.backFaceCulling,!0),this._backFaceCulling=this.backFaceCulling,this.showCreditsOnScreen=y(e.showCreditsOnScreen,!1)}Object.defineProperties(ib.prototype,{allowPicking:{get:function(){return this._allowPicking}},length:{get:function(){return this._instances.length}},activeAnimations:{get:function(){return this._model.activeAnimations}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}}});function K5e(e,t){t=y(t,[]);let n=t.length,i=new Array(n);for(let r=0;r<n;++r){let o=t[r],s=o.modelMatrix,a=y(o.batchId,r);i[r]=new LN(e,s,a)}return i}function $5e(e){let t=e.length,n=new Array(t);for(let i=0;i<t;++i)n[i]=N.getTranslation(e._instances[i]._modelMatrix,new h);return re.fromPoints(n)}var Z5e=new h,x9=new N;ib.prototype.expandBoundingSphere=function(e){let t=N.getTranslation(e,Z5e);re.expand(this._boundingSphere,t,this._boundingSphere)};function J5e(e,t,n,i){return function(r,o){let s=r.semantic;if(l(s)&&e.indexOf(s)>-1)if(t.indexOf(s)>-1)i[o]=s;else throw new fe(`Shader program cannot be optimized for instancing. Uniform "${o}" in program "${n}" uses unsupported semantic "${s}"`)}}function gae(e,t){if(l(e._instancedUniformsByProgram))return e._instancedUniformsByProgram[t];let n={};e._instancedUniformsByProgram=n;let i=["MODEL","MODELVIEW","CESIUM_RTC_MODELVIEW","MODELVIEWPROJECTION","MODELINVERSE","MODELVIEWINVERSE","MODELVIEWPROJECTIONINVERSE","MODELINVERSETRANSPOSE","MODELVIEWINVERSETRANSPOSE"],r=["MODELVIEW","CESIUM_RTC_MODELVIEW","MODELVIEWPROJECTION","MODELVIEWINVERSETRANSPOSE"],o=e._model._sourceTechniques;for(let s in o)if(o.hasOwnProperty(s)){let a=o[s],c=a.program;if(!l(n[c])){let u={};n[c]=u,Ae.techniqueUniform(a,J5e(i,r,t,u))}}return n[t]}function Q5e(e){return function(t,n){let i=gae(e,n),r=l(e._batchTable),o=Fe.replaceMain(t,"czm_instancing_main"),s="",a="";for(let g in i)if(i.hasOwnProperty(g)){let m=i[g],x;m==="MODELVIEW"||m==="CESIUM_RTC_MODELVIEW"?x="czm_instanced_modelView":m==="MODELVIEWPROJECTION"?(x="czm_instanced_modelViewProjection",s+=`mat4 czm_instanced_modelViewProjection;
- `,a+=`czm_instanced_modelViewProjection = czm_projection * czm_instanced_modelView;
- `):m==="MODELVIEWINVERSETRANSPOSE"&&(x="czm_instanced_modelViewInverseTranspose",s+=`mat3 czm_instanced_modelViewInverseTranspose;
- `,a+=`czm_instanced_modelViewInverseTranspose = mat3(czm_instanced_modelView);
- `);let C=new RegExp(`uniform.*${g}.*`);o=o.replace(C,""),C=new RegExp(`${g}\\b`,"g"),o=o.replace(C,x)}let c=`uniform mat4 czm_instanced_modifiedModelView;
- uniform mat4 czm_instanced_nodeTransform;
- `,u,f,d;r?(u=`attribute float a_batchId;
- `,f="",d=""):(u="",f=`attribute vec4 pickColor;
- varying vec4 v_pickColor;
- `,d=` v_pickColor = pickColor;
- `);let p=`${c+s}mat4 czm_instanced_modelView;
- attribute vec4 czm_modelMatrixRow0;
- attribute vec4 czm_modelMatrixRow1;
- attribute vec4 czm_modelMatrixRow2;
- ${u}${f}${o}void main()
- {
- mat4 czm_instanced_model = mat4(czm_modelMatrixRow0.x, czm_modelMatrixRow1.x, czm_modelMatrixRow2.x, 0.0, czm_modelMatrixRow0.y, czm_modelMatrixRow1.y, czm_modelMatrixRow2.y, 0.0, czm_modelMatrixRow0.z, czm_modelMatrixRow1.z, czm_modelMatrixRow2.z, 0.0, czm_modelMatrixRow0.w, czm_modelMatrixRow1.w, czm_modelMatrixRow2.w, 1.0);
- czm_instanced_modelView = czm_instanced_modifiedModelView * czm_instanced_model * czm_instanced_nodeTransform;
- ${a} czm_instancing_main();
- ${d}}
- `;if(r){let g=e._model.gltfInternal,m=$t.getDiffuseAttributeOrUniform(g,n);p=e._batchTable.getVertexShaderCallback(!0,"a_batchId",m)(p)}return p}}function eGe(e){return function(t,n){let i=e._batchTable;if(l(i)){let r=e._model.gltfInternal,o=$t.getDiffuseAttributeOrUniform(r,n);t=i.getFragmentShaderCallback(!0,o,!1)(t)}else t=`varying vec4 v_pickColor;
- ${t}`;return t}}function tGe(e,t){return function(){return N.multiply(t.uniformState.view,e._rtcTransform,e._rtcModelView)}}function nGe(e){return function(){return e.computedMatrix}}function iGe(e,t){return function(n,i,r){n=$e(n),n.czm_instanced_modifiedModelView=tGe(e,t),n.czm_instanced_nodeTransform=nGe(r);let o=gae(e,i);for(let s in o)o.hasOwnProperty(s)&&delete n[s];return l(e._batchTable)&&(n=e._batchTable.getUniformMapCallback()(n)),n}}function rGe(e){return function(t,n){if(l(e._batchTable)){let i=e._model.gltfInternal,r=$t.getDiffuseAttributeOrUniform(i,n);t=e._batchTable.getVertexShaderCallback(!0,"a_batchId",r)(t),t=`uniform float a_batchId
- ;${t}`}return t}}function oGe(e){return function(t,n){let i=e._batchTable;if(l(i)){let r=e._model.gltfInternal,o=$t.getDiffuseAttributeOrUniform(r,n);t=i.getFragmentShaderCallback(!0,o,!1)(t)}else t=`uniform vec4 czm_pickColor;
- ${t}`;return t}}function sGe(e){return function(t){return l(e._batchTable)&&(t=e._batchTable.getUniformMapCallback()(t)),t}}function yae(e){let t=e._instances,n=e.length,i=e._center,r=12,o=e._vertexBufferTypedArray;l(o)||(o=new Float32Array(n*r)),e._dynamic&&(e._vertexBufferTypedArray=o);for(let s=0;s<n;++s){let a=t[s]._modelMatrix,c=N.clone(a,x9);c[12]-=i.x,c[13]-=i.y,c[14]-=i.z;let u=s*r;o[u+0]=c[0],o[u+1]=c[4],o[u+2]=c[8],o[u+3]=c[12],o[u+4]=c[1],o[u+5]=c[5],o[u+6]=c[9],o[u+7]=c[13],o[u+8]=c[2],o[u+9]=c[6],o[u+10]=c[10],o[u+11]=c[14]}return o}function aGe(e,t){let n,i=e._instances,r=e.length,o=e._dynamic,s=l(e._batchTable);if(s){let c=new Uint16Array(r);for(n=0;n<r;++n)c[n]=i[n]._instanceId;e._batchIdBuffer=at.createVertexBuffer({context:t,typedArray:c,usage:Ne.STATIC_DRAW})}if(!s){let c=new Uint8Array(r*4);for(n=0;n<r;++n){let f=e._pickIds[n].color,d=n*4;c[d]=z.floatToByte(f.red),c[d+1]=z.floatToByte(f.green),c[d+2]=z.floatToByte(f.blue),c[d+3]=z.floatToByte(f.alpha)}e._pickIdBuffer=at.createVertexBuffer({context:t,typedArray:c,usage:Ne.STATIC_DRAW})}let a=yae(e);e._vertexBuffer=at.createVertexBuffer({context:t,typedArray:a,usage:o?Ne.STREAM_DRAW:Ne.STATIC_DRAW})}function cGe(e){let t=yae(e);e._vertexBuffer.copyFromArrayView(t)}function lGe(e,t){let n=e._instances,i=n.length,r=new Array(i);for(let o=0;o<i;++o)r[o]=t.createPickId(n[o]);return r}function uGe(e,t){let n=e._instancingSupported;n||di("cpuModelInstancing","Support for rendering instanced models on the CPU has been deprecated and will be removed in CesiumJS 1.97.");let i=l(e._batchTable),r=e._allowPicking,o={url:e._url,requestType:e._requestType,gltf:e._gltf,basePath:e._basePath,shadows:e._shadows,cacheKey:void 0,asynchronous:e._asynchronous,allowPicking:r,incrementallyLoadTextures:e._incrementallyLoadTextures,upAxis:e._upAxis,forwardAxis:e._forwardAxis,precreatedAttributes:void 0,vertexShaderLoaded:void 0,fragmentShaderLoaded:void 0,uniformMapLoaded:void 0,pickIdLoaded:e._pickIdLoaded,ignoreCommands:!0,opaquePass:e._opaquePass,imageBasedLighting:e._imageBasedLighting,showOutline:e.showOutline,showCreditsOnScreen:e.showCreditsOnScreen};if(i||(e._pickIds=lGe(e,t)),n){aGe(e,t);let s=12,a=K.getSizeInBytes(K.FLOAT),c={czm_modelMatrixRow0:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:K.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:a*s,instanceDivisor:1},czm_modelMatrixRow1:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:K.FLOAT,normalize:!1,offsetInBytes:a*4,strideInBytes:a*s,instanceDivisor:1},czm_modelMatrixRow2:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:K.FLOAT,normalize:!1,offsetInBytes:a*8,strideInBytes:a*s,instanceDivisor:1}};i&&(c.a_batchId={index:0,vertexBuffer:e._batchIdBuffer,componentsPerAttribute:1,componentDatatype:K.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),i||(c.pickColor={index:0,vertexBuffer:e._pickIdBuffer,componentsPerAttribute:4,componentDatatype:K.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),o.precreatedAttributes=c,o.vertexShaderLoaded=Q5e(e),o.fragmentShaderLoaded=eGe(e),o.uniformMapLoaded=iGe(e,t),l(e._url)&&(o.cacheKey=`${e._url.getUrlComponent()}#instanced`)}else o.vertexShaderLoaded=rGe(e),o.fragmentShaderLoaded=oGe(e),o.uniformMapLoaded=sGe(e,t);l(e._url)?e._model=bp.fromGltf(o):e._model=new bp(o)}function fGe(e,t){if(e._debugWireframe!==e.debugWireframe||t){e._debugWireframe=e.debugWireframe;let n=e.debugWireframe?Me.LINES:Me.TRIANGLES,i=e._drawCommands,r=i.length;for(let o=0;o<r;++o)i[o].primitiveType=n}}function dGe(e){let t=$e(e,!0);return t.cull.enabled=!1,Ve.fromCache(t)}function hGe(e,t){if(e._backFaceCulling!==e.backFaceCulling||t){e._backFaceCulling=e.backFaceCulling;let n=e._drawCommands,i=n.length,r;if(!l(e._disableCullingRenderStates))for(e._disableCullingRenderStates=new Array(i),e._renderStates=new Array(i),r=0;r<i;++r){let o=n[r].renderState,s=dGe(o);e._disableCullingRenderStates[r]=s,e._renderStates[r]=o}for(r=0;r<i;++r)n[r].renderState=e._backFaceCulling?e._renderStates[r]:e._disableCullingRenderStates[r]}}function mGe(e,t){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume||t){e._debugShowBoundingVolume=e.debugShowBoundingVolume;let n=e._drawCommands,i=n.length;for(let r=0;r<i;++r)n[r].debugShowBoundingVolume=e.debugShowBoundingVolume}}function pGe(e,t){let n=t.length,i=e.length,r=e._boundingSphere,o=e._cull;for(let s=0;s<n;++s){let a=Ze.shallowClone(t[s]);a.instanceCount=i,a.boundingVolume=r,a.cull=o,l(e._batchTable)?a.pickId=e._batchTable.getPickId():a.pickId="v_pickColor",e._drawCommands.push(a)}}function _Ge(e){return function(){return e}}function gGe(e){return function(){return e}}function yGe(e,t){let n=e._instances,i=t.length,r=e.length,o=e._batchTable,s=l(o),a=e._cull;for(let c=0;c<i;++c)for(let u=0;u<r;++u){let f=Ze.shallowClone(t[c]);if(f.modelMatrix=new N,f.boundingVolume=new re,f.cull=a,f.uniformMap=$e(f.uniformMap),s)f.uniformMap.a_batchId=_Ge(n[u]._instanceId);else{let d=e._pickIds[u];f.uniformMap.czm_pickColor=gGe(d.color)}e._drawCommands.push(f)}}function xae(e){let t=e._modelCommands,n=t.length,i=e.length,r=e._rtcTransform,o=e._center;for(let s=0;s<n;++s){let a=t[s];for(let c=0;c<i;++c){let u=s*i+c,f=e._drawCommands[u],d=N.clone(e._instances[c]._modelMatrix,x9);d[12]-=o.x,d[13]-=o.y,d[14]-=o.z,d=N.multiply(r,d,x9);let p=a.modelMatrix,g=f.modelMatrix;N.multiply(d,p,g);let m=a.boundingVolume,x=f.boundingVolume;re.transform(m,d,x)}}}function Cae(e){let t=e._nodeCommands,n=t.length,i=[];for(let r=0;r<n;++r){let o=t[r];o.show&&i.push(o.command)}return i}function xGe(e){let t=e._nodeCommands,n=t.length,i=!1;for(let r=0;r<n;r++){let o=t[r];o.command.dirty&&(o.command.dirty=!1,i=!0)}return i}function _ae(e,t){e._drawCommands=[];let n=Cae(e._model);t?pGe(e,n):(yGe(e,n),xae(e))}function CGe(e,t){if(e.shadows!==e._shadows||t){e._shadows=e.shadows;let n=Zt.castShadows(e.shadows),i=Zt.receiveShadows(e.shadows),r=e._drawCommands,o=r.length;for(let s=0;s<o;++s){let a=r[s];a.castShadows=n,a.receiveShadows=i}}}ib.prototype.update=function(e){if(e.mode===te.MORPHING||!this.show||this.length===0)return;let t=e.context;if(this._state===mx.NEEDS_LOAD){this._state=mx.LOADING,this._instancingSupported=t.instancedArrays,uGe(this,t);let p=this;this._model.readyPromise.catch(function(g){p._state=mx.FAILED,p._readyPromise.reject(g)})}let n=this._instancingSupported,i=this._model;if(i.imageBasedLighting=this._imageBasedLighting,i.showCreditsOnScreen=this.showCreditsOnScreen,i.splitDirection=this.splitDirection,i.update(e),i.ready&&this._state===mx.LOADING){this._state=mx.LOADED,this._ready=!0;let p=i.boundingSphereInternal.radius+h.magnitude(i.boundingSphereInternal.center);this._boundingSphere.radius+=p,this._modelCommands=Cae(i),_ae(this,n),this._readyPromise.resolve(this);return}if(this._state!==mx.LOADED)return;let r=e.mode!==this._mode,o=this.modelMatrix,s=!N.equals(this._modelMatrix,o);if(r||s){this._mode=e.mode,N.clone(o,this._modelMatrix);let p=N.multiplyByTranslation(this._modelMatrix,this._center,this._rtcTransform);this._mode!==te.SCENE3D&&(p=yt.basisTo2D(e.mapProjection,p,p)),N.getTranslation(p,this._boundingSphere.center)}n&&this._dirty&&(this._dynamic=!0,this._dirty=!1,cGe(this));let a=xGe(i);a&&_ae(this,n),!n&&(i.dirty||this._dirty||r||s)&&xae(this),CGe(this,a),fGe(this,a),hGe(this,a),mGe(this,a);let c=e.passes;if(!c.render&&!c.pick)return;let u=e.commandList,f=this._drawCommands,d=f.length;for(let p=0;p<d;++p)u.push(f[p])};ib.prototype.isDestroyed=function(){return!1};ib.prototype.destroy=function(){this._model=this._model&&this._model.destroy();let e=this._pickIds;if(l(e)){let t=e.length;for(let n=0;n<t;++n)e[n].destroy()}return this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,ue(this)};var NN=ib;function Jh(e,t,n,i,r){this._tileset=e,this._tile=t,this._resource=n,this._modelInstanceCollection=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,TGe(this,i,r)}Jh._deprecationWarning=di;Object.defineProperties(Jh.prototype,{featuresLength:{get:function(){return this._batchTable.featuresLength}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){let e=this._modelInstanceCollection._model;return l(e)?e.trianglesLength:0}},geometryByteLength:{get:function(){let e=this._modelInstanceCollection._model;return l(e)?e.geometryByteLength:0}},texturesByteLength:{get:function(){let e=this._modelInstanceCollection._model;return l(e)?e.texturesByteLength:0}},batchTableByteLength:{get:function(){return this._batchTable.batchTableByteLength}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._modelInstanceCollection.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function AGe(e){return function(){return e._batchTable.getPickId()}}var cv=new Array(4),Aae=new Array(4);function TGe(e,t,n){let i=nb.parse(t,n),r=i.gltfFormat,o=i.gltf,s=i.featureTableJson,a=i.featureTableBinary,c=i.batchTableJson,u=i.batchTableBinary,f=new pl(s,a),d=f.getGlobalProperty("INSTANCES_LENGTH");if(f.featuresLength=d,!l(d))throw new fe("Feature table global property: INSTANCES_LENGTH must be defined");e._batchTable=new ml(e,d,c,u);let p=e._tileset,g={instances:new Array(d),batchTable:e._batchTable,cull:!1,url:void 0,requestType:ro.TILES3D,gltf:void 0,basePath:void 0,incrementallyLoadTextures:!1,upAxis:p._modelUpAxis,forwardAxis:p._modelForwardAxis,opaquePass:Ce.CESIUM_3D_TILE,pickIdLoaded:AGe(e),imageBasedLighting:p.imageBasedLighting,backFaceCulling:p.backFaceCulling,showOutline:p.showOutline,showCreditsOnScreen:p.showCreditsOnScreen};if(r===0){let E=fa(o);E=E.replace(/[\s\0]+$/,""),g.url=e._resource.getDerivedResource({url:E})}else g.gltf=o,g.basePath=e._resource.clone();let m=f.getGlobalProperty("EAST_NORTH_UP"),x,C=f.getGlobalProperty("RTC_CENTER",K.FLOAT,3);l(C)&&(x=h.unpack(C));let A=g.instances,b=new h,T=new Array(3),S=new h,w=new h,D=new h,I=new Q,O=new Re,B=new h,L=new sp,_=new N;for(let E=0;E<d;E++){let v=f.getProperty("POSITION",K.FLOAT,3,E,cv);if(!l(v)){v=T;let q=f.getProperty("POSITION_QUANTIZED",K.UNSIGNED_SHORT,3,E,cv);if(!l(q))throw new fe("Either POSITION or POSITION_QUANTIZED must be defined for each instance.");let j=f.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",K.FLOAT,3);if(!l(j))throw new fe("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let X=f.getGlobalProperty("QUANTIZED_VOLUME_SCALE",K.FLOAT,3);if(!l(X))throw new fe("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");for(let G=0;G<3;G++)v[G]=q[G]/65535*X[G]+j[G]}h.unpack(v,0,b),l(x)&&h.add(b,x,b),L.translation=b;let P=f.getProperty("NORMAL_UP",K.FLOAT,3,E,cv),R=f.getProperty("NORMAL_RIGHT",K.FLOAT,3,E,Aae),F=!1;if(l(P)){if(!l(R))throw new fe("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");h.unpack(P,0,w),h.unpack(R,0,S),F=!0}else{let q=f.getProperty("NORMAL_UP_OCT32P",K.UNSIGNED_SHORT,2,E,cv),j=f.getProperty("NORMAL_RIGHT_OCT32P",K.UNSIGNED_SHORT,2,E,Aae);if(l(q)){if(!l(j))throw new fe("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");In.octDecodeInRange(q[0],q[1],65535,w),In.octDecodeInRange(j[0],j[1],65535,S),F=!0}else m?(yt.eastNorthUpToFixedFrame(b,oe.WGS84,_),N.getMatrix3(_,I)):Q.clone(Q.IDENTITY,I)}F&&(h.cross(S,w,D),h.normalize(D,D),Q.setColumn(I,0,S,I),Q.setColumn(I,1,w,I),Q.setColumn(I,2,D,I)),Re.fromRotationMatrix(I,O),L.rotation=O,B=h.fromElements(1,1,1,B);let U=f.getProperty("SCALE",K.FLOAT,1,E);l(U)&&h.multiplyByScalar(B,U,B);let k=f.getProperty("SCALE_NON_UNIFORM",K.FLOAT,3,E,cv);l(k)&&(B.x*=k[0],B.y*=k[1],B.z*=k[2]),L.scale=B;let H=f.getProperty("BATCH_ID",K.UNSIGNED_SHORT,1,E);l(H)||(H=E),N.fromTranslationRotationScale(L,_);let V=_.clone();A[E]={modelMatrix:V,batchId:H}}e._modelInstanceCollection=new NN(g),e._modelInstanceCollection.readyPromise.catch(function(){}).then(function(E){e._modelInstanceCollection.ready&&E.activeAnimations.addAll({loop:Xr.REPEAT})})}function bGe(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);for(let i=0;i<t;++i)n[i]=new bo(e,i);e._features=n}}Jh.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Jh.prototype.getFeature=function(e){let t=this.featuresLength;return bGe(this),this._features[e]};Jh.prototype.applyDebugSettings=function(e,t){t=e?t:z.WHITE,this._batchTable.setAllColor(t)};Jh.prototype.applyStyle=function(e){this._batchTable.applyStyle(e)};Jh.prototype.update=function(e,t){let n=t.commandList.length;this._batchTable.update(e,t),this._modelInstanceCollection.modelMatrix=this._tile.computedTransform,this._modelInstanceCollection.shadows=this._tileset.shadows,this._modelInstanceCollection.lightColor=this._tileset.lightColor,this._modelInstanceCollection.imageBasedLighting=this._tileset.imageBasedLighting,this._modelInstanceCollection.backFaceCulling=this._tileset.backFaceCulling,this._modelInstanceCollection.debugWireframe=this._tileset.debugWireframe,this._modelInstanceCollection.showCreditsOnScreen=this._tileset.showCreditsOnScreen,this._modelInstanceCollection.splitDirection=this._tileset.splitDirection;let i=this._modelInstanceCollection._model;if(l(i)){let o=this._tileset.clippingPlanes;i.referenceMatrix=this._tileset.clippingPlanesOriginMatrix,l(o)&&this._tile.clippingPlanesDirty&&(i._clippingPlanes=o.enabled&&this._tile._isClipped?o:void 0),l(o)&&l(i._clippingPlanes)&&i._clippingPlanes!==o&&(i._clippingPlanes=o)}this._modelInstanceCollection.update(t);let r=t.commandList.length;n<r&&(t.passes.render||t.passes.pick)&&this._batchTable.addDerivedCommands(t,n,!1)};Jh.prototype.isDestroyed=function(){return!1};Jh.prototype.destroy=function(){return this._modelInstanceCollection=this._modelInstanceCollection&&this._modelInstanceCollection.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};var FN=Jh;var EGe={ADD:0,REPLACE:1},Eo=Object.freeze(EGe);var ni={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function SGe(e){switch(e){case ni.POSITION:return"positionMC";case ni.NORMAL:return"normalMC";case ni.TANGENT:return"tangentMC";case ni.TEXCOORD:return"texCoord";case ni.COLOR:return"color";case ni.JOINTS:return"joints";case ni.WEIGHTS:return"weights";case ni.FEATURE_ID:return"featureId"}}ni.hasSetIndex=function(e){switch(e){case ni.POSITION:case ni.NORMAL:case ni.TANGENT:return!1;case ni.TEXCOORD:case ni.COLOR:case ni.JOINTS:case ni.WEIGHTS:case ni.FEATURE_ID:return!0}};ni.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return ni.POSITION;case"NORMAL":return ni.NORMAL;case"TANGENT":return ni.TANGENT;case"TEXCOORD":return ni.TEXCOORD;case"COLOR":return ni.COLOR;case"JOINTS":return ni.JOINTS;case"WEIGHTS":return ni.WEIGHTS;case"_FEATURE_ID":return ni.FEATURE_ID}};ni.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return ni.POSITION;case"RGBA":case"RGB":case"RGB565":return ni.COLOR;case"NORMAL":case"NORMAL_OCT16P":return ni.NORMAL;case"BATCH_ID":return ni.FEATURE_ID}};ni.getGlslType=function(e){switch(e){case ni.POSITION:case ni.NORMAL:case ni.TANGENT:return"vec3";case ni.TEXCOORD:return"vec2";case ni.COLOR:return"vec4";case ni.JOINTS:return"ivec4";case ni.WEIGHTS:return"vec4";case ni.FEATURE_ID:return"int"}};ni.getVariableName=function(e,t){let n=SGe(e);return l(t)&&(n+=`_${t}`),n};var jt=Object.freeze(ni);var Tae={},px=Uint32Array.BYTES_PER_ELEMENT;Tae.parse=function(e,t){t=y(t,0);let n=new Uint8Array(e),i=new DataView(e);t+=px;let r=i.getUint32(t,!0);if(r!==1)throw new fe(`Only Point Cloud tile version 1 is supported. Version ${r} is not.`);t+=px,t+=px;let o=i.getUint32(t,!0);if(o===0)throw new fe("Feature table must have a byte length greater than zero");t+=px;let s=i.getUint32(t,!0);t+=px;let a=i.getUint32(t,!0);t+=px;let c=i.getUint32(t,!0);t+=px;let u=Vr(n,t,o);t+=o;let f=new Uint8Array(e,t,s);t+=s;let d,p;a>0&&(d=Vr(n,t,a),t+=a,c>0&&(p=new Uint8Array(e,t,c),t+=c));let g=new pl(u,f),m=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=m,!l(m))throw new fe("Feature table global property: POINTS_LENGTH must be defined");let x=g.getGlobalProperty("RTC_CENTER",K.FLOAT,3);l(x)&&(x=h.unpack(x));let C=wGe(g,d);if(C.rtcCenter=x,C.pointsLength=m,!C.hasPositions){let A=vGe(g);C.positions=A,C.hasPositions=C.hasPositions||l(A)}if(!C.hasPositions)throw new fe("Either POSITION or POSITION_QUANTIZED must be defined.");if(!C.hasNormals){let A=PGe(g);C.normals=A,C.hasNormals=C.hasNormals||l(A)}if(!C.hasColors){let A=DGe(g);C.colors=A,C.hasColors=C.hasColors||l(A),C.hasConstantColor=l(C.constantColor),C.isTranslucent=l(A)&&A.isTranslucent}if(!C.hasBatchIds){let A=IGe(g);C.batchIds=A,C.hasBatchIds=C.hasBatchIds||l(A)}if(C.hasBatchIds){let A=g.getGlobalProperty("BATCH_LENGTH");if(!l(A))throw new fe("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");C.batchLength=A}return l(p)&&(p=new Uint8Array(p),C.batchTableJson=d,C.batchTableBinary=p),C};function wGe(e,t){let n=e.json,i,r,o,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(o=a.properties);let c,u,f,d,p;if(l(s)){r=s.properties;let m=s.byteOffset,x=s.byteLength;if(!l(r)||!l(m)||!l(x))throw new fe("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(m,m+x),c=l(r.POSITION),u=l(r.RGB)||l(r.RGBA),f=l(r.NORMAL),d=l(r.BATCH_ID),p=l(r.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:r,batchTableProperties:o,properties:rt(r,o),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:d}}function vGe(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",K.FLOAT,3),{name:jt.POSITION,semantic:jt.POSITION,typedArray:n,isQuantized:!1,componentDatatype:K.FLOAT,type:qt.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",K.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",K.FLOAT,3);if(!l(i))throw new fe("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=(1<<16)-1,o=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",K.FLOAT,3);if(!l(o))throw new fe("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:jt.POSITION,semantic:jt.POSITION,typedArray:n,isQuantized:!0,componentDatatype:K.FLOAT,type:qt.VEC3,quantizedRange:r,quantizedVolumeOffset:h.unpack(o),quantizedVolumeScale:h.unpack(i),quantizedComponentDatatype:K.UNSIGNED_SHORT,quantizedType:qt.VEC3}}}function DGe(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",K.UNSIGNED_BYTE,4),{name:jt.COLOR,semantic:jt.COLOR,setIndex:0,typedArray:n,componentDatatype:K.UNSIGNED_BYTE,type:qt.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",K.UNSIGNED_BYTE,3),{name:"COLOR",semantic:jt.COLOR,setIndex:0,typedArray:n,componentDatatype:K.UNSIGNED_BYTE,type:qt.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",K.UNSIGNED_SHORT,1),{name:"COLOR",semantic:jt.COLOR,setIndex:0,typedArray:n,componentDatatype:K.FLOAT,type:qt.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",K.UNSIGNED_BYTE,4),r=i[3],o=z.fromBytes(i[0],i[1],i[2],r),s=r<255;return{name:jt.COLOR,semantic:jt.COLOR,setIndex:0,constantColor:o,componentDatatype:K.FLOAT,type:qt.VEC4,isQuantized:!1,isTranslucent:s}}}function PGe(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",K.FLOAT,3),{name:jt.NORMAL,semantic:jt.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:K.FLOAT,type:qt.VEC3};if(l(t.NORMAL_OCT16P)){n=e.getPropertyArray("NORMAL_OCT16P",K.UNSIGNED_BYTE,2);let i=8;return{name:jt.NORMAL,semantic:jt.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<i)-1,quantizedType:qt.VEC2,quantizedComponentDatatype:K.UNSIGNED_BYTE,componentDatatype:K.FLOAT,type:qt.VEC3}}}function IGe(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",K.UNSIGNED_SHORT,1);return{name:jt.FEATURE_ID,semantic:jt.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:K.fromTypedArray(n),type:qt.SCALAR}}}var rb=Tae;var _x={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function lv(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=z.clone(z.DARKGRAY),this._highlightColor=z.clone(z.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=_x.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=y(e.opaquePass,Ce.OPAQUE),this._cull=y(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=N.clone(N.IDENTITY),this._modelMatrix=N.clone(N.IDENTITY),this.time=0,this.shadows=Zt.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=y(e.splitDirection,as.NONE),this._splittingEnabled=!1,this._resolveReadyPromise=void 0,this._rejectReadyPromise=void 0,this._readyPromise=OGe(this,e)}Object.defineProperties(lv.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},color:{get:function(){return z.clone(this._highlightColor)},set:function(e){this._highlightColor=z.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=re.clone(e,this._boundingSphere)}}});function OGe(e,t){let n=rb.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=ml.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=_x.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let r=n.normals;l(r)&&(e._isOctEncoded16P=r.octEncoded);let o=n.colors;l(o)&&(l(o.constantColor)&&(e._constantColor=z.clone(o.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=o.isRGB565);let s=n.batchIds;return l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength,new Promise(function(a,c){e._resolveReadyPromise=function(){e._ready=!0,a(e)},e._rejectReadyPromise=c})}var RGe=new h,MGe=new h,BGe=new h,bae,VN;function LGe(e){if(!l(VN)){bae=new ah.default(0),VN=new Array(e);for(let t=0;t<e;++t)VN[t]=bae.random()}return VN}function NGe(e){let n=e.length/3,i=Math.min(n,20),r=LGe(20),o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(o,o,o,RGe),c=h.fromElements(s,s,s,MGe);for(let f=0;f<i;++f){let d=Math.floor(r[f]*n),p=h.unpack(e,d*3,BGe);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let u=re.fromCornerPoints(a,c);return u.radius+=M.EPSILON2,u}function Eae(e,t){let n=K.fromTypedArray(e);return n===K.INT||n===K.UNSIGNED_INT||n===K.DOUBLE?(Lt("Cast pnts property to floats",`Point cloud property "${t}" will be casted to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var FGe=new se,VGe=new se,kGe=new z,Sae=0,kN=1,E9=2,wae=3,UGe=4,C9=new N,zGe=new N;function HGe(e,t){let n=t.context,i=e._parsedContent,r=e._pointsLength,o=i.positions,s=i.colors,a=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),d=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,m=e._isOctEncodedDraco,x=e._quantizedRange,C=e._octEncodedRange,A=e._isRGB565,b=e._isTranslucent,T=e._hasColors,S=e._hasNormals,w=e._hasBatchIds,D,I,O=[],B={};if(e._styleableShaderAttributes=B,f){let k=UGe;for(let H in u)if(u.hasOwnProperty(H)){let V=u[H],q=Eae(V.typedArray,H);D=V.componentCount,I=K.fromTypedArray(q);let j=at.createVertexBuffer({context:n,typedArray:q,usage:Ne.STATIC_DRAW});e._geometryByteLength+=j.sizeInBytes;let X={index:k,vertexBuffer:j,componentsPerAttribute:D,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0};O.push(X),B[H]={location:k,componentCount:D},++k}}let L=at.createVertexBuffer({context:n,typedArray:o.typedArray,usage:Ne.STATIC_DRAW});e._geometryByteLength+=L.sizeInBytes;let _;T&&(_=at.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Ne.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let E;S&&(E=at.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Ne.STATIC_DRAW}),e._geometryByteLength+=E.sizeInBytes);let v;w&&(c.typedArray=Eae(c.typedArray,"batchIds"),v=at.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Ne.STATIC_DRAW}),e._geometryByteLength+=v.sizeInBytes);let P=[];if(d?I=K.UNSIGNED_SHORT:p?I=x<=255?K.UNSIGNED_BYTE:K.UNSIGNED_SHORT:I=K.FLOAT,P.push({index:Sae,vertexBuffer:L,componentsPerAttribute:3,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=re.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=NGe(o.typedArray)),T)if(A)P.push({index:kN,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:K.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let k=b?4:3;P.push({index:kN,vertexBuffer:_,componentsPerAttribute:k,componentDatatype:K.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}S&&(g?(D=2,I=K.UNSIGNED_BYTE):m?(D=2,I=C<=255?K.UNSIGNED_BYTE:K.UNSIGNED_SHORT):(D=3,I=K.FLOAT),P.push({index:E9,vertexBuffer:E,componentsPerAttribute:D,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0})),w&&P.push({index:wae,vertexBuffer:v,componentsPerAttribute:1,componentDatatype:K.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(P=P.concat(O));let R=new Qn({context:n,attributes:P}),F={depthTest:{enabled:!0}},U={depthTest:{enabled:!0},depthMask:!1,blending:hn.ALPHA_BLEND};e._opaquePass===Ce.CESIUM_3D_TILE&&(F.stencilTest=tn.setCesium3DTileBit(),F.stencilMask=tn.CESIUM_3D_TILE_MASK,U.stencilTest=tn.setCesium3DTileBit(),U.stencilMask=tn.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ve.fromCache(F),e._translucentRenderState=Ve.fromCache(U),e._drawCommand=new Ze({boundingVolume:new re,cull:e._cull,modelMatrix:new N,primitiveType:Me.POINTS,vertexArray:R,count:r,shaderProgram:void 0,uniformMap:void 0,renderState:b?e._translucentRenderState:e._opaqueRenderState,pass:b?Ce.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function GGe(e,t){let n=t.context,i=e._isQuantized,r=e._isQuantizedDraco,o=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=FGe;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===te.SCENE2D||c instanceof en?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return z.TRANSPARENT;let c=z.clone(a.edgeColor,kGe);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return N.IDENTITY;let c=y(e.clippingPlanesOriginMatrix,e._modelMatrix);N.multiply(n.uniformState.view3D,c,C9);let u=N.multiply(C9,a.modelMatrix,C9);return N.inverseTranspose(u,zGe)}};vg.addUniforms(e,s),(i||r||o)&&(s=rt(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=VGe;if(l(e._quantizedVolumeScale)){let c=h.clone(e._quantizedVolumeScale,a);h.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function A9(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let r=parseInt(i[1]);t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function T9(e,t){e=e.slice(e.indexOf(`
- `));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function b9(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let r=e.getAttribute(i);if(r.index===t)return r}}var WGe={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function jGe(e,t,n){let i,r,o,s=t.context,a=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,d=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,m=e._hasColors,x=e._hasNormals,C=e._hasBatchIds,A=e._backFaceCulling,b=e._normalShading,T=e._drawCommand.vertexArray,S=e.clippingPlanes,w=e._attenuation,D,I,O,B=g,L=$e(WGe),_={},E=e._styleableShaderAttributes;for(r in E)E.hasOwnProperty(r)&&(o=E[r],L[r]=`czm_3dtiles_property_${o.location}`,_[o.location]=o);if(a){let ie={translucent:!1},ae="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";D=n.getColorShaderFunction(`getColorFromStyle${ae}`,L,ie),I=n.getShowShaderFunction(`getShowFromStyle${ae}`,L,ie),O=n.getPointSizeShaderFunction(`getPointSizeFromStyle${ae}`,L,ie),l(D)&&ie.translucent&&(B=!0)}e._styleTranslucent=B;let v=l(D),P=l(I),R=l(O),F=e.isClipped,U=[],k=[];v&&(A9(D,U),T9(D,k)),P&&(A9(I,U),T9(I,k)),R&&(A9(O,U),T9(O,k));let H=k.indexOf("COLOR")>=0,V=k.indexOf("NORMAL")>=0;if(V&&!x)throw new fe("Style references the NORMAL semantic but the point cloud does not have normals");for(r in E)if(E.hasOwnProperty(r)){o=E[r];let ie=U.indexOf(o.location)>=0,ae=b9(T,o.location);ae.enabled=ie}let q=m&&(!v||H);if(m){let ie=b9(T,kN);ie.enabled=q}let j=x&&(b||A||V);if(x){let ie=b9(T,E9);ie.enabled=j}let X={a_position:Sae};q&&(X.a_color=kN),j&&(X.a_normal=E9),C&&(X.a_batchId=wae);let G="",$=U.length;for(i=0;i<$;++i){let ie=U[i];o=_[ie];let ae=o.componentCount,_e=`czm_3dtiles_property_${ie}`,be;ae===1?be="float":be=`vec${ae}`,G+=`attribute ${be} ${_e};
- `,X[_e]=o.location}GGe(e,t);let J=`attribute vec3 a_position;
- varying vec4 v_color;
- uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier;
- uniform vec4 u_constantColor;
- uniform vec4 u_highlightColor;
- `;J+=`float u_pointSize;
- float tiles3d_tileset_time;
- `,w&&(J+=`float u_geometricError;
- float u_depthMultiplier;
- `),J+=G,q&&(g?J+=`attribute vec4 a_color;
- `:p?J+=`attribute float a_color;
- const float SHIFT_RIGHT_11 = 1.0 / 2048.0;
- const float SHIFT_RIGHT_5 = 1.0 / 32.0;
- const float SHIFT_LEFT_11 = 2048.0;
- const float SHIFT_LEFT_5 = 32.0;
- const float NORMALIZE_6 = 1.0 / 64.0;
- const float NORMALIZE_5 = 1.0 / 32.0;
- `:J+=`attribute vec3 a_color;
- `),j&&(f||d?J+=`attribute vec2 a_normal;
- `:J+=`attribute vec3 a_normal;
- `),C&&(J+=`attribute float a_batchId;
- `),(c||u||d)&&(J+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange;
- `),v&&(J+=D),P&&(J+=I),R&&(J+=O),J+=`void main()
- {
- u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x;
- tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y;
- `,w&&(J+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z;
- u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w;
- `),q?g?J+=` vec4 color = a_color;
- `:p?J+=` float compressed = a_color;
- float r = floor(compressed * SHIFT_RIGHT_11);
- compressed -= r * SHIFT_LEFT_11;
- float g = floor(compressed * SHIFT_RIGHT_5);
- compressed -= g * SHIFT_LEFT_5;
- float b = compressed;
- vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5);
- vec4 color = vec4(rgb, 1.0);
- `:J+=` vec4 color = vec4(a_color, 1.0);
- `:J+=` vec4 color = u_constantColor;
- `,c||u?J+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz;
- `:J+=` vec3 position = a_position;
- `,J+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0));
- `,j?(f?J+=` vec3 normal = czm_octDecode(a_normal);
- `:d?J+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy;
- `:J+=` vec3 normal = a_normal;
- `,J+=` vec3 normalEC = czm_normal * normal;
- `):J+=` vec3 normal = vec3(1.0);
- `,v&&(J+=` color = getColorFromStyle(position, position_absolute, color, normal);
- `),P&&(J+=` float show = float(getShowFromStyle(position, position_absolute, color, normal));
- `),R?J+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio;
- `:w?J+=` vec4 positionEC = czm_modelView * vec4(position, 1.0);
- float depth = -positionEC.z;
- gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize);
- `:J+=` gl_PointSize = u_pointSize;
- `,J+=` color = color * u_highlightColor;
- `,j&&b&&(J+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC);
- diffuseStrength = max(diffuseStrength, 0.4);
- color.xyz *= diffuseStrength * czm_lightColor;
- `),J+=` v_color = color;
- gl_Position = czm_modelViewProjection * vec4(position, 1.0);
- `,j&&A&&(J+=` float visible = step(-normalEC.z, 0.0);
- gl_Position *= visible;
- gl_PointSize *= visible;
- `),P&&(J+=` gl_Position.w *= float(show);
- gl_PointSize *= float(show);
- `),J+=`}
- `;let ce=`varying vec4 v_color;
- `;F&&(ce+=`uniform highp sampler2D u_clippingPlanes;
- uniform mat4 u_clippingPlanesMatrix;
- uniform vec4 u_clippingPlanesEdgeStyle;
- `,ce+=`
- `,ce+=wg(S,s),ce+=`
- `),ce+=`void main()
- {
- gl_FragColor = czm_gammaCorrect(v_color);
- `,F&&(ce+=eb("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),ce+=`}
- `,e.splitDirection!==as.NONE&&(ce=vg.modifyFragmentShader(ce)),l(e._vertexShaderLoaded)&&(J=e._vertexShaderLoaded(J)),l(e._fragmentShaderLoaded)&&(ce=e._fragmentShaderLoaded(ce));let de=e._drawCommand;l(de.shaderProgram)&&de.shaderProgram.destroy(),de.shaderProgram=Wt.fromCache({context:s,vertexShaderSource:J,fragmentShaderSource:ce,attributeLocations:X});try{de.shaderProgram._bind()}catch{throw new fe("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function qGe(e,t){if(e._decodingState===_x.READY)return!1;if(e._decodingState===_x.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,r=_l.decodePointCloud(i,t);l(r)&&(e._decodingState=_x.DECODING,r.then(function(o){e._decodingState=_x.READY;let s=l(o.POSITION)?o.POSITION.array:void 0,a=l(o.RGB)?o.RGB.array:void 0,c=l(o.RGBA)?o.RGBA.array:void 0,u=l(o.NORMAL)?o.NORMAL.array:void 0,f=l(o.BATCH_ID)?o.BATCH_ID.array:void 0,d=l(s)&&l(o.POSITION.data.quantization),p=l(u)&&l(o.NORMAL.data.quantization);if(d){let C=o.POSITION.data.quantization,A=C.range;e._quantizedVolumeScale=h.fromElements(A,A,A),e._quantizedVolumeOffset=h.unpack(C.minValues),e._quantizedRange=(1<<C.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,m=i.batchTableProperties;for(let C in m)if(m.hasOwnProperty(C)){let A=o[C];l(g)||(g={}),g[C]={typedArray:A.array,componentCount:A.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let x=y(c,a);l(x)&&(n.colors={typedArray:x}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=g}).catch(function(o){e._decodingState=_x.FAILED,e._rejectReadyPromise(o)}))}return!0}var YGe=new se,XGe=new h;lv.prototype.update=function(e){let t=e.context;if(qGe(this,t))return;let i=!1,r=!N.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,r=!0),l(this._drawCommand)||(HGe(this,e),r=!0,i=!0,this._resolveReadyPromise(),this._parsedContent=void 0),r){N.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(N.clone(this._modelMatrix,u),l(this._rtcCenter)&&N.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&N.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==te.SCENE3D){let d=e.mapProjection,p=N.getColumn(u,3,YGe);se.equals(p,se.UNIT_W)||yt.basisTo2D(d,u,u)}let f=this._drawCommand.boundingVolume;if(re.clone(this._boundingSphere,f),this._cull){let d=f.center;N.multiplyByPoint(u,d,d);let p=N.getScale(u,XGe);f.radius*=h.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let o=this.splitDirection!==as.NONE;this._splittingEnabled!==o&&(this._splittingEnabled=o,i=!0),i&&jGe(this,e,this._style),this._drawCommand.castShadows=Zt.castShadows(this.shadows),this._drawCommand.receiveShadows=Zt.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?Ce.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};lv.prototype.isDestroyed=function(){return!1};lv.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),ue(this)};var ob=lv;function S9(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function UN(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function pd(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Bt.maximumColorAttachments;this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=y(e.destroyAttachments,!0);let r=l(e.depthTexture)||l(e.depthRenderbuffer),o=l(e.depthStencilTexture)||l(e.depthStencilRenderbuffer);this._bind();let s,a,c,u,f;if(l(e.colorTextures)){let d=e.colorTextures;for(u=this._colorTextures.length=this._activeColorAttachments.length=d.length,c=0;c<u;++c)s=d[c],f=this._gl.COLOR_ATTACHMENT0+c,S9(this,f,s),this._activeColorAttachments[c]=f,this._colorTextures[c]=s}if(l(e.colorRenderbuffers)){let d=e.colorRenderbuffers;for(u=this._colorRenderbuffers.length=this._activeColorAttachments.length=d.length,c=0;c<u;++c)a=d[c],f=this._gl.COLOR_ATTACHMENT0+c,UN(this,f,a),this._activeColorAttachments[c]=f,this._colorRenderbuffers[c]=a}l(e.depthTexture)&&(s=e.depthTexture,S9(this,this._gl.DEPTH_ATTACHMENT,s),this._depthTexture=s),l(e.depthRenderbuffer)&&(a=e.depthRenderbuffer,UN(this,this._gl.DEPTH_ATTACHMENT,a),this._depthRenderbuffer=a),l(e.stencilRenderbuffer)&&(a=e.stencilRenderbuffer,UN(this,this._gl.STENCIL_ATTACHMENT,a),this._stencilRenderbuffer=a),l(e.depthStencilTexture)&&(s=e.depthStencilTexture,S9(this,this._gl.DEPTH_STENCIL_ATTACHMENT,s),this._depthStencilTexture=s),l(e.depthStencilRenderbuffer)&&(a=e.depthStencilRenderbuffer,UN(this,this._gl.DEPTH_STENCIL_ATTACHMENT,a),this._depthStencilRenderbuffer=a),this._unBind()}Object.defineProperties(pd.prototype,{status:{get:function(){this._bind();let e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}});pd.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};pd.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};pd.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};pd.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};pd.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};pd.prototype.getColorTexture=function(e){return this._colorTextures[e]};pd.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};pd.prototype.isDestroyed=function(){return!1};pd.prototype.destroy=function(){if(this.destroyAttachments){let e=0,t=this._colorTextures,n=t.length;for(;e<n;++e){let r=t[e];l(r)&&r.destroy()}let i=this._colorRenderbuffers;for(n=i.length,e=0;e<n;++e){let r=i[e];l(r)&&r.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),ue(this)};var ya=pd;function sb(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=e.width,i=e.height;this._width=n,this._height=i;let r=e.colorRenderbuffers,o=e.colorTextures;if(l(r)!==l(o))throw new ye("Both color renderbuffer and texture attachments must be provided.");let s=e.depthStencilRenderbuffer,a=e.depthStencilTexture;if(l(s)!==l(a))throw new ye("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new ya({context:t,colorRenderbuffers:r,depthStencilRenderbuffer:s,destroyAttachments:e.destroyAttachments}),this._colorFramebuffer=new ya({context:t,colorTextures:o,depthStencilTexture:a,destroyAttachments:e.destroyAttachments})}sb.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};sb.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};sb.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};sb.prototype.isDestroyed=function(){return!1};sb.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ue(this)};var zN=sb;var xl={RGBA4:Z.RGBA4,RGBA8:Z.RGBA8,RGBA16F:Z.RGBA16F,RGBA32F:Z.RGBA32F,RGB5_A1:Z.RGB5_A1,RGB565:Z.RGB565,DEPTH_COMPONENT16:Z.DEPTH_COMPONENT16,STENCIL_INDEX8:Z.STENCIL_INDEX8,DEPTH_STENCIL:Z.DEPTH_STENCIL,DEPTH24_STENCIL8:Z.DEPTH24_STENCIL8,validate:function(e){return e===xl.RGBA4||e===xl.RGBA8||e===xl.RGBA16F||e===xl.RGBA32F||e===xl.RGB5_A1||e===xl.RGB565||e===xl.DEPTH_COMPONENT16||e===xl.STENCIL_INDEX8||e===xl.DEPTH_STENCIL||e===xl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===Z.FLOAT?xl.RGBA32F:e===Z.HALF_FLOAT_OES?xl.RGBA16F:xl.RGBA8}},Cl=Object.freeze(xl);function uv(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Bt.maximumRenderbufferSize,r=y(e.format,Cl.RGBA4),o=l(e.width)?e.width:n.drawingBufferWidth,s=l(e.height)?e.height:n.drawingBufferHeight,a=y(e.numSamples,1);this._gl=n,this._format=r,this._width=o,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,r,o,s):n.renderbufferStorage(n.RENDERBUFFER,r,o,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(uv.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});uv.prototype._getRenderbuffer=function(){return this._renderbuffer};uv.prototype.isDestroyed=function(){return!1};uv.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ue(this)};var sf=uv;function ys(e){e=y(e,y.EMPTY_OBJECT),this._numSamples=y(e.numSamples,1),this._colorAttachmentsLength=y(e.colorAttachmentsLength,1),this._color=y(e.color,!0),this._depth=y(e.depth,!1),this._depthStencil=y(e.depthStencil,!1),this._supportsDepthTexture=y(e.supportsDepthTexture,!1),this._createColorAttachments=y(e.createColorAttachments,!0),this._createDepthAttachments=y(e.createDepthAttachments,!0),this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(ys.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});ys.prototype.isDirty=function(e,t,n,i,r){n=y(n,1);let o=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(r)&&this._pixelFormat!==r,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||o||s||a||!c||this._color&&!l(this._colorTextures[0])};ys.prototype.update=function(e,t,n,i,r,o){if(i=e.msaa?y(i,1):1,r=y(r,this._color?y(this._pixelDatatype,qe.UNSIGNED_BYTE):void 0),o=y(o,this._color?y(this._pixelFormat,ct.RGBA):void 0),this.isDirty(t,n,i,r,o)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=r,this._pixelFormat=o,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new wt({context:e,width:t,height:n,pixelFormat:o,pixelDatatype:r,sampler:on.NEAREST}),this._numSamples>1){let a=Cl.getColorFormat(r);this._colorRenderbuffers[s]=new sf({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new wt({context:e,width:t,height:n,pixelFormat:ct.DEPTH_STENCIL,pixelDatatype:qe.UNSIGNED_INT_24_8,sampler:on.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new sf({context:e,width:t,height:n,format:Cl.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new sf({context:e,width:t,height:n,format:Cl.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new wt({context:e,width:t,height:n,pixelFormat:ct.DEPTH_COMPONENT,pixelDatatype:qe.UNSIGNED_INT,sampler:on.NEAREST}):this._depthRenderbuffer=new sf({context:e,width:t,height:n,format:Cl.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new zN({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new ya({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};ys.prototype.getColorTexture=function(e){return e=y(e,0),this._colorTextures[e]};ys.prototype.setColorTexture=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};ys.prototype.getColorRenderbuffer=function(e){return e=y(e,0),this._colorRenderbuffers[e]};ys.prototype.setColorRenderbuffer=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};ys.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};ys.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};ys.prototype.getDepthTexture=function(){return this._depthTexture};ys.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};ys.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};ys.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};ys.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};ys.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};ys.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};ys.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};ys.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};ys.prototype.destroy=function(){if(this._color){let e,t=this._colorTextures.length;for(e=0;e<t;++e){let n=this._colorTextures[e];this._createColorAttachments&&l(n)&&!n.isDestroyed()&&(this._colorTextures[e].destroy(),this._colorTextures[e]=void 0),l(n)&&n.isDestroyed()&&(this._colorTextures[e]=void 0);let i=this._colorRenderbuffers[e];this._createColorAttachments&&l(i)&&!i.isDestroyed()&&(this._colorRenderbuffers[e].destroy(),this._colorRenderbuffers[e]=void 0),l(i)&&i.isDestroyed()&&(this._colorRenderbuffers[e]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),l(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),l(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),l(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),l(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var pi=ys;var HN=`#extension GL_EXT_frag_depth : enable
- uniform sampler2D u_pointCloud_colorGBuffer;
- uniform sampler2D u_pointCloud_depthGBuffer;
- uniform vec2 u_distanceAndEdlStrength;
- varying vec2 v_textureCoordinates;
- vec2 neighborContribution(float log2Depth, vec2 offset)
- {
- float dist = u_distanceAndEdlStrength.x;
- vec2 texCoordOrig = v_textureCoordinates + offset * dist;
- vec2 texCoord0 = v_textureCoordinates + offset * floor(dist);
- vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist);
- float depthOrLogDepth0 = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, texCoord0));
- float depthOrLogDepth1 = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, texCoord1));
- if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) {
- return vec2(0.0);
- }
- float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist));
- vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix);
- return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0);
- }
- void main()
- {
- float depthOrLogDepth = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, v_textureCoordinates));
- vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth);
- eyeCoordinate /= eyeCoordinate.w;
- float log2Depth = log2(-eyeCoordinate.z);
- if (depthOrLogDepth == 0.0)
- {
- discard;
- }
- vec4 color = texture2D(u_pointCloud_colorGBuffer, v_textureCoordinates);
- vec2 texelSize = 1.0 / czm_viewport.zw;
- vec2 responseAndCount = vec2(0.0);
- responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0));
- responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0));
- responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y));
- responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y));
- float response = responseAndCount.x / responseAndCount.y;
- float strength = u_distanceAndEdlStrength.y;
- float shade = exp(-response * 300.0 * strength);
- color.rgb *= shade;
- gl_FragColor = vec4(color);
- gl_FragDepthEXT = depthOrLogDepth;
- }
- `;function ab(){this._framebuffer=new pi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(ab.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});function KGe(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var w9=new W;function $Ge(e,t){let n=new Fe({defines:["LOG_DEPTH_WRITE"],sources:[HN]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return w9.x=e._radius,w9.y=e._strength,w9}},r=Ve.fromCache({blending:hn.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:tn.setCesium3DTileBit(),stencilMask:tn.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:r,pass:Ce.CESIUM_3D_TILE,owner:e}),e._clearCommand=new li({framebuffer:e.framebuffer,color:new z(0,0,0,0),depth:1,renderState:Ve.fromCache(),pass:Ce.CESIUM_3D_TILE,owner:e})}function ZGe(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),$Ge(e,t)}function vae(e){return e.drawBuffers&&e.fragmentDepth}ab.isSupported=vae;function JGe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,r=t.fragmentShaderSource.clone();r.sources=r.sources.map(function(o){return o=Fe.replaceMain(o,"czm_point_cloud_post_process_main"),o=o.replace(/gl_FragColor/g,"gl_FragData[0]"),o}),r.sources.unshift(`#extension GL_EXT_draw_buffers : enable
- `),r.sources.push(`void main()
- {
- czm_point_cloud_post_process_main();
- #ifdef LOG_DEPTH
- czm_writeLogDepth();
- gl_FragData[1] = czm_packDepth(gl_FragDepthEXT);
- #else
- gl_FragData[1] = czm_packDepth(gl_FragCoord.z);
- #endif
- }`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:i})}return n}ab.prototype.update=function(e,t,n,i){if(!vae(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,ZGe(this,e.context);let r,o=e.commandList,s=o.length;for(r=t;r<s;++r){let u=o[r];if(u.primitiveType!==Me.POINTS||u.pass===Ce.TRANSLUCENT)continue;let f,d,p=u.derivedCommands.pointCloudProcessor;l(p)&&(f=p.command,d=p.originalShaderProgram),(!l(f)||u.dirty||d!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=Ze.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=JGe(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,l(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),o[r]=f}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,o.push(c),o.push(a)};ab.prototype.isDestroyed=function(){return!1};ab.prototype.destroy=function(){return KGe(this),ue(this)};var Lg=ab;function Dae(e){let t=y(e,{});this.attenuation=y(t.attenuation,!1),this.geometricErrorScale=y(t.geometricErrorScale,1),this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=y(t.eyeDomeLighting,!0),this.eyeDomeLightingStrength=y(t.eyeDomeLightingStrength,1),this.eyeDomeLightingRadius=y(t.eyeDomeLightingRadius,1),this.backFaceCulling=y(t.backFaceCulling,!1),this.normalShading=y(t.normalShading,!0)}Dae.isSupported=function(e){return Lg.isSupported(e.context)};var _d=Dae;function Pp(e,t,n,i,r){this._tileset=e,this._tile=t,this._resource=n,this._metadata=void 0,this._pickId=void 0,this._batchTable=void 0,this._styleDirty=!1,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._pointCloud=new ob({arrayBuffer:i,byteOffset:r,cull:!1,opaquePass:Ce.CESIUM_3D_TILE,vertexShaderLoaded:QGe(this),fragmentShaderLoaded:e6e(this),uniformMapLoaded:t6e(this),batchTableLoaded:n6e(this),pickIdLoaded:i6e(this)})}Object.defineProperties(Pp.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return this._pointCloud.pointsLength}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return this._pointCloud.geometryByteLength}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._pointCloud.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function QGe(e){return function(t){return l(e._batchTable)?e._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(t):t}}function e6e(e){return function(t){return l(e._batchTable)?e._batchTable.getFragmentShaderCallback(!1,void 0,!1)(t):`uniform vec4 czm_pickColor;
- ${t}`}}function t6e(e){return function(t){return l(e._batchTable)?e._batchTable.getUniformMapCallback()(t):rt(t,{czm_pickColor:function(){return e._pickId.color}})}}function n6e(e){return function(t,n,i){e._batchTable=new ml(e,t,n,i)}}function i6e(e){return function(){return l(e._batchTable)?e._batchTable.getPickId():"czm_pickColor"}}function r6e(e){let t=e._tileset.pointCloudShading,n=e._tile.contentBoundingVolume.boundingSphere.volume(),i=M.cbrt(n/e.pointsLength),r=e._tile.geometricError;return r===0&&(l(t)&&l(t.baseResolution)?r=t.baseResolution:r=i),r}function o6e(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);for(let i=0;i<t;++i)n[i]=new bo(e,i);e._features=n}}Pp.prototype.hasProperty=function(e,t){return l(this._batchTable)?this._batchTable.hasProperty(e,t):!1};Pp.prototype.getFeature=function(e){if(!l(this._batchTable))return;let t=this.featuresLength;return o6e(this),this._features[e]};Pp.prototype.applyDebugSettings=function(e,t){this._pointCloud.color=e?t:z.WHITE};Pp.prototype.applyStyle=function(e){l(this._batchTable)?this._batchTable.applyStyle(e):this._styleDirty=!0};var s6e=new _d;Pp.prototype.update=function(e,t){let n=this._pointCloud,i=y(e.pointCloudShading,s6e),r=this._tile,o=this._batchTable,s=t.mode,a=e.clippingPlanes;!l(this._pickId)&&!l(o)&&(this._pickId=t.context.createPickId({primitive:e,content:this})),l(o)&&o.update(e,t);let c;l(r._contentBoundingVolume)?c=s===te.SCENE3D?r._contentBoundingVolume.boundingSphere:r._contentBoundingVolume2D.boundingSphere:c=s===te.SCENE3D?r._boundingVolume.boundingSphere:r._boundingVolume2D.boundingSphere;let u=this._styleDirty;this._styleDirty=!1,n.clippingPlanesOriginMatrix=e.clippingPlanesOriginMatrix,n.style=l(o)?void 0:e.style,n.styleDirty=u,n.modelMatrix=r.computedTransform,n.time=e.timeSinceLoad,n.shadows=e.shadows,n.boundingSphere=c,n.clippingPlanes=a,n.isClipped=l(a)&&a.enabled&&r._isClipped,n.clippingPlanesDirty=r.clippingPlanesDirty,n.attenuation=i.attenuation,n.backFaceCulling=i.backFaceCulling,n.normalShading=i.normalShading,n.geometricError=r6e(this),n.geometricErrorScale=i.geometricErrorScale,n.splitDirection=e.splitDirection,l(i)&&l(i.maximumAttenuation)?n.maximumAttenuation=i.maximumAttenuation:r.refine===Eo.ADD?n.maximumAttenuation=5:n.maximumAttenuation=e.maximumScreenSpaceError,n.update(t)};Pp.prototype.isDestroyed=function(){return!1};Pp.prototype.destroy=function(){return this._pickId=this._pickId&&this._pickId.destroy(),this._pointCloud=this._pointCloud&&this._pointCloud.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};var GN=Pp;function Ip(e,t,n,i){this._tileset=e,this._tile=t,this._resource=n,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._readyPromise=a6e(this,i)}Object.defineProperties(Ip.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function a6e(e,t){return e._tileset.loadTileset(e._resource,t,e._tile),Promise.resolve(e)}Ip.prototype.hasProperty=function(e,t){return!1};Ip.prototype.getFeature=function(e){};Ip.prototype.applyDebugSettings=function(e,t){};Ip.prototype.applyStyle=function(e){};Ip.prototype.update=function(e,t){};Ip.prototype.isDestroyed=function(){return!1};Ip.prototype.destroy=function(){return ue(this)};var WN=Ip;function Ps(e,t,n,i){let r=Ps._verifyAttributes(t);n=y(n,0);let o=[],s={},a,c,u=r.length;for(let d=0;d<u;++d){let p=r[d];if(p.vertexBuffer){o.push(p);continue}c=p.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(p)}function f(d,p){return K.getSizeInBytes(p.componentDatatype)-K.getSizeInBytes(d.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(f);let d=Ps._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:d,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Ps._createArrayViews(a,d)};this._allBuffers.push(g)}this._size=0,this._instanced=y(i,!1),this._precreated=o,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Ps._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let r=e[i],o={index:y(r.index,i),enabled:y(r.enabled,!0),componentsPerAttribute:r.componentsPerAttribute,componentDatatype:y(r.componentDatatype,K.FLOAT),normalize:y(r.normalize,!1),vertexBuffer:r.vertexBuffer,usage:y(r.usage,Ne.STATIC_DRAW)};t.push(o)}let n=new Array(t.length);for(let i=0;i<t.length;++i){let o=t[i].index;n[o]=!0}return t};Ps._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*K.getSizeInBytes(a.componentDatatype)}let i=n>0?K.getSizeInBytes(e[0].componentDatatype):0,r=i>0?t%i:0;return t+=r===0?0:i-r,t};Ps._createArrayViews=function(e,t){let n=[],i=0,r=e.length;for(let o=0;o<r;++o){let s=e[o],a=s.componentDatatype;n.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:a,normalize:s.normalize,offsetInBytes:i,vertexSizeInComponentType:t/K.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*K.getSizeInBytes(a)}return n};Ps.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let r=t[n];Ps._resize(r,this._size),Ps._appendWriters(this.writers,r)}v9(this)};Ps._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let o=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c<a;++c)o[c]=s[c]}let i=e.arrayViews,r=i.length;for(let o=0;o<r;++o){let s=i[o];s.view=K.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var c6e=[function(e,t,n){return function(i,r){t[i*n]=r,e.needsCommit=!0}},function(e,t,n){return function(i,r,o){let s=i*n;t[s]=r,t[s+1]=o,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,s){let a=i*n;t[a]=r,t[a+1]=o,t[a+2]=s,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,s,a){let c=i*n;t[c]=r,t[c+1]=o,t[c+2]=s,t[c+3]=a,e.needsCommit=!0}}];Ps._appendWriters=function(e,t){let n=t.arrayViews,i=n.length;for(let r=0;r<i;++r){let o=n[r];e[o.index]=c6e[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}};Ps.prototype.commit=function(e){let t=!1,n=this._allBuffers,i,r,o;for(r=0,o=n.length;r<o;++r)i=n[r],t=l6e(this,i)||t;if(t||!l(this.va)){v9(this);let s=this.va=[],a=M.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let u=0;u<c;++u){let f=[];for(r=0,o=n.length;r<o;++r){i=n[r];let d=u*(i.vertexSizeInBytes*a);Ps._appendAttributes(f,i,d,this._instanced)}f=f.concat(this._precreated),s.push({va:new Qn({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==c-1?a:this._size%a)})}}};function l6e(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,r=l(n);if(!r||n.sizeInBytes<i)return r&&n.destroy(),t.vertexBuffer=at.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Ps._appendAttributes=function(e,t,n,i){let r=t.arrayViews,o=r.length;for(let s=0;s<o;++s){let a=r[s];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};Ps.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,r=n.length;i<r;++i)u6e(n[i],e,t)};function u6e(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){let i=e.vertexSizeInBytes*t,r=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,r),i)}}Ps.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function v9(e){let t=e.va;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}Ps.prototype.isDestroyed=function(){return!1};Ps.prototype.destroy=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){let i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return v9(this),ue(this)};var Ng=Ps;var jN=`#ifdef GL_OES_standard_derivatives
- #extension GL_OES_standard_derivatives : enable
- #endif
- uniform sampler2D u_atlas;
- #ifdef VECTOR_TILE
- uniform vec4 u_highlightColor;
- #endif
- varying vec2 v_textureCoordinates;
- varying vec4 v_pickColor;
- varying vec4 v_color;
- #ifdef SDF
- varying vec4 v_outlineColor;
- varying float v_outlineWidth;
- #endif
- #ifdef FRAGMENT_DEPTH_CHECK
- varying vec4 v_textureCoordinateBounds;
- varying vec4 v_originTextureCoordinateAndTranslate;
- varying vec4 v_compressed;
- varying mat2 v_rotationMatrix;
- const float SHIFT_LEFT12 = 4096.0;
- const float SHIFT_LEFT1 = 2.0;
- const float SHIFT_RIGHT12 = 1.0 / 4096.0;
- const float SHIFT_RIGHT1 = 1.0 / 2.0;
- float getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize)
- {
- vec2 lookupVector = imageSize * (depthLookupST - adjustedST);
- lookupVector = v_rotationMatrix * lookupVector;
- vec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y));
- vec2 translation = v_originTextureCoordinateAndTranslate.zw;
- if (applyTranslate)
- {
- translation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0));
- }
- vec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw;
- float logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, st));
- if (logDepthOrDepth == 0.0)
- {
- return 0.0;
- }
- vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
- return eyeCoordinate.z / eyeCoordinate.w;
- }
- #endif
- #ifdef SDF
- float getDistance(vec2 position)
- {
- return texture2D(u_atlas, position).r;
- }
- vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing)
- {
- float distance = getDistance(position);
- if (outlineWidth > 0.0)
- {
- float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE);
- float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);
- vec4 sdfColor = mix(outlineColor, v_color, outlineFactor);
- float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance);
- return vec4(sdfColor.rgb, sdfColor.a * alpha);
- }
- else
- {
- float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);
- return vec4(v_color.rgb, v_color.a * alpha);
- }
- }
- #endif
- void main()
- {
- vec4 color = texture2D(u_atlas, v_textureCoordinates);
- #ifdef SDF
- float outlineWidth = v_outlineWidth;
- vec4 outlineColor = v_outlineColor;
- float distance = getDistance(v_textureCoordinates);
- #ifdef GL_OES_standard_derivatives
- float smoothing = fwidth(distance);
- vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates));
- vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);
- vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);
- vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);
- vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);
- vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);
- color = (center + color1 + color2 + color3 + color4)/5.0;
- #else
- float smoothing = 1.0/32.0;
- color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);
- #endif
- color = czm_gammaCorrect(color);
- #else
- color = czm_gammaCorrect(color);
- color *= czm_gammaCorrect(v_color);
- #endif
- #if !defined(OPAQUE) && !defined(TRANSLUCENT)
- if (color.a < 0.005)
- {
- discard;
- }
- #else
- #ifdef OPAQUE
- if (color.a < 0.995)
- {
- discard;
- }
- #else
- if (color.a >= 0.995)
- {
- discard;
- }
- #endif
- #endif
- #ifdef VECTOR_TILE
- color *= u_highlightColor;
- #endif
- gl_FragColor = color;
- #ifdef LOG_DEPTH
- czm_writeLogDepth();
- #endif
- #ifdef FRAGMENT_DEPTH_CHECK
- float temp = v_compressed.y;
- temp = temp * SHIFT_RIGHT1;
- float temp2 = (temp - floor(temp)) * SHIFT_LEFT1;
- bool enableDepthTest = temp2 != 0.0;
- bool applyTranslate = floor(temp) != 0.0;
- if (enableDepthTest) {
- temp = v_compressed.z;
- temp = temp * SHIFT_RIGHT12;
- vec2 dimensions;
- dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;
- dimensions.x = floor(temp);
- temp = v_compressed.w;
- temp = temp * SHIFT_RIGHT12;
- vec2 imageSize;
- imageSize.y = (temp - floor(temp)) * SHIFT_LEFT12;
- imageSize.x = floor(temp);
- vec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy;
- adjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y);
- float epsilonEyeDepth = v_compressed.x + czm_epsilon1;
- float globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize);
- if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth)
- {
- float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize);
- if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth)
- {
- float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize);
- if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth)
- {
- discard;
- }
- }
- }
- }
- #endif
- }
- `;var qN=`#ifdef INSTANCED
- attribute vec2 direction;
- #endif
- attribute vec4 positionHighAndScale;
- attribute vec4 positionLowAndRotation;
- attribute vec4 compressedAttribute0;
- attribute vec4 compressedAttribute1;
- attribute vec4 compressedAttribute2;
- attribute vec4 eyeOffset;
- attribute vec4 scaleByDistance;
- attribute vec4 pixelOffsetScaleByDistance;
- attribute vec4 compressedAttribute3;
- attribute vec2 sdf;
- #if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)
- attribute vec4 textureCoordinateBoundsOrLabelTranslate;
- #endif
- #ifdef VECTOR_TILE
- attribute float a_batchId;
- #endif
- varying vec2 v_textureCoordinates;
- #ifdef FRAGMENT_DEPTH_CHECK
- varying vec4 v_textureCoordinateBounds;
- varying vec4 v_originTextureCoordinateAndTranslate;
- varying vec4 v_compressed;
- varying mat2 v_rotationMatrix;
- #endif
- varying vec4 v_pickColor;
- varying vec4 v_color;
- #ifdef SDF
- varying vec4 v_outlineColor;
- varying float v_outlineWidth;
- #endif
- const float UPPER_BOUND = 32768.0;
- const float SHIFT_LEFT16 = 65536.0;
- const float SHIFT_LEFT12 = 4096.0;
- const float SHIFT_LEFT8 = 256.0;
- const float SHIFT_LEFT7 = 128.0;
- const float SHIFT_LEFT5 = 32.0;
- const float SHIFT_LEFT3 = 8.0;
- const float SHIFT_LEFT2 = 4.0;
- const float SHIFT_LEFT1 = 2.0;
- const float SHIFT_RIGHT12 = 1.0 / 4096.0;
- const float SHIFT_RIGHT8 = 1.0 / 256.0;
- const float SHIFT_RIGHT7 = 1.0 / 128.0;
- const float SHIFT_RIGHT5 = 1.0 / 32.0;
- const float SHIFT_RIGHT3 = 1.0 / 8.0;
- const float SHIFT_RIGHT2 = 1.0 / 4.0;
- const float SHIFT_RIGHT1 = 1.0 / 2.0;
- vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp)
- {
- vec2 halfSize = imageSize * scale * 0.5;
- halfSize *= ((direction * 2.0) - 1.0);
- vec2 originTranslate = origin * abs(halfSize);
- #if defined(ROTATION) || defined(ALIGNED_AXIS)
- if (validAlignedAxis || rotation != 0.0)
- {
- float angle = rotation;
- if (validAlignedAxis)
- {
- vec4 projectedAlignedAxis = czm_modelViewProjection * vec4(alignedAxis, 0.0);
- angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) /
- (projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y));
- }
- float cosTheta = cos(angle);
- float sinTheta = sin(angle);
- rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);
- halfSize = rotationMatrix * halfSize;
- }
- else
- {
- rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);
- }
- #endif
- mpp = czm_metersPerPixel(positionEC);
- positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp);
- positionEC.xy += (translate + pixelOffset) * mpp;
- return positionEC;
- }
- #ifdef VERTEX_DEPTH_CHECK
- float getGlobeDepth(vec4 positionEC)
- {
- vec4 posWC = czm_eyeToWindowCoordinates(positionEC);
- float globeDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, posWC.xy / czm_viewport.zw));
- if (globeDepth == 0.0)
- {
- return 0.0;
- }
- vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth);
- return eyeCoordinate.z / eyeCoordinate.w;
- }
- #endif
- void main()
- {
- vec3 positionHigh = positionHighAndScale.xyz;
- vec3 positionLow = positionLowAndRotation.xyz;
- float scale = positionHighAndScale.w;
- #if defined(ROTATION) || defined(ALIGNED_AXIS)
- float rotation = positionLowAndRotation.w;
- #else
- float rotation = 0.0;
- #endif
- float compressed = compressedAttribute0.x;
- vec2 pixelOffset;
- pixelOffset.x = floor(compressed * SHIFT_RIGHT7);
- compressed -= pixelOffset.x * SHIFT_LEFT7;
- pixelOffset.x -= UPPER_BOUND;
- vec2 origin;
- origin.x = floor(compressed * SHIFT_RIGHT5);
- compressed -= origin.x * SHIFT_LEFT5;
- origin.y = floor(compressed * SHIFT_RIGHT3);
- compressed -= origin.y * SHIFT_LEFT3;
- #ifdef FRAGMENT_DEPTH_CHECK
- vec2 depthOrigin = origin.xy;
- #endif
- origin -= vec2(1.0);
- float show = floor(compressed * SHIFT_RIGHT2);
- compressed -= show * SHIFT_LEFT2;
- #ifdef INSTANCED
- vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);
- vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);
- vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;
- #else
- vec2 direction;
- direction.x = floor(compressed * SHIFT_RIGHT1);
- direction.y = compressed - direction.x * SHIFT_LEFT1;
- vec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);
- #endif
- float temp = compressedAttribute0.y * SHIFT_RIGHT8;
- pixelOffset.y = -(floor(temp) - UPPER_BOUND);
- vec2 translate;
- translate.y = (temp - floor(temp)) * SHIFT_LEFT16;
- temp = compressedAttribute0.z * SHIFT_RIGHT8;
- translate.x = floor(temp) - UPPER_BOUND;
- translate.y += (temp - floor(temp)) * SHIFT_LEFT8;
- translate.y -= UPPER_BOUND;
- temp = compressedAttribute1.x * SHIFT_RIGHT8;
- float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);
- vec2 imageSize = vec2(floor(temp), temp2);
- #ifdef FRAGMENT_DEPTH_CHECK
- float labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2));
- float applyTranslate = 0.0;
- if (labelHorizontalOrigin != 0.0)
- {
- applyTranslate = 1.0;
- labelHorizontalOrigin -= 2.0;
- depthOrigin.x = labelHorizontalOrigin + 1.0;
- }
- depthOrigin = vec2(1.0) - (depthOrigin * 0.5);
- #endif
- #ifdef EYE_DISTANCE_TRANSLUCENCY
- vec4 translucencyByDistance;
- translucencyByDistance.x = compressedAttribute1.z;
- translucencyByDistance.z = compressedAttribute1.w;
- translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
- temp = compressedAttribute1.y * SHIFT_RIGHT8;
- translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
- #endif
- #if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)
- temp = compressedAttribute3.w;
- temp = temp * SHIFT_RIGHT12;
- vec2 dimensions;
- dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;
- dimensions.x = floor(temp);
- #endif
- #ifdef ALIGNED_AXIS
- vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));
- temp = compressedAttribute2.z * SHIFT_RIGHT5;
- bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;
- #else
- vec3 alignedAxis = vec3(0.0);
- bool validAlignedAxis = false;
- #endif
- vec4 pickColor;
- vec4 color;
- temp = compressedAttribute2.y;
- temp = temp * SHIFT_RIGHT8;
- pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
- temp = floor(temp) * SHIFT_RIGHT8;
- pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
- pickColor.r = floor(temp);
- temp = compressedAttribute2.x;
- temp = temp * SHIFT_RIGHT8;
- color.b = (temp - floor(temp)) * SHIFT_LEFT8;
- temp = floor(temp) * SHIFT_RIGHT8;
- color.g = (temp - floor(temp)) * SHIFT_LEFT8;
- color.r = floor(temp);
- temp = compressedAttribute2.z * SHIFT_RIGHT8;
- bool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;
- temp = floor(temp) * SHIFT_RIGHT8;
- pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
- pickColor /= 255.0;
- color.a = floor(temp);
- color /= 255.0;
- vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
- vec4 positionEC = czm_modelViewRelativeToEye * p;
- #if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK)
- float eyeDepth = positionEC.z;
- #endif
- positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);
- positionEC.xyz *= show;
- #if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)
- float lengthSq;
- if (czm_sceneMode == czm_sceneMode2D)
- {
- lengthSq = czm_eyeHeight2D.y;
- }
- else
- {
- lengthSq = dot(positionEC.xyz, positionEC.xyz);
- }
- #endif
- #ifdef EYE_DISTANCE_SCALING
- float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq);
- scale *= distanceScale;
- translate *= distanceScale;
- if (scale == 0.0)
- {
- positionEC.xyz = vec3(0.0);
- }
- #endif
- float translucency = 1.0;
- #ifdef EYE_DISTANCE_TRANSLUCENCY
- translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
- if (translucency == 0.0)
- {
- positionEC.xyz = vec3(0.0);
- }
- #endif
- #ifdef EYE_DISTANCE_PIXEL_OFFSET
- float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);
- pixelOffset *= pixelOffsetScale;
- #endif
- #ifdef DISTANCE_DISPLAY_CONDITION
- float nearSq = compressedAttribute3.x;
- float farSq = compressedAttribute3.y;
- if (lengthSq < nearSq || lengthSq > farSq)
- {
- positionEC.xyz = vec3(0.0);
- }
- #endif
- mat2 rotationMatrix;
- float mpp;
- #ifdef DISABLE_DEPTH_DISTANCE
- float disableDepthTestDistance = compressedAttribute3.z;
- #endif
- #ifdef VERTEX_DEPTH_CHECK
- if (lengthSq < disableDepthTestDistance) {
- float depthsilon = 10.0;
- vec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy;
- vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
- float globeDepth1 = getGlobeDepth(pEC1);
- if (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1)
- {
- vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
- float globeDepth2 = getGlobeDepth(pEC2);
- if (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2)
- {
- vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
- float globeDepth3 = getGlobeDepth(pEC3);
- if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3)
- {
- positionEC.xyz = vec3(0.0);
- }
- }
- }
- }
- #endif
- positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
- gl_Position = czm_projection * positionEC;
- v_textureCoordinates = textureCoordinates;
- #ifdef LOG_DEPTH
- czm_vertexLogDepth();
- #endif
- #ifdef DISABLE_DEPTH_DISTANCE
- if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
- {
- disableDepthTestDistance = czm_minimumDisableDepthTestDistance;
- }
- if (disableDepthTestDistance != 0.0)
- {
- float zclip = gl_Position.z / gl_Position.w;
- bool clipped = (zclip < -1.0 || zclip > 1.0);
- if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))
- {
- gl_Position.z = -gl_Position.w;
- #ifdef LOG_DEPTH
- v_depthFromNearPlusOne = 1.0;
- #endif
- }
- }
- #endif
- #ifdef FRAGMENT_DEPTH_CHECK
- if (sizeInMeters) {
- translate /= mpp;
- dimensions /= mpp;
- imageSize /= mpp;
- }
- #if defined(ROTATION) || defined(ALIGNED_AXIS)
- v_rotationMatrix = rotationMatrix;
- #else
- v_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);
- #endif
- float enableDepthCheck = 0.0;
- if (lengthSq < disableDepthTestDistance)
- {
- enableDepthCheck = 1.0;
- }
- float dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12));
- float dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12));
- float iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12));
- float ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12));
- v_compressed.x = eyeDepth;
- v_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck;
- v_compressed.z = dw * SHIFT_LEFT12 + dh;
- v_compressed.w = iw * SHIFT_LEFT12 + ih;
- v_originTextureCoordinateAndTranslate.xy = depthOrigin;
- v_originTextureCoordinateAndTranslate.zw = translate;
- v_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate;
- #endif
- #ifdef SDF
- vec4 outlineColor;
- float outlineWidth;
- temp = sdf.x;
- temp = temp * SHIFT_RIGHT8;
- outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
- temp = floor(temp) * SHIFT_RIGHT8;
- outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
- outlineColor.r = floor(temp);
- temp = sdf.y;
- temp = temp * SHIFT_RIGHT8;
- float temp3 = (temp - floor(temp)) * SHIFT_LEFT8;
- temp = floor(temp) * SHIFT_RIGHT8;
- outlineWidth = (temp - floor(temp)) * SHIFT_LEFT8;
- outlineColor.a = floor(temp);
- outlineColor /= 255.0;
- v_outlineWidth = outlineWidth / 255.0;
- v_outlineColor = outlineColor;
- v_outlineColor.a *= translucency;
- #endif
- v_pickColor = pickColor;
- v_color = color;
- v_color.a *= translucency;
- }
- `;var xa={},f6e=new se(0,0,0,1),Ya=new se,d6e=new je,D9=new W,P9=new W;xa.wgs84ToWindowCoordinates=function(e,t,n){return xa.wgs84WithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var Pae=new se,Iae=new h;function fv(e,t,n,i){let r=n.viewMatrix,o=N.multiplyByVector(r,se.fromElements(e.x,e.y,e.z,1,Pae),Pae),s=h.multiplyComponents(t,h.normalize(o,Iae),Iae);return o.x+=t.x+s.x,o.y+=t.y+s.y,o.z+=s.z,N.multiplyByVector(n.frustum.projectionMatrix,o,i)}var h6e=new me(Math.PI,M.PI_OVER_TWO),m6e=new h,p6e=new h;xa.wgs84WithEyeOffsetToWindowCoordinates=function(e,t,n,i){let r=e.frameState,o=xa.computeActualWgs84Position(r,t,f6e);if(!l(o))return;let s=e.canvas,a=d6e;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,u=!1;if(r.mode===te.SCENE2D){let f=e.mapProjection,d=h6e,p=f.project(d,m6e),g=h.clone(c.position,p6e),m=c.frustum.clone(),x=N.computeViewportTransformation(a,0,1,new N),C=c.frustum.projectionMatrix,A=c.positionWC.y,b=h.fromElements(M.sign(A)*p.x-A,0,-c.positionWC.x),T=yt.pointToGLWindowCoordinates(C,x,b);if(A===0||T.x<=0||T.x>=s.clientWidth)u=!0;else{if(T.x>s.clientWidth*.5){a.width=T.x,c.frustum.right=p.x-A,Ya=fv(o,n,c,Ya),xa.clipToGLWindowCoordinates(a,Ya,D9),a.x+=T.x,c.position.x=-c.position.x;let S=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-S,Ya=fv(o,n,c,Ya),xa.clipToGLWindowCoordinates(a,Ya,P9)}else{a.x+=T.x,a.width-=T.x,c.frustum.left=-p.x-A,Ya=fv(o,n,c,Ya),xa.clipToGLWindowCoordinates(a,Ya,D9),a.x=a.x-a.width,c.position.x=-c.position.x;let S=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-S,Ya=fv(o,n,c,Ya),xa.clipToGLWindowCoordinates(a,Ya,P9)}h.clone(g,c.position),c.frustum=m.clone(),i=W.clone(D9,i),(i.x<0||i.x>s.clientWidth)&&(i.x=P9.x)}}if(r.mode!==te.SCENE2D||u){if(Ya=fv(o,n,c,Ya),Ya.z<0&&!(c.frustum instanceof en)&&!(c.frustum instanceof Xo))return;i=xa.clipToGLWindowCoordinates(a,Ya,i)}return i.y=s.clientHeight-i.y,i};xa.wgs84ToDrawingBufferCoordinates=function(e,t,n){if(n=xa.wgs84ToWindowCoordinates(e,t,n),!!l(n))return xa.transformWindowToDrawingBuffer(e,n,n)};var Op=new h,_6e=new me;xa.computeActualWgs84Position=function(e,t,n){let i=e.mode;if(i===te.SCENE3D)return h.clone(t,n);let r=e.mapProjection,o=r.ellipsoid.cartesianToCartographic(t,_6e);if(!l(o))return;if(r.project(o,Op),i===te.COLUMBUS_VIEW)return h.fromElements(Op.z,Op.x,Op.y,n);if(i===te.SCENE2D)return h.fromElements(0,Op.x,Op.y,n);let s=e.morphTime;return h.fromElements(M.lerp(Op.z,t.x,s),M.lerp(Op.x,t.y,s),M.lerp(Op.y,t.z,s),n)};var Oae=new h,Rae=new h,Mae=new N;xa.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,Oae),N.computeViewportTransformation(e,0,1,Mae),N.multiplyByPoint(Mae,Oae,Rae),W.fromCartesian3(Rae,n)};xa.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,r=e.drawingBufferWidth/i.clientWidth,o=e.drawingBufferHeight/i.clientHeight;return W.fromElements(t.x*r,t.y*o,n)};var g6e=new se,Bae=new se;xa.drawingBufferToWgs84Coordinates=function(e,t,n,i){let o=e.context.uniformState,s=o.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let g=n*o.log2FarDepthFromNearPlusOne,m=Math.pow(2,g)-1;n=c*(1-a/(m+a))/(c-a)}let u=e.view.passState.viewport,f=se.clone(se.UNIT_W,g6e);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let d,p=e.camera.frustum;if(!l(p.fovy))l(p._offCenterFrustum)&&(p=p._offCenterFrustum),d=Bae,d.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,d.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,d.z=(f.z*(a-c)-a-c)*.5,d.w=1,d=N.multiplyByVector(o.inverseView,d,d);else{d=N.multiplyByVector(o.inverseViewProjection,f,Bae);let g=1/d.w;h.multiplyByScalar(d,g,d)}return h.fromCartesian4(d,i)};var rr=xa;function Ci(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=St.clone(n)),l(i)&&(i=St.clone(i)),l(r)&&(r=St.clone(r)),l(o)&&(o=Tt.clone(o)),this._show=y(e.show,!0),this._position=h.clone(y(e.position,h.ZERO)),this._actualPosition=h.clone(this._position),this._pixelOffset=W.clone(y(e.pixelOffset,W.ZERO)),this._translate=new W(0,0),this._eyeOffset=h.clone(y(e.eyeOffset,h.ZERO)),this._heightReference=y(e.heightReference,ze.NONE),this._verticalOrigin=y(e.verticalOrigin,vn.CENTER),this._horizontalOrigin=y(e.horizontalOrigin,gi.CENTER),this._scale=y(e.scale,1),this._color=z.clone(y(e.color,z.WHITE)),this._rotation=y(e.rotation,0),this._alignedAxis=h.clone(y(e.alignedAxis,h.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=r,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=y(e.sizeInMeters,!1),this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=y(e.collection,t),this._pickId=void 0,this._pickPrimitive=y(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image,a=e.imageId;l(s)&&(l(a)||(typeof s=="string"?a=s:l(s.src)?a=s.src:a=Ln()),this._imageId=a,this._image=s),l(e.imageSubRegion)&&(this._imageId=a,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=te.SCENE3D,this._clusterShow=!0,this._outlineColor=z.clone(y(e.outlineColor,z.BLACK)),this._outlineWidth=y(e.outlineWidth,0),this._updateClamping()}var Lae=Ci.SHOW_INDEX=0,XN=Ci.POSITION_INDEX=1,Uae=Ci.PIXEL_OFFSET_INDEX=2,y6e=Ci.EYE_OFFSET_INDEX=3,x6e=Ci.HORIZONTAL_ORIGIN_INDEX=4,C6e=Ci.VERTICAL_ORIGIN_INDEX=5,A6e=Ci.SCALE_INDEX=6,KN=Ci.IMAGE_INDEX_INDEX=7,Nae=Ci.COLOR_INDEX=8,T6e=Ci.ROTATION_INDEX=9,b6e=Ci.ALIGNED_AXIS_INDEX=10,E6e=Ci.SCALE_BY_DISTANCE_INDEX=11,S6e=Ci.TRANSLUCENCY_BY_DISTANCE_INDEX=12,w6e=Ci.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,v6e=Ci.DISTANCE_DISPLAY_CONDITION=14,D6e=Ci.DISABLE_DEPTH_DISTANCE=15;Ci.TEXTURE_COORDINATE_BOUNDS=16;var Fae=Ci.SDF_INDEX=17;Ci.NUMBER_OF_PROPERTIES=18;function Hr(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(Ci.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Hr(this,Lae))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),this._updateClamping(),Hr(this,XN))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Hr(this,XN))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;W.equals(t,e)||(W.clone(e,t),Hr(this,Uae))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;St.equals(t,e)||(this._scaleByDistance=St.clone(e,t),Hr(this,E6e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;St.equals(t,e)||(this._translucencyByDistance=St.clone(e,t),Hr(this,S6e))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;St.equals(t,e)||(this._pixelOffsetScaleByDistance=St.clone(e,t),Hr(this,w6e))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),Hr(this,y6e))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Hr(this,x6e))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Hr(this,C6e))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Hr(this,A6e))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Hr(this,Nae))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Hr(this,T6e))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),Hr(this,b6e))}},width:{get:function(){return y(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,Hr(this,KN))}},height:{get:function(){return y(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,Hr(this,KN))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Hr(this,Nae))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Tt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Tt.clone(e,this._distanceDisplayCondition),Hr(this,v6e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Hr(this,D6e))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){l(e)?typeof e=="string"?this.setImage(e,e):e instanceof De?this.setImage(e.url,e):l(e.src)?this.setImage(e.src,e):this.setImage(Ln(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,Hr(this,KN))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=h.clone(e,this._actualClampedPosition),Hr(this,XN)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Hr(this,Lae))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Hr(this,Fae))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Hr(this,Fae))}}});Ci.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Ci.prototype._updateClamping=function(){Ci._updateClamping(this._billboardCollection,this)};var dv=new me,Vae=new h;Ci._updateClamping=function(e,t){let n=e._scene;if(!l(n)||!l(n.globe))return;let i=n.globe,r=i.ellipsoid,o=i._surface,s=n.frameState.mode,a=s!==t._mode;if(t._mode=s,(t._heightReference===ze.NONE||a)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===ze.NONE||!l(t._position))return;let c=r.cartesianToCartographic(t._position);if(!l(c)){t._actualClampedPosition=void 0;return}l(t._removeCallbackFunc)&&t._removeCallbackFunc();function u(d){if(t._heightReference===ze.RELATIVE_TO_GROUND)if(t._mode===te.SCENE3D){let p=r.cartesianToCartographic(d,dv);p.height+=c.height,r.cartographicToCartesian(p,d)}else d.x+=c.height;t._clampedPosition=h.clone(d,t._clampedPosition)}t._removeCallbackFunc=o.updateHeight(c,u),me.clone(c,dv);let f=i.getHeight(c);l(f)&&(dv.height=f),r.cartographicToCartesian(dv,Vae),u(Vae)};Ci.prototype._loadImage=function(){let e=this._billboardCollection._textureAtlas,t=this._imageId,n=this._image,i=this._imageSubRegion,r,o=this;function s(a){if(o._imageId!==t||o._image!==n||!je.equals(o._imageSubRegion,i))return;let c=e.textureCoordinates[a];o._imageWidth=e.texture.width*c.width,o._imageHeight=e.texture.height*c.height,o._imageIndex=a,o._ready=!0,o._image=void 0,o._imageIndexPromise=void 0,Hr(o,KN)}if(l(n)){let a=e.getImageIndex(t);if(l(a)){s(a);return}r=e.addImage(t,n)}l(i)&&(r=e.addSubRegion(t,i)),this._imageIndexPromise=r,l(r)&&r.then(s).catch(function(a){console.error(`Error loading image for billboard: ${a}`),o._imageIndexPromise=void 0})};Ci.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())};Ci.prototype.setImageSubRegion=function(e,t){this._imageId===e&&je.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=je.clone(t),l(this._billboardCollection._textureAtlas)&&this._loadImage())};Ci.prototype._setTranslate=function(e){let t=this._translate;W.equals(t,e)||(W.clone(e,t),Hr(this,Uae))};Ci.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Ci.prototype._setActualPosition=function(e){l(this._clampedPosition)||h.clone(e,this._actualPosition),Hr(this,XN)};var kae=new se;Ci._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===te.SCENE3D?t:(N.multiplyByPoint(i,t,kae),rr.computeActualWgs84Position(n,kae))};var zae=new h;Ci._computeScreenSpacePosition=function(e,t,n,i,r,o){let s=N.multiplyByPoint(e,t,zae),a=rr.wgs84WithEyeOffsetToWindowCoordinates(r,s,n,o);if(!!l(a))return W.add(a,i,a),a};var YN=new W(0,0);Ci.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new W),W.clone(this._pixelOffset,YN),W.add(YN,this._translate,YN);let i=n.modelMatrix,r=this._position;if(l(this._clampedPosition)&&(r=this._clampedPosition,e.mode!==te.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(r,dv);r=a.cartographicToCartesian(c,zae),i=N.IDENTITY}return Ci._computeScreenSpacePosition(i,r,this._eyeOffset,YN,e,t)};Ci.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,r=e.height,o=e.scale;i*=o,r*=o;let s=t.x;e.horizontalOrigin===gi.RIGHT?s-=i:e.horizontalOrigin===gi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===vn.BOTTOM||e.verticalOrigin===vn.BASELINE?a-=r:e.verticalOrigin===vn.CENTER&&(a-=r*.5),l(n)||(n=new je),n.x=s,n.y=a,n.width=i,n.height=r,n};Ci.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&je.equals(this._imageSubRegion,e._imageSubRegion)&&z.equals(this._color,e._color)&&W.equals(this._pixelOffset,e._pixelOffset)&&W.equals(this._translate,e._translate)&&h.equals(this._eyeOffset,e._eyeOffset)&&St.equals(this._scaleByDistance,e._scaleByDistance)&&St.equals(this._translucencyByDistance,e._translucencyByDistance)&&St.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Tt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance};Ci.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var Tr=Ci;var P6e={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},Ir=Object.freeze(P6e);var I6e={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Xs=Object.freeze(I6e);function Rp(e,t,n,i,r){this.bottomLeft=y(e,W.ZERO),this.topRight=y(t,W.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=r}var O6e=new W(16,16);function Fg(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.borderWidthInPixels,1),n=y(e.initialSize,O6e);this._context=e.context,this._pixelFormat=y(e.pixelFormat,ct.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=Ln(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}Object.defineProperties(Fg.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return l(this._texture)||(this._texture=new wt({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}});function R6e(e,t){let n=e._context,i=e.numberOfImages,r=2,o=e._borderWidthInPixels;if(i>0){let s=e._texture.width,a=e._texture.height,c=r*(s+t.width+o),u=r*(a+t.height+o),f=s/c,d=a/u,p=new Rp(new W(s+o,o),new W(c,a)),g=new Rp(new W,new W(c,a),e._root,p),m=new Rp(new W(o,a+o),new W(c,u)),x=new Rp(new W,new W(c,u),g,m);for(let b=0;b<e._textureCoordinates.length;b++){let T=e._textureCoordinates[b];l(T)&&(T.x*=f,T.y*=d,T.width*=f,T.height*=d)}let C=new wt({context:e._context,width:c,height:u,pixelFormat:e._pixelFormat}),A=new ya({context:n,colorTextures:[e._texture],destroyAttachments:!1});A._bind(),C.copyFromFramebuffer(0,0,0,0,c,u),A._unBind(),A.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=C,e._root=x}else{let s=r*(t.width+2*o),a=r*(t.height+2*o);s<e._initialSize.x&&(s=e._initialSize.x),a<e._initialSize.y&&(a=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new wt({context:e._context,width:s,height:a,pixelFormat:e._pixelFormat}),e._root=new Rp(new W(o,o),new W(s,a))}}function $N(e,t,n){if(!!l(t)){if(!l(t.childNode1)&&!l(t.childNode2)){if(l(t.imageIndex))return;let i=t.topRight.x-t.bottomLeft.x,r=t.topRight.y-t.bottomLeft.y,o=i-n.width,s=r-n.height;if(o<0||s<0)return;if(o===0&&s===0)return t;if(o>s){t.childNode1=new Rp(new W(t.bottomLeft.x,t.bottomLeft.y),new W(t.bottomLeft.x+n.width,t.topRight.y));let a=t.bottomLeft.x+n.width+e._borderWidthInPixels;a<t.topRight.x&&(t.childNode2=new Rp(new W(a,t.bottomLeft.y),new W(t.topRight.x,t.topRight.y)))}else{t.childNode1=new Rp(new W(t.bottomLeft.x,t.bottomLeft.y),new W(t.topRight.x,t.bottomLeft.y+n.height));let a=t.bottomLeft.y+n.height+e._borderWidthInPixels;a<t.topRight.y&&(t.childNode2=new Rp(new W(t.bottomLeft.x,a),new W(t.topRight.x,t.topRight.y)))}return $N(e,t.childNode1,n)}return $N(e,t.childNode1,n)||$N(e,t.childNode2,n)}}function Hae(e,t,n){let i=$N(e,e._root,t);if(l(i)){i.imageIndex=n;let r=e._texture.width,o=e._texture.height,s=i.topRight.x-i.bottomLeft.x,a=i.topRight.y-i.bottomLeft.y,c=i.bottomLeft.x/r,u=i.bottomLeft.y/o,f=s/r,d=a/o;e._textureCoordinates[n]=new je(c,u,f,d),e._texture.copyFrom({source:t,xOffset:i.bottomLeft.x,yOffset:i.bottomLeft.y})}else R6e(e,t),Hae(e,t,n);e._guid=Ln()}function Gae(e,t){if(!l(e)||e.isDestroyed())return-1;let n=e.numberOfImages;return Hae(e,t,n),n}Fg.prototype.getImageIndex=function(e){return this._indexHash[e]};Fg.prototype.addImageSync=function(e,t){let n=this._indexHash[e];return l(n)||(n=Gae(this,t),this._idHash[e]=Promise.resolve(n),this._indexHash[e]=n),n};Fg.prototype.addImage=function(e,t){let n=this._idHash[e];if(l(n))return n;typeof t=="function"?t=t(e):(typeof t=="string"||t instanceof De)&&(t=De.createIfNeeded(t).fetchImage());let i=this;return n=Promise.resolve(t).then(function(r){let o=Gae(i,r);return i._indexHash[e]=o,o}),this._idHash[e]=n,n};Fg.prototype.addSubRegion=function(e,t){let n=this._idHash[e];if(!l(n))throw new fe(`image with id "${e}" not found in the atlas.`);let i=this;return Promise.resolve(n).then(function(r){if(r===-1)return-1;let o=i._texture.width,s=i._texture.height,a=i.numberOfImages,c=i._textureCoordinates[r],u=c.x+t.x/o,f=c.y+t.y/s,d=t.width/o,p=t.height/s;return i._textureCoordinates.push(new je(u,f,d,p)),i._guid=Ln(),a})};Fg.prototype.isDestroyed=function(){return!1};Fg.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var gx=Fg;var M6e=Tr.SHOW_INDEX,mv=Tr.POSITION_INDEX,Wae=Tr.PIXEL_OFFSET_INDEX,jae=Tr.EYE_OFFSET_INDEX,B6e=Tr.HORIZONTAL_ORIGIN_INDEX,L6e=Tr.VERTICAL_ORIGIN_INDEX,N6e=Tr.SCALE_INDEX,hv=Tr.IMAGE_INDEX_INDEX,qae=Tr.COLOR_INDEX,F6e=Tr.ROTATION_INDEX,V6e=Tr.ALIGNED_AXIS_INDEX,Yae=Tr.SCALE_BY_DISTANCE_INDEX,Xae=Tr.TRANSLUCENCY_BY_DISTANCE_INDEX,Kae=Tr.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,$ae=Tr.DISTANCE_DISPLAY_CONDITION,k6e=Tr.DISABLE_DEPTH_DISTANCE,U6e=Tr.TEXTURE_COORDINATE_BOUNDS,Zae=Tr.SDF_INDEX,N9=Tr.NUMBER_OF_PROPERTIES,br,z6e={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,compressedAttribute3:8,textureCoordinateBoundsOrLabelTranslate:9,a_batchId:10,sdf:11},H6e={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12};function lf(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(N9),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new re,this._baseVolumeWC=new re,this._baseVolume2D=new re,this._boundingVolume=new re,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this._modelMatrix=N.clone(N.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=y(e.debugShowTextureAtlas,!1),this.blendOption=y(e.blendOption,Ir.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=te.SCENE3D,this._buffersUsage=[Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW],this._highlightColor=z.clone(z.WHITE);let t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.texture},u_highlightColor:function(){return t._highlightColor}};let n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,r=i.length;for(let o=0;o<r;++o)l(i[o])&&i[o]._updateClamping()},this))}Object.defineProperties(lf.prototype,{length:{get:function(){return F9(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}});function Jae(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}lf.prototype.add=function(e){let t=new Tr(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};lf.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};lf.prototype.removeAll=function(){Jae(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function F9(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];l(s)&&(s._index=o++,t.push(s))}e._billboards=t}}lf.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};lf.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};lf.prototype.get=function(e){return F9(this),this._billboards[e]};var I9;function G6e(e){let n=e.cache.billboardCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,r=new Uint16Array(i);for(let o=0,s=0;o<i;o+=6,s+=4)r[o]=s,r[o+1]=s+1,r[o+2]=s+2,r[o+3]=s+0,r[o+4]=s+2,r[o+5]=s+3;return n=at.createIndexBuffer({context:e,typedArray:r,usage:Ne.STATIC_DRAW,indexDatatype:Le.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function W6e(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=at.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ne.STATIC_DRAW,indexDatatype:Le.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function j6e(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=at.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Ne.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}lf.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<N9;++i){let r=n[i]===0?Ne.STATIC_DRAW:Ne.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function q6e(e,t,n,i,r,o){let s=[{index:br.positionHighAndScale,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[mv]},{index:br.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[mv]},{index:br.compressedAttribute0,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[Wae]},{index:br.compressedAttribute1,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[Xae]},{index:br.compressedAttribute2,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[qae]},{index:br.eyeOffset,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[jae]},{index:br.scaleByDistance,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[Yae]},{index:br.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[Kae]},{index:br.compressedAttribute3,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[$ae]},{index:br.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[U6e]}];i&&s.push({index:br.direction,componentsPerAttribute:2,componentDatatype:K.FLOAT,vertexBuffer:j6e(e)}),l(r)&&s.push({index:br.a_batchId,componentsPerAttribute:1,componentDatatype:K.FLOAT,bufferUsage:Ne.STATIC_DRAW}),o&&s.push({index:br.sdf,componentsPerAttribute:2,componentDatatype:K.FLOAT,usage:n[Zae]});let a=i?t:4*t;return new Ng(e,s,a,i)}var O9=new zn;function Qae(e,t,n,i,r){let o,s=i[br.positionHighAndScale],a=i[br.positionLowAndRotation],c=r._getActualPosition();e._mode===te.SCENE3D&&(re.expand(e._baseVolume,c,e._baseVolume),e._boundingVolumeDirty=!0),zn.fromCartesian(c,O9);let u=r.scale,f=r.rotation;f!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,u);let d=O9.high,p=O9.low;e._instanced?(o=r._index,s(o,d.x,d.y,d.z,u),a(o,p.x,p.y,p.z,f)):(o=r._index*4,s(o+0,d.x,d.y,d.z,u),s(o+1,d.x,d.y,d.z,u),s(o+2,d.x,d.y,d.z,u),s(o+3,d.x,d.y,d.z,u),a(o+0,p.x,p.y,p.z,f),a(o+1,p.x,p.y,p.z,f),a(o+2,p.x,p.y,p.z,f),a(o+3,p.x,p.y,p.z,f))}var cf=new W,af=32768,cb=65536,R9=4096,Qh=256,Y6e=128,X6e=32,K6e=8,ece=4,$6e=1/256,tce=0,nce=2,ice=3,rce=1;function oce(e,t,n,i,r){let o,s=i[br.compressedAttribute0],a=r.pixelOffset,c=a.x,u=a.y,f=r._translate,d=f.x,p=f.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(c+d),Math.abs(-u+p));let g=r.horizontalOrigin,m=r._verticalOrigin,x=r.show&&r.clusterShow;r.color.alpha===0&&(x=!1),m===vn.BASELINE&&(m=vn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&g===gi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&m===vn.CENTER;let C=0,A=0,b=0,T=0,S=r._imageIndex;if(S!==-1){let U=n[S];C=U.x,A=U.y,b=U.width,T=U.height}let w=C+b,D=A+T,I=Math.floor(M.clamp(c,-af,af)+af)*Y6e;I+=(g+1)*X6e,I+=(m+1)*K6e,I+=(x?1:0)*ece;let O=Math.floor(M.clamp(u,-af,af)+af)*Qh,B=Math.floor(M.clamp(d,-af,af)+af)*Qh,L=(M.clamp(p,-af,af)+af)*$6e,_=Math.floor(L),E=Math.floor((L-_)*Qh);O+=_,B+=E,cf.x=C,cf.y=A;let v=In.compressTextureCoordinates(cf);cf.x=w;let P=In.compressTextureCoordinates(cf);cf.y=D;let R=In.compressTextureCoordinates(cf);cf.x=C;let F=In.compressTextureCoordinates(cf);e._instanced?(o=r._index,s(o,I,O,B,v)):(o=r._index*4,s(o+0,I+tce,O,B,v),s(o+1,I+nce,O,B,P),s(o+2,I+ice,O,B,R),s(o+3,I+rce,O,B,F))}function sce(e,t,n,i,r){let o,s=i[br.compressedAttribute1],a=r.alignedAxis;h.equals(a,h.ZERO)||(e._shaderAlignedAxis=!0);let c=0,u=1,f=1,d=1,p=r.translucencyByDistance;l(p)&&(c=p.near,u=p.nearValue,f=p.far,d=p.farValue,(u!==1||d!==1)&&(e._shaderTranslucencyByDistance=!0));let g=0,m=r._imageIndex;m!==-1&&(g=n[m].width);let x=e._textureAtlas.texture.width,C=Math.round(y(r.width,x*g));e._maxSize=Math.max(e._maxSize,C);let A=M.clamp(C,0,cb),b=0;Math.abs(h.magnitudeSquared(a)-1)<M.EPSILON6&&(b=In.octEncodeFloat(a)),u=M.clamp(u,0,1),u=u===1?255:u*255|0,A=A*Qh+u,d=M.clamp(d,0,1),d=d===1?255:d*255|0,b=b*Qh+d,e._instanced?(o=r._index,s(o,A,b,c,f)):(o=r._index*4,s(o+0,A,b,c,f),s(o+1,A,b,c,f),s(o+2,A,b,c,f),s(o+3,A,b,c,f))}function B9(e,t,n,i,r){let o,s=i[br.compressedAttribute2],a=r.color,c=l(e._batchTable)?z.WHITE:r.getPickId(t.context).color,u=r.sizeInMeters?1:0,f=Math.abs(h.magnitudeSquared(r.alignedAxis)-1)<M.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&u===1;let d=0,p=r._imageIndex;p!==-1&&(d=n[p].height);let g=e._textureAtlas.texture.dimensions,m=Math.round(y(r.height,g.y*d));e._maxSize=Math.max(e._maxSize,m);let x=y(r._labelHorizontalOrigin,-2);x+=2;let C=m*ece+x,A=z.floatToByte(a.red),b=z.floatToByte(a.green),T=z.floatToByte(a.blue),S=A*cb+b*Qh+T;A=z.floatToByte(c.red),b=z.floatToByte(c.green),T=z.floatToByte(c.blue);let w=A*cb+b*Qh+T,D=z.floatToByte(a.alpha)*cb+z.floatToByte(c.alpha)*Qh;D+=u*2+f,e._instanced?(o=r._index,s(o,S,w,D,C)):(o=r._index*4,s(o+0,S,w,D,C),s(o+1,S,w,D,C),s(o+2,S,w,D,C),s(o+3,S,w,D,C))}function L9(e,t,n,i,r){let o,s=i[br.eyeOffset],a=r.eyeOffset,c=a.z;if(r._heightReference!==ze.NONE&&(c*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(a.x),Math.abs(a.y),Math.abs(c)),e._instanced){let u=0,f=0,d=r._imageIndex;if(d!==-1){let g=n[d];u=g.width,f=g.height}cf.x=u,cf.y=f;let p=In.compressTextureCoordinates(cf);o=r._index,s(o,a.x,a.y,c,p)}else o=r._index*4,s(o+0,a.x,a.y,c,0),s(o+1,a.x,a.y,c,0),s(o+2,a.x,a.y,c,0),s(o+3,a.x,a.y,c,0)}function ace(e,t,n,i,r){let o,s=i[br.scaleByDistance],a=0,c=1,u=1,f=1,d=r.scaleByDistance;l(d)&&(a=d.near,c=d.nearValue,u=d.far,f=d.farValue,(c!==1||f!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(o=r._index,s(o,a,c,u,f)):(o=r._index*4,s(o+0,a,c,u,f),s(o+1,a,c,u,f),s(o+2,a,c,u,f),s(o+3,a,c,u,f))}function cce(e,t,n,i,r){let o,s=i[br.pixelOffsetScaleByDistance],a=0,c=1,u=1,f=1,d=r.pixelOffsetScaleByDistance;l(d)&&(a=d.near,c=d.nearValue,u=d.far,f=d.farValue,(c!==1||f!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=r._index,s(o,a,c,u,f)):(o=r._index*4,s(o+0,a,c,u,f),s(o+1,a,c,u,f),s(o+2,a,c,u,f),s(o+3,a,c,u,f))}function lce(e,t,n,i,r){let o,s=i[br.compressedAttribute3],a=0,c=Number.MAX_VALUE,u=r.distanceDisplayCondition;l(u)&&(a=u.near,c=u.far,a*=a,c*=c,e._shaderDistanceDisplayCondition=!0);let f=r.disableDepthTestDistance,d=r.heightReference===ze.CLAMP_TO_GROUND&&t.context.depthTexture;l(f)||(f=d?5e3:0),f*=f,(d||f>0)&&(e._shaderDisableDepthDistance=!0,f===Number.POSITIVE_INFINITY&&(f=-1));let p,g;if(l(r._labelDimensions))g=r._labelDimensions.x,p=r._labelDimensions.y;else{let A=0,b=0,T=r._imageIndex;if(T!==-1){let w=n[T];A=w.height,b=w.width}p=Math.round(y(r.height,e._textureAtlas.texture.dimensions.y*A));let S=e._textureAtlas.texture.width;g=Math.round(y(r.width,S*b))}let m=Math.floor(M.clamp(g,0,R9)),x=Math.floor(M.clamp(p,0,R9)),C=m*R9+x;e._instanced?(o=r._index,s(o,a,c,f,C)):(o=r._index*4,s(o+0,a,c,f,C),s(o+1,a,c,f,C),s(o+2,a,c,f,C),s(o+3,a,c,f,C))}function uce(e,t,n,i,r){if(r.heightReference===ze.CLAMP_TO_GROUND){let m=e._scene,x=t.context,C=t.globeTranslucencyState.translucent,A=l(m.globe)&&m.globe.depthTestAgainstTerrain;e._shaderClampToGround=x.depthTexture&&!C&&A}let o,s=i[br.textureCoordinateBoundsOrLabelTranslate];if(Bt.maximumVertexTextureImageUnits>0){let m=0,x=0;l(r._labelTranslate)&&(m=r._labelTranslate.x,x=r._labelTranslate.y),e._instanced?(o=r._index,s(o,m,x,0,0)):(o=r._index*4,s(o+0,m,x,0,0),s(o+1,m,x,0,0),s(o+2,m,x,0,0),s(o+3,m,x,0,0));return}let a=0,c=0,u=0,f=0,d=r._imageIndex;if(d!==-1){let m=n[d];a=m.x,c=m.y,u=m.width,f=m.height}let p=a+u,g=c+f;e._instanced?(o=r._index,s(o,a,c,p,g)):(o=r._index*4,s(o+0,a,c,p,g),s(o+1,a,c,p,g),s(o+2,a,c,p,g),s(o+3,a,c,p,g))}function Z6e(e,t,n,i,r){if(!l(e._batchTable))return;let o=i[br.a_batchId],s=r._batchIndex,a;e._instanced?(a=r._index,o(a,s)):(a=r._index*4,o(a+0,s),o(a+1,s),o(a+2,s),o(a+3,s))}function fce(e,t,n,i,r){if(!e._sdf)return;let o,s=i[br.sdf],a=r.outlineColor,c=r.outlineWidth,u=z.floatToByte(a.red),f=z.floatToByte(a.green),d=z.floatToByte(a.blue),p=u*cb+f*Qh+d,g=c/Xs.RADIUS,m=z.floatToByte(a.alpha)*cb+z.floatToByte(g)*Qh;e._instanced?(o=r._index,s(o,p,m)):(o=r._index*4,s(o+0,p+tce,m),s(o+1,p+nce,m),s(o+2,p+ice,m),s(o+3,p+rce,m))}function J6e(e,t,n,i,r){Qae(e,t,n,i,r),oce(e,t,n,i,r),sce(e,t,n,i,r),B9(e,t,n,i,r),L9(e,t,n,i,r),ace(e,t,n,i,r),cce(e,t,n,i,r),lce(e,t,n,i,r),uce(e,t,n,i,r),Z6e(e,t,n,i,r),fce(e,t,n,i,r)}function M9(e,t,n,i,r,o){let s;i.mode===te.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=Tr._computeActualPosition(u,f,i,r);l(d)&&(u._setActualPosition(d),o?a.push(d):re.expand(s,d,s))}o&&re.fromPoints(a,s)}function Q6e(e,t){let n=t.mode,i=e._billboards,r=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==te.SCENE3D&&!N.equals(o,e.modelMatrix)?(e._mode=n,N.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===te.SCENE3D||n===te.SCENE2D||n===te.COLUMBUS_VIEW)&&M9(e,i,i.length,t,o,!0)):n===te.MORPHING?M9(e,i,i.length,t,o,!0):(n===te.SCENE2D||n===te.COLUMBUS_VIEW)&&M9(e,r,e._billboardsToUpdateIndex,t,o,!1)}function e9e(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let r=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(r*=.5);let o=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=r+o}function t9e(e,t){let n=`uniform sampler2D billboard_texture;
- varying vec2 v_textureCoordinates;
- void main()
- {
- gl_FragColor = texture2D(billboard_texture, v_textureCoordinates);
- }
- `,i=t.createViewportQuadCommand(n,{uniformMap:{billboard_texture:function(){return e._textureAtlas.texture}}});return i.pass=Ce.OVERLAY,i}var n9e=[];lf.prototype.update=function(e){if(F9(this),!this.show)return;let t=this._billboards,n=t.length,i=e.context;this._instanced=i.instancedArrays,br=this._instanced?H6e:z6e,I9=this._instanced?W6e:G6e;let r=this._textureAtlas;if(!l(r)){r=this._textureAtlas=new gx({context:i});for(let O=0;O<n;++O)t[O]._loadImage()}let o=r.textureCoordinates;if(o.length===0)return;Q6e(this,e),t=this._billboards,n=t.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=r.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let d,p=e.passes,g=p.pick;if(f||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let O=0;O<N9;++O)c[O]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=q6e(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),d=this._vaf.writers;for(let O=0;O<n;++O){let B=this._billboards[O];B._dirty=!1,J6e(this,e,o,d,B)}this._vaf.commit(I9(i))}this._billboardsToUpdateIndex=0}else if(a>0){let O=n9e;O.length=0,(c[mv]||c[F6e]||c[N6e])&&O.push(Qae),(c[hv]||c[Wae]||c[B6e]||c[L6e]||c[M6e])&&(O.push(oce),this._instanced&&O.push(L9)),(c[hv]||c[V6e]||c[Xae])&&(O.push(sce),O.push(B9)),(c[hv]||c[qae])&&O.push(B9),c[jae]&&O.push(L9),c[Yae]&&O.push(ace),c[Kae]&&O.push(cce),(c[$ae]||c[k6e]||c[hv]||c[mv])&&O.push(lce),(c[hv]||c[mv])&&O.push(uce),c[Zae]&&O.push(fce);let B=O.length;if(d=this._vaf.writers,a/n>.1){for(let L=0;L<a;++L){let _=s[L];_._dirty=!1;for(let E=0;E<B;++E)O[E](this,e,o,d,_)}this._vaf.commit(I9(i))}else{for(let L=0;L<a;++L){let _=s[L];_._dirty=!1;for(let E=0;E<B;++E)O[E](this,e,o,d,_);this._instanced?this._vaf.subCommit(_._index,1):this._vaf.subCommit(_._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>n*1.5&&(s.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,re.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,x=N.IDENTITY;e.mode===te.SCENE3D?(x=this.modelMatrix,m=re.clone(this._baseVolumeWC,this._boundingVolume)):m=re.clone(this._baseVolume2D,this._boundingVolume),e9e(this,e,m);let C=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,C){this._blendOption===Ir.OPAQUE||this._blendOption===Ir.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:Z.LESS},depthMask:!0}):this._rsOpaque=void 0;let O=this._blendOption===Ir.TRANSLUCENT;this._blendOption===Ir.TRANSLUCENT||this._blendOption===Ir.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:O?Z.LEQUAL:Z.LESS},depthMask:O,blending:hn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let A,b,T,S,w,D=Bt.maximumVertexTextureImageUnits>0;if(C||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){A=qN,b=jN,w=[],l(this._batchTable)&&(w.push("VECTOR_TILE"),A=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(A),b=this._batchTable.getFragmentShaderCallback(!1,void 0)(b)),T=new Fe({defines:w,sources:[A]}),this._instanced&&T.defines.push("INSTANCED"),this._shaderRotation&&T.defines.push("ROTATION"),this._shaderAlignedAxis&&T.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&T.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&T.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&T.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&T.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&T.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(D?T.defines.push("VERTEX_DEPTH_CHECK"):T.defines.push("FRAGMENT_DEPTH_CHECK"));let O=1-Xs.CUTOFF;this._sdf&&T.defines.push("SDF");let B=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Ir.OPAQUE_AND_TRANSLUCENT&&(S=new Fe({defines:["OPAQUE",B],sources:[b]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${O}`)),this._sp=Wt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:S,attributeLocations:br}),S=new Fe({defines:["TRANSLUCENT",B],sources:[b]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${O}`)),this._spTranslucent=Wt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:S,attributeLocations:br})),this._blendOption===Ir.OPAQUE&&(S=new Fe({defines:[B],sources:[b]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${O}`)),this._sp=Wt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:S,attributeLocations:br})),this._blendOption===Ir.TRANSLUCENT&&(S=new Fe({defines:[B],sources:[b]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${O}`)),this._spTranslucent=Wt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:S,attributeLocations:br})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let I=e.commandList;if(p.render||p.pick){let O=this._colorCommands,B=this._blendOption===Ir.OPAQUE,L=this._blendOption===Ir.OPAQUE_AND_TRANSLUCENT,_=this._vaf.va,E=_.length,v=this._uniforms,P;l(this._batchTable)?(v=this._batchTable.getUniformMapCallback()(v),P=this._batchTable.getPickId()):P="v_pickColor",O.length=E;let R=L?E*2:E;for(let F=0;F<R;++F){let U=O[F];l(U)||(U=O[F]=new Ze);let k=B||L&&F%2===0;U.pass=k||!L?Ce.OPAQUE:Ce.TRANSLUCENT,U.owner=this;let H=L?Math.floor(F/2):F;U.boundingVolume=m,U.modelMatrix=x,U.count=_[H].indicesCount,U.shaderProgram=k?this._sp:this._spTranslucent,U.uniformMap=v,U.vertexArray=_[H].va,U.renderState=k?this._rsOpaque:this._rsTranslucent,U.debugShowBoundingVolume=this.debugShowBoundingVolume,U.pickId=P,this._instanced&&(U.count=6,U.instanceCount=n),I.push(U)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=t9e(this,e.context)),I.push(this.debugCommand))}};lf.prototype.isDestroyed=function(){return!1};lf.prototype.destroy=function(){return l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),Jae(this._billboards),ue(this)};var uf=lf;function i9e(e,t,n,i,r){return function(){let o=document.createElement("canvas"),s=r+2*i;o.height=o.width=s;let a=o.getContext("2d");return a.clearRect(0,0,s,s),i!==0&&(a.beginPath(),a.arc(s/2,s/2,s/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=n,a.fill(),e<1&&(a.save(),a.globalCompositeOperation="destination-out",a.beginPath(),a.arc(s/2,s/2,r/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,r/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),o}}var lb=i9e;function Is(e,t,n,i,r){this._content=e,this._billboard=n,this._label=i,this._polyline=r,this._batchId=t,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),ub(this)}var r9e=new me;Object.defineProperties(Is.prototype,{show:{get:function(){return this._label.show},set:function(e){this._label.show=e,this._billboard.show=e,this._polyline.show=e}},color:{get:function(){return this._color},set:function(e){this._color=z.clone(e,this._color),ub(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,ub(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=z.clone(e,this._pointOutlineColor),ub(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,ub(this)}},labelColor:{get:function(){return this._label.fillColor},set:function(e){this._label.fillColor=e,this._polyline.show=this._label.show&&e.alpha>0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){l(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){let t=y(this._heightOffset,0),n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,r9e);i.height=i.height-t+e;let r=n.cartographicToCartesian(i);this._billboard.position=r,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],r],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=z.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&ub(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}});Is.defaultColor=z.WHITE;Is.defaultPointOutlineColor=z.BLACK;Is.defaultPointOutlineWidth=0;Is.defaultPointSize=8;function ub(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=y(e._color,Is.defaultColor),i=y(e._pointOutlineColor,Is.defaultPointOutlineColor),r=y(e._pointOutlineWidth,Is.defaultPointOutlineWidth),o=y(e._pointSize,Is.defaultPointSize),s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(z.equals(n,s)&&z.equals(i,a)&&r===c&&o===u)return;e._billboardColor=z.clone(n,e._billboardColor),e._billboardOutlineColor=z.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=r,e._billboardSize=o;let f=n.alpha,d=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([d,o,p,r]);t.setImage(g,lb(f,d,p,r,o))}Is.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Is.prototype.getPropertyNames=function(e){return di("Cesium3DTilePointFeature.getPropertyNames","Cesium3DTilePointFeature.getPropertyNames is deprecated in CesiumJS 1.95, and will be removed in 1.98. Use Cesium3DTilePointFeature.getPropertyIds instead"),this._content.batchTable.getPropertyIds(this._batchId,e)};Is.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Is.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Is.prototype.getPropertyInherited=function(e){return bo.getPropertyInherited(this._content,this._batchId,e)};Is.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Is.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Is.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Is.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Vg=Is;var _v=Ns(gce(),1);var c9e={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},$r=Object.freeze(c9e);var yce={},xce=0,l9e=256,u9e=new z(.165,.165,.165,.8),f9e=new W(7,5),ls=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function yx(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function gv(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function yv(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Ace(e){let t=yce[e._font];if(!l(t)){let n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(yv(n,"line-height"));isNaN(i)&&(i=void 0),t={family:yv(n,"font-family"),size:yv(n,"font-size").replace("px",""),style:yv(n,"font-style"),weight:yv(n,"font-weight"),lineHeight:i},document.body.removeChild(n),xce<l9e&&(yce[e._font]=t,xce++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function Mp(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=St.clone(n)),l(i)&&(i=St.clone(i)),l(r)&&(r=St.clone(r)),l(o)&&(o=Tt.clone(o)),this._renderedText=void 0,this._text=void 0,this._show=y(e.show,!0),this._font=y(e.font,"30px sans-serif"),this._fillColor=z.clone(y(e.fillColor,z.WHITE)),this._outlineColor=z.clone(y(e.outlineColor,z.BLACK)),this._outlineWidth=y(e.outlineWidth,1),this._showBackground=y(e.showBackground,!1),this._backgroundColor=z.clone(y(e.backgroundColor,u9e)),this._backgroundPadding=W.clone(y(e.backgroundPadding,f9e)),this._style=y(e.style,$r.FILL),this._verticalOrigin=y(e.verticalOrigin,vn.BASELINE),this._horizontalOrigin=y(e.horizontalOrigin,gi.LEFT),this._pixelOffset=W.clone(y(e.pixelOffset,W.ZERO)),this._eyeOffset=h.clone(y(e.eyeOffset,h.ZERO)),this._position=h.clone(y(e.position,h.ZERO)),this._scale=y(e.scale,1),this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=r,this._heightReference=y(e.heightReference,ze.NONE),this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=y(e.text,""),this._relativeSize=1,Ace(this),this._updateClamping()}Object.defineProperties(Mp.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i].billboard;l(o)&&(o.show=e)}let n=this._backgroundBillboard;l(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){let t=this._position;if(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r].billboard;l(s)&&(s.position=e)}let i=this._backgroundBillboard;l(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i].billboard;l(o)&&(o.heightReference=e)}let n=this._backgroundBillboard;l(n)&&(n.heightReference=e),gv(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=e.replace(/\u00ad/g,"");this._renderedText=Mp.enableRightToLeftDetection?g9e(t):t,yx(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,yx(this),Ace(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;z.equals(t,e)||(z.clone(e,t),yx(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),yx(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,yx(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,yx(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!z.equals(t,e)){z.clone(e,t);let n=this._backgroundBillboard;l(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){let t=this._backgroundPadding;W.equals(t,e)||(W.clone(e,t),gv(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,yx(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!W.equals(t,e)){W.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;if(!St.equals(t,e)){this._translucencyByDistance=St.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;if(!St.equals(t,e)){this._pixelOffsetScaleByDistance=St.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;if(!St.equals(t,e)){this._scaleByDistance=St.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;if(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,gv(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),gv(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),gv(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Tt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Tt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.id=e)}let n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=h.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard._clampedPosition=e)}let n=this._backgroundBillboard;l(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.clusterShow=e)}let n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}}});Mp.prototype._updateClamping=function(){Tr._updateClamping(this._labelCollection,this)};Mp.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new W);let i=this._labelCollection.modelMatrix,r=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return Tr._computeScreenSpacePosition(i,r,this._eyeOffset,this._pixelOffset,e,t)};Mp.getScreenSpaceBoundingBox=function(e,t,n){let i=0,r=0,o=0,s=0,a=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,r=t.y-c._translate.y,o=c.width*a,s=c.height*a,e.verticalOrigin===vn.BOTTOM||e.verticalOrigin===vn.BASELINE?r-=s:e.verticalOrigin===vn.CENTER&&(r-=s*.5);else{i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;let u=0,f=0,d=e._glyphs,p=d.length;for(let g=0;g<p;++g){let m=d[g],x=m.billboard;if(!l(x))continue;let C=t.x+x._translate.x,A=t.y-x._translate.y,b=m.dimensions.width*a,T=m.dimensions.height*a;e.verticalOrigin===vn.BOTTOM||e.verticalOrigin===vn.BASELINE?A-=T:e.verticalOrigin===vn.CENTER&&(A-=T*.5),e._verticalOrigin===vn.TOP?A+=Xs.PADDING*a:(e._verticalOrigin===vn.BOTTOM||e._verticalOrigin===vn.BASELINE)&&(A-=Xs.PADDING*a),i=Math.min(i,C),r=Math.min(r,A),u=Math.max(u,C+b),f=Math.max(f,A+T)}o=u-i,s=f-r}return l(n)||(n=new je),n.x=i,n.y=r,n.width=o,n.height=s,n};Mp.prototype.equals=function(e){return this===e||l(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&h.equals(this._position,e._position)&&z.equals(this._fillColor,e._fillColor)&&z.equals(this._outlineColor,e._outlineColor)&&z.equals(this._backgroundColor,e._backgroundColor)&&W.equals(this._backgroundPadding,e._backgroundPadding)&&W.equals(this._pixelOffset,e._pixelOffset)&&h.equals(this._eyeOffset,e._eyeOffset)&&St.equals(this._translucencyByDistance,e._translucencyByDistance)&&St.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&St.equals(this._scaleByDistance,e._scaleByDistance)&&Tt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};Mp.prototype.isDestroyed=function(){return!1};Mp.enableRightToLeftDetection=!1;function d9e(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,r=[],o="",s=ls.LTR,a="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?a=ls.RTL:n.test(f)?a=ls.LTR:i.test(f)?a=ls.BRACKETS:a=ls.WEAK,u===0&&(s=a),s===a&&a!==ls.BRACKETS?o+=f:(o!==""&&r.push({Type:s,Word:o}),s=a,o=f)}return r.push({Type:a,Word:o}),r}function h9e(e){return e.split("").reverse().join("")}function xv(e,t,n){return e.slice(0,t)+n+e.slice(t)}function m9e(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var p9e="\u05D0-\u05EA",_9e="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Cce=new RegExp(`[${p9e}${_9e}]`);function g9e(e){let t=e.split(`
- `),n="";for(let i=0;i<t.length;i++){let r=t[i],o=Cce.test(r.charAt(0)),s=d9e(r,Cce),a=0,c="";for(let u=0;u<s.length;++u){let f=s[u],d=f.Type===ls.BRACKETS?m9e(f.Word):h9e(f.Word);o?f.Type===ls.RTL?(c=d+c,a=0):f.Type===ls.LTR?(c=xv(c,a,f.Word),a+=f.Word.length):(f.Type===ls.WEAK||f.Type===ls.BRACKETS)&&(f.Type===ls.WEAK&&s[u-1].Type===ls.BRACKETS?c=d+c:s[u-1].Type===ls.RTL?(c=d+c,a=0):s.length>u+1?s[u+1].Type===ls.RTL?(c=d+c,a=0):(c=xv(c,a,f.Word),a+=f.Word.length):c=xv(c,0,d)):f.Type===ls.RTL?c=xv(c,a,d):f.Type===ls.LTR?(c+=f.Word,a=c.length):(f.Type===ls.WEAK||f.Type===ls.BRACKETS)&&(u>0&&s[u-1].Type===ls.RTL?s.length>u+1?s[u+1].Type===ls.RTL?c=xv(c,a,d):(c+=f.Word,a=c.length):c+=f.Word:(c+=f.Word,a=c.length))}n+=c,i<t.length-1&&(n+=`
- `)}return n}var xx=Mp;var Cv=Ns(Tce(),1);function x9e(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function C9e(e,t,n){this.labelCollection=e,this.index=t,this.dimensions=n}var A9e=1.2,Ece="ID_WHITE_PIXEL",V9=new W(4,4),T9e=new je(1,1,1,1);function b9e(e){let t=document.createElement("canvas");t.width=V9.x,t.height=V9.y;let n=t.getContext("2d");n.fillStyle="#fff",n.fillRect(0,0,t.width,t.height),e.addImage(Ece,t)}var ff={};function E9e(e,t,n,i,r,o,s){return ff.font=t,ff.fillColor=n,ff.strokeColor=i,ff.strokeWidth=r,ff.padding=Xs.PADDING,s===vn.CENTER?ff.textBaseline="middle":s===vn.TOP?ff.textBaseline="top":ff.textBaseline="bottom",ff.fill=o===$r.FILL||o===$r.FILL_AND_OUTLINE,ff.stroke=o===$r.OUTLINE||o===$r.FILL_AND_OUTLINE,ff.backgroundColor=z.BLACK,$A(e,ff)}function k9(e,t){t.textureInfo=void 0,t.dimensions=void 0;let n=t.billboard;l(n)&&(n.show=!1,n.image=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}function S9e(e,t,n,i){i.index=e.addImageSync(t,n)}var w9e=new Cv.default;function v9e(e,t){let n=t._renderedText,i=w9e.splitGraphemes(n),r=i.length,o=t._glyphs,s=o.length,a,c,u;if(t._relativeSize=t._fontSize/Xs.FONT_SIZE,r<s)for(c=r;c<s;++c)k9(e,o[c]);o.length=r;let f=t._showBackground&&n.split(`
- `).join("").length>0,d=t._backgroundBillboard,p=e._backgroundBillboardCollection;f?(l(d)||(d=p.add({collection:e,image:Ece,imageSubRegion:T9e}),t._backgroundBillboard=d),d.color=t._backgroundColor,d.show=t._show,d.position=t._position,d.eyeOffset=t._eyeOffset,d.pixelOffset=t._pixelOffset,d.horizontalOrigin=gi.LEFT,d.verticalOrigin=t._verticalOrigin,d.heightReference=t._heightReference,d.scale=t.totalScale,d.pickPrimitive=t,d.id=t._id,d.translucencyByDistance=t._translucencyByDistance,d.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,d.scaleByDistance=t._scaleByDistance,d.distanceDisplayCondition=t._distanceDisplayCondition,d.disableDepthTestDistance=t._disableDepthTestDistance):l(d)&&(p.remove(d),t._backgroundBillboard=d=void 0);let g=e._glyphTextureCache;for(u=0;u<r;++u){let m=i[u],x=t._verticalOrigin,C=JSON.stringify([m,t._fontFamily,t._fontStyle,t._fontWeight,+x]),A=g[C];if(!l(A)){let b=`${t._fontStyle} ${t._fontWeight} ${Xs.FONT_SIZE}px ${t._fontFamily}`,T=E9e(m,b,z.WHITE,z.WHITE,0,$r.FILL,x);if(A=new C9e(e,-1,T.dimensions),g[C]=A,T.width>0&&T.height>0){let S=(0,_v.default)(T,{cutoff:Xs.CUTOFF,radius:Xs.RADIUS}),w=T.getContext("2d"),D=T.width,I=T.height,O=w.getImageData(0,0,D,I);for(let B=0;B<D;B++)for(let L=0;L<I;L++){let _=L*D+B,E=S[_]*255,v=_*4;O.data[v+0]=E,O.data[v+1]=E,O.data[v+2]=E,O.data[v+3]=E}w.putImageData(O,0,0),m!==" "&&S9e(e._textureAtlas,C,T,A)}}if(a=o[u],l(a)?A.index===-1?k9(e,a):l(a.textureInfo)&&(a.textureInfo=void 0):(a=new x9e,o[u]=a),a.textureInfo=A,a.dimensions=A.dimensions,A.index!==-1){let b=a.billboard,T=e._spareBillboards;l(b)||(T.length>0?b=T.pop():(b=e._billboardCollection.add({collection:e}),b._labelDimensions=new W,b._labelTranslate=new W),a.billboard=b),b.show=t._show,b.position=t._position,b.eyeOffset=t._eyeOffset,b.pixelOffset=t._pixelOffset,b.horizontalOrigin=gi.LEFT,b.verticalOrigin=t._verticalOrigin,b.heightReference=t._heightReference,b.scale=t.totalScale,b.pickPrimitive=t,b.id=t._id,b.image=C,b.translucencyByDistance=t._translucencyByDistance,b.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,b.scaleByDistance=t._scaleByDistance,b.distanceDisplayCondition=t._distanceDisplayCondition,b.disableDepthTestDistance=t._disableDepthTestDistance,b._batchIndex=t._batchIndex,b.outlineColor=t.outlineColor,t.style===$r.FILL_AND_OUTLINE?(b.color=t._fillColor,b.outlineWidth=t.outlineWidth):t.style===$r.FILL?(b.color=t._fillColor,b.outlineWidth=0):t.style===$r.OUTLINE&&(b.color=z.TRANSPARENT,b.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function bce(e,t,n){return t===gi.CENTER?-e/2:t===gi.RIGHT?-(e+n.x):n.x}var fo=new W,D9e=new W;function P9e(e){let t=e._glyphs,n=e._renderedText,i,r,o=0,s=0,a=[],c=Number.NEGATIVE_INFINITY,u=0,f=1,d,p=t.length,g=e._backgroundBillboard,m=W.clone(l(g)?e._backgroundPadding:W.ZERO,D9e);for(m.x/=e._relativeSize,m.y/=e._relativeSize,d=0;d<p;++d)n.charAt(d)===`
- `?(a.push(o),++f,o=0):(i=t[d],r=i.dimensions,u=Math.max(u,r.height-r.descent),c=Math.max(c,r.descent),o+=r.width-r.minx,d<p-1&&(o+=t[d+1].dimensions.minx),s=Math.max(s,o));a.push(o);let x=u+c,C=e.totalScale,A=e._horizontalOrigin,b=e._verticalOrigin,T=0,S=a[T],w=bce(S,A,m),D=(l(e._lineHeight)?e._lineHeight:A9e*e._fontSize)/e._relativeSize,I=D*(f-1),O=s,B=x+I;l(g)&&(O+=m.x*2,B+=m.y*2,g._labelHorizontalOrigin=A),fo.x=w*C,fo.y=0;let L=!0,_=0;for(d=0;d<p;++d)if(n.charAt(d)===`
- `)++T,_+=D,S=a[T],w=bce(S,A,m),fo.x=w*C,L=!0;else if(i=t[d],r=i.dimensions,b===vn.TOP?(fo.y=r.height-u-m.y,fo.y+=Xs.PADDING):b===vn.CENTER?fo.y=(I+r.height-u)/2:b===vn.BASELINE?(fo.y=I,fo.y-=Xs.PADDING):(fo.y=I+c+m.y,fo.y-=Xs.PADDING),fo.y=(fo.y-r.descent-_)*C,L&&(fo.x-=Xs.PADDING*C,L=!1),l(i.billboard)&&(i.billboard._setTranslate(fo),i.billboard._labelDimensions.x=O,i.billboard._labelDimensions.y=B,i.billboard._labelHorizontalOrigin=A),d<p-1){let E=t[d+1];fo.x+=(r.width-r.minx+E.dimensions.minx)*C}if(l(g)&&n.split(`
- `).join("").length>0&&(A===gi.CENTER?w=-s/2-m.x:A===gi.RIGHT?w=-(s+m.x*2):w=0,fo.x=w*C,b===vn.TOP?fo.y=x-u-c:b===vn.CENTER?fo.y=(x-u)/2-c:b===vn.BASELINE?fo.y=-m.y-c:fo.y=0,fo.y=fo.y*C,g.width=O,g.height=B,g._setTranslate(fo),g._labelTranslate=W.clone(fo,g._labelTranslate)),e.heightReference===ze.CLAMP_TO_GROUND)for(d=0;d<p;++d){i=t[d];let E=i.billboard;l(E)&&(E._labelTranslate=W.clone(fo,E._labelTranslate))}}function Sce(e,t){let n=t._glyphs;for(let i=0,r=n.length;i<r;++i)k9(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),ue(t)}function em(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._backgroundBillboardCollection=new uf({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new uf({scene:this._scene,batchTable:this._batchTable}),this._billboardCollection.destroyTextureAtlas=!1,this._billboardCollection._sdf=!0,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=z.clone(z.WHITE),this.show=y(e.show,!0),this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,Ir.OPAQUE_AND_TRANSLUCENT)}Object.defineProperties(em.prototype,{length:{get:function(){return this._labels.length}}});em.prototype.add=function(e){let t=new xx(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};em.prototype.remove=function(e){if(l(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),Sce(this,e),!0}return!1};em.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)Sce(this,e[t]);e.length=0};em.prototype.contains=function(e){return l(e)&&e._labelCollection===this};em.prototype.get=function(e){return this._labels[e]};em.prototype.update=function(e){if(!this.show)return;let t=this._billboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=e.context;l(this._textureAtlas)||(this._textureAtlas=new gx({context:i}),t.textureAtlas=this._textureAtlas),l(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new gx({context:i,initialSize:V9}),n.textureAtlas=this._backgroundTextureAtlas,b9e(this._backgroundTextureAtlas));let r=this._labelsToUpdate.length;for(let s=0;s<r;++s){let a=this._labelsToUpdate[s];if(a.isDestroyed())continue;let c=a._glyphs.length;a._rebindAllGlyphs&&(v9e(this,a),a._rebindAllGlyphs=!1),a._repositionAllGlyphs&&(P9e(a),a._repositionAllGlyphs=!1);let u=a._glyphs.length-c;this._totalGlyphCount+=u}let o=n.length>0?Ir.TRANSLUCENT:this.blendOption;t.blendOption=o,n.blendOption=o,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};em.prototype.isDestroyed=function(){return!1};em.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),ue(this)};var Bp=em;var JN=`attribute vec3 position3DHigh;
- attribute vec3 position3DLow;
- attribute vec3 position2DHigh;
- attribute vec3 position2DLow;
- attribute vec3 prevPosition3DHigh;
- attribute vec3 prevPosition3DLow;
- attribute vec3 prevPosition2DHigh;
- attribute vec3 prevPosition2DLow;
- attribute vec3 nextPosition3DHigh;
- attribute vec3 nextPosition3DLow;
- attribute vec3 nextPosition2DHigh;
- attribute vec3 nextPosition2DLow;
- attribute vec4 texCoordExpandAndBatchIndex;
- varying vec2 v_st;
- varying float v_width;
- varying vec4 v_pickColor;
- varying float v_polylineAngle;
- void main()
- {
- float texCoord = texCoordExpandAndBatchIndex.x;
- float expandDir = texCoordExpandAndBatchIndex.y;
- bool usePrev = texCoordExpandAndBatchIndex.z < 0.0;
- float batchTableIndex = texCoordExpandAndBatchIndex.w;
- vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex);
- float width = widthAndShow.x + 0.5;
- float show = widthAndShow.y;
- if (width < 1.0)
- {
- show = 0.0;
- }
- vec4 pickColor = batchTable_getPickColor(batchTableIndex);
- vec4 p, prev, next;
- if (czm_morphTime == 1.0)
- {
- p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);
- prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);
- next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);
- }
- else if (czm_morphTime == 0.0)
- {
- p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);
- prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);
- next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);
- }
- else
- {
- p = czm_columbusViewMorph(
- czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),
- czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),
- czm_morphTime);
- prev = czm_columbusViewMorph(
- czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),
- czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),
- czm_morphTime);
- next = czm_columbusViewMorph(
- czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),
- czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),
- czm_morphTime);
- }
- #ifdef DISTANCE_DISPLAY_CONDITION
- vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex);
- vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex);
- vec3 centerLow = centerLowAndRadius.xyz;
- float radius = centerLowAndRadius.w;
- vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex);
- float lengthSq;
- if (czm_sceneMode == czm_sceneMode2D)
- {
- lengthSq = czm_eyeHeight2D.y;
- }
- else
- {
- vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz);
- lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius);
- }
- float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;
- float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;
- if (lengthSq < nearSq || lengthSq > farSq)
- {
- show = 0.0;
- }
- #endif
- float polylineAngle;
- vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle);
- gl_Position = czm_viewportOrthographic * positionWC * show;
- v_st.s = texCoord;
- v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w);
- v_width = width;
- v_pickColor = pickColor;
- v_polylineAngle = polylineAngle;
- }
- `;function su(e,t){e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._width=y(e.width,1),this._loop=y(e.loop,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=cr.fromType(cr.ColorType,{color:new z(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=vr(n,h.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(h.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=N.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Ni.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(vce),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=re.fromPoints(this._actualPositions),this._boundingVolumeWC=re.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new re}var wce=su.POSITION_INDEX=0,I9e=su.SHOW_INDEX=1,O9e=su.WIDTH_INDEX=2,R9e=su.MATERIAL_INDEX=3,Av=su.POSITION_SIZE_INDEX=4,M9e=su.DISTANCE_DISPLAY_CONDITION=5,vce=su.NUMBER_OF_PROPERTIES=6;function Lp(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(su.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,Lp(this,I9e))}},positions:{get:function(){return this._positions},set:function(e){let t=vr(e,h.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(h.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&Lp(this,Av),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=re.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=re.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),Lp(this,wce),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,Lp(this,R9e))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,Lp(this,O9e))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!h.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(h.clone(t[0]))):t.length>2&&h.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,Lp(this,Av)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Tt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Tt.clone(e,this._distanceDisplayCondition),Lp(this,M9e))}}});su.prototype.update=function(){let e=N.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[wce]>0||this._propertiesChanged[Av]>0;if((!N.equals(e,this._modelMatrix)||i)&&(this._segments=Ni.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=re.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=N.clone(e,this._modelMatrix),this._segments.positions.length!==t)Lp(this,Av);else{let r=n.length;for(let o=0;o<r;++o)if(n[o]!==this._segments.lengths[o]){Lp(this,Av);break}}};su.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};su.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<vce-1;++t)e[t]=0};su.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var gd=su;var B9e=gd.SHOW_INDEX,L9e=gd.WIDTH_INDEX,z9=gd.POSITION_INDEX,N9e=gd.MATERIAL_INDEX,Dce=gd.POSITION_SIZE_INDEX,F9e=gd.DISTANCE_DISPLAY_CONDITION,Lce=gd.NUMBER_OF_PROPERTIES,Al={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function yd(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this._modelMatrix=N.clone(N.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(Lce),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Ne.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=z.clone(z.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(yd.prototype,{length:{get:function(){return H9(this),this._polylines.length}}});yd.prototype.add=function(e){let t=new gd(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};yd.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};yd.prototype.removeAll=function(){G9(this),Uce(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};yd.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};yd.prototype.get=function(e){return H9(this),this._polylines[e]};function V9e(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:K.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:K.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:K.FLOAT,componentsPerAttribute:2}];e._batchTable=new bT(t,n,e._polylines.length)}var Nce=new zn,Fce=new se,Vce=new W;yd.prototype.update=function(e){if(H9(this),this._polylines.length===0||!this.show)return;W9e(this,e);let t=e.context,n=e.mapProjection,i,r=this._propertiesChanged;if(this._createBatchTable){if(Bt.maximumVertexTextureImageUnits===0)throw new fe("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");V9e(this,t),this._createBatchTable=!1}if(this._createVertexArray||U9e(this))Oce(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==te.SCENE3D){let u=c.length;for(let f=0;f<u;++f)i=c[f],i.update()}if(r[Dce]||r[N9e])Oce(this,t,n);else{let u=c.length,f=this._polylineBuckets;for(let d=0;d<u;++d){i=c[d],r=i._propertiesChanged;let p=i._bucket,g=0;for(let m in f)if(f.hasOwnProperty(m)){if(f[m]===p){r[z9]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[m].lengthOfPositions}if((r[B9e]||r[L9e])&&this._batchTable.setBatchedAttribute(i._index,0,new W(i._width,i._show)),this._batchTable.attributes.length>2){if(r[z9]||r[Dce]){let m=e.mode===te.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,x=zn.fromCartesian(m.center,Nce),C=se.fromElements(x.low.x,x.low.y,x.low.z,m.radius,Fce);this._batchTable.setBatchedAttribute(i._index,2,x.high),this._batchTable.setBatchedAttribute(i._index,3,C)}if(r[F9e]){let m=Vce;m.x=0,m.y=Number.MAX_VALUE;let x=i.distanceDisplayCondition;l(x)&&(m.x=x.near,m.y=x.far),this._batchTable.setBatchedAttribute(i._index,4,m)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}r=this._propertiesChanged;for(let c=0;c<Lce;++c)r[c]=0;let o=N.IDENTITY;e.mode===te.SCENE3D&&(o=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=Ve.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=Ve.fromCache({blending:hn.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;k9e(this,e,c,o)}};var Tv=new re,Pce=new re;function k9e(e,t,n,i){let r=t.context,o=t.commandList,s=n.length,a=0,c=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=u.length;for(let m=0;m<g;++m){let x=u[m],C=x.buckets,A=C.length;for(let b=0;b<A;++b){let T=C[b],S=T.offset,w=T.bucket.shaderProgram,D=T.bucket.polylines,I=D.length,O,B,L=0,_,E;for(let v=0;v<I;++v){let P=D[v],R=H9e(P._material);if(R!==O){if(l(O)&&L>0){let H=B.isTranslucent();a>=s?(_=new Ze({owner:e}),n.push(_)):_=n[a],++a,E=rt(p(B._uniforms),e._uniformMap),_.boundingVolume=re.clone(Tv,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=w,_.vertexArray=x.va,_.renderState=H?e._translucentRS:e._opaqueRS,_.pass=H?Ce.TRANSLUCENT:Ce.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=E,_.count=L,_.offset=S,S+=L,L=0,c=!0,o.push(_)}B=P._material,B.update(r),O=R}let F=P._locatorBuckets,U=F.length;for(let H=0;H<U;++H){let V=F[H];V.locator===T&&(L+=V.count)}let k;t.mode===te.SCENE3D?k=P._boundingVolumeWC:t.mode===te.COLUMBUS_VIEW?k=P._boundingVolume2D:t.mode===te.SCENE2D?l(P._boundingVolume2D)&&(k=re.clone(P._boundingVolume2D,Pce),k.center.x=0):l(P._boundingVolumeWC)&&l(P._boundingVolume2D)&&(k=re.union(P._boundingVolumeWC,P._boundingVolume2D,Pce)),c?(c=!1,re.clone(k,Tv)):re.union(k,Tv,Tv)}l(O)&&L>0&&(a>=s?(_=new Ze({owner:e}),n.push(_)):_=n[a],++a,E=rt(p(B._uniforms),e._uniformMap),_.boundingVolume=re.clone(Tv,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=w,_.vertexArray=x.va,_.renderState=B.isTranslucent()?e._translucentRS:e._opaqueRS,_.pass=B.isTranslucent()?Ce.TRANSLUCENT:Ce.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=E,_.count=L,_.offset=S,c=!0,o.push(_)),O=void 0}}n.length=a}yd.prototype.isDestroyed=function(){return!1};yd.prototype.destroy=function(){return kce(this),G9(this),Uce(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function U9e(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[z9]?(i.bufferUsage!==Ne.STREAM_DRAW&&(t=!0,i.bufferUsage=Ne.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Ne.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Ne.STATIC_DRAW):i.frameCount--),t}var Ice=[0,0,0];function Oce(e,t,n){e._createVertexArray=!1,G9(e),kce(e),G9e(e);let i=[[]],r=i[0],o=e._batchTable,s=e._useHighlightColor,a=[0],c=0,u=[[]],f=0,d=e._polylineBuckets,p,g;for(p in d)d.hasOwnProperty(p)&&(g=d[p],g.updateShader(t,o,s),f+=g.lengthOfPositions);if(f>0){let m=e._mode,x=new Float32Array(6*f*3),C=new Float32Array(f*4),A,b=0,T=0,S=0;for(p in d)if(d.hasOwnProperty(p)){g=d[p],g.write(x,C,b,T,S,o,t,n),m===te.MORPHING&&(l(A)||(A=new Float32Array(6*f*3)),g.writeForMorph(A,b));let E=g.lengthOfPositions;b+=6*E*3,T+=E*4,S+=E*4,c=g.updateIndices(i,a,u,c)}let w=e._positionBufferUsage.bufferUsage,D=Ne.STATIC_DRAW;e._positionBuffer=at.createVertexBuffer({context:t,typedArray:x,usage:w});let I;l(A)&&(I=at.createVertexBuffer({context:t,typedArray:A,usage:w})),e._texCoordExpandAndBatchIndexBuffer=at.createVertexBuffer({context:t,typedArray:C,usage:D});let O=3*Float32Array.BYTES_PER_ELEMENT,B=4*Float32Array.BYTES_PER_ELEMENT,L=0,_=i.length;for(let E=0;E<_;++E)if(r=i[E],r.length>0){let v=new Uint16Array(r),P=at.createIndexBuffer({context:t,typedArray:v,usage:Ne.STATIC_DRAW,indexDatatype:Le.UNSIGNED_SHORT});L+=a[E];let R=6*(E*(O*M.SIXTY_FOUR_KILOBYTES)-L*O),F=O+R,U=O+F,k=O+U,H=O+k,V=O+H,q=E*(B*M.SIXTY_FOUR_KILOBYTES)-L*B,j=[{index:Al.position3DHigh,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:R,strideInBytes:6*O},{index:Al.position3DLow,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:F,strideInBytes:6*O},{index:Al.position2DHigh,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:R,strideInBytes:6*O},{index:Al.position2DLow,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:F,strideInBytes:6*O},{index:Al.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:U,strideInBytes:6*O},{index:Al.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:k,strideInBytes:6*O},{index:Al.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:U,strideInBytes:6*O},{index:Al.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:k,strideInBytes:6*O},{index:Al.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:H,strideInBytes:6*O},{index:Al.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:V,strideInBytes:6*O},{index:Al.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:H,strideInBytes:6*O},{index:Al.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:V,strideInBytes:6*O},{index:Al.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:K.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:q}],X,G,$,J;m===te.SCENE3D?(G=e._positionBuffer,X="vertexBuffer",$=Ice,J="value"):m===te.SCENE2D||m===te.COLUMBUS_VIEW?(G=Ice,X="value",$=e._positionBuffer,J="vertexBuffer"):(G=I,X="vertexBuffer",$=e._positionBuffer,J="vertexBuffer"),j[0][X]=G,j[1][X]=G,j[2][J]=$,j[3][J]=$,j[4][X]=G,j[5][X]=G,j[6][J]=$,j[7][J]=$,j[8][X]=G,j[9][X]=G,j[10][J]=$,j[11][J]=$;let ce=new Qn({context:t,attributes:j,indexBuffer:P});e._vertexArrays.push({va:ce,buckets:u[E]})}}}function z9e(e,t){return t instanceof wt?t.id:t}var QN=[];function H9e(e){let t=cr._uniformList[e.type],n=t.length;QN.length=2*n;let i=0;for(let r=0;r<n;++r){let o=t[r];QN[i]=o,QN[i+1]=e._uniforms[o](),i+=2}return`${e.type}:${JSON.stringify(QN,z9e)}`}function G9e(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},r=e._polylines,o=r.length;for(let s=0;s<o;++s){let a=r[s];if(a._actualPositions.length>1){a.update();let c=a.material,u=i[c.type];l(u)||(u=i[c.type]=new tm(c,t,n)),u.addPolyline(a)}}}function W9e(e,t){let n=t.mode;(e._mode!==n||!N.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=N.clone(e.modelMatrix),e._createVertexArray=!0)}function H9(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,r,o=e._polylines.length;for(let s=0;s<o;++s)r=e._polylines[s],r.isDestroyed||(r._index=i++,n.push(r),t.push(r));e._polylines=t,e._polylinesToUpdate=n}}function G9(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let r=t[i]._bucket;l(r)&&(r.shaderProgram=r.shaderProgram&&r.shaderProgram.destroy())}}function kce(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}yd.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function Uce(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function U9(e,t,n){this.count=e,this.offset=t,this.bucket=n}function tm(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}tm.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};tm.prototype.updateShader=function(e,t,n){if(l(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/varying\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),Et.isInternetExplorer()||i.push("CLIP_POLYLINE");let r=new Fe({defines:i,sources:[`varying vec4 v_pickColor;
- `,this.material.shaderSource,vT]}),o=t.getVertexShaderCallback()(JN),s=new Fe({defines:i,sources:[tf,o]});this.shaderProgram=Wt.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:r,attributeLocations:Al})};function zce(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(an.ORIGIN_ZX_PLANE)===Jt.INTERSECTING}tm.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===te.SCENE3D||!zce(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let r=0;r<t;++r)n+=i[r]*4-4;return n};var xs=new h,df=new h,hf=new h,eF=new h,j9e=new se,q9e=new W;tm.prototype.write=function(e,t,n,i,r,o,s,a){let c=this.mode,u=a.ellipsoid.maximumRadius*M.PI,f=this.polylines,d=f.length;for(let p=0;p<d;++p){let g=f[p],m=g.width,x=g.show&&m>0,C=g._index,A=this.getSegments(g,a),b=A.positions,T=A.lengths,S=b.length,w=g.getPickId(s).color,D=0,I=0,O;for(let U=0;U<S;++U){U===0?g._loop?O=b[S-2]:(O=eF,h.subtract(b[0],b[1],O),h.add(b[0],O,O)):O=b[U-1],h.clone(O,df),h.clone(b[U],xs),U===S-1?g._loop?O=b[1]:(O=eF,h.subtract(b[S-1],b[S-2],O),h.add(b[S-1],O,O)):O=b[U+1],h.clone(O,hf);let k=T[D];U===I+k&&(I+=k,++D);let H=U-I===0,V=U===I+T[D]-1;c===te.SCENE2D&&(df.z=0,xs.z=0,hf.z=0),(c===te.SCENE2D||c===te.MORPHING)&&(H||V)&&u-Math.abs(xs.x)<1&&((xs.x<0&&df.x>0||xs.x>0&&df.x<0)&&h.clone(xs,df),(xs.x<0&&hf.x>0||xs.x>0&&hf.x<0)&&h.clone(xs,hf));let q=H?2:0,j=V?2:4;for(let X=q;X<j;++X){zn.writeElements(xs,e,n),zn.writeElements(df,e,n+6),zn.writeElements(hf,e,n+12);let G=X-2<0?-1:1;t[r]=U/(S-1),t[r+1]=2*(X%2)-1,t[r+2]=G,t[r+3]=C,n+=6*3,r+=4}}let B=j9e;B.x=z.floatToByte(w.red),B.y=z.floatToByte(w.green),B.z=z.floatToByte(w.blue),B.w=z.floatToByte(w.alpha);let L=q9e;L.x=m,L.y=x?1:0;let _=c===te.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,E=zn.fromCartesian(_.center,Nce),v=E.high,P=se.fromElements(E.low.x,E.low.y,E.low.z,_.radius,Fce),R=Vce;R.x=0,R.y=Number.MAX_VALUE;let F=g.distanceDisplayCondition;l(F)&&(R.x=F.near,R.y=F.far),o.setBatchedAttribute(C,0,L),o.setBatchedAttribute(C,1,B),o.attributes.length>2&&(o.setBatchedAttribute(C,2,v),o.setBatchedAttribute(C,3,P),o.setBatchedAttribute(C,4,R))}};var Y9e=new h,X9e=new h,K9e=new h,Rce=new h;tm.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,r=i.length;for(let o=0;o<r;++o){let s=i[o],a=s._segments.positions,c=s._segments.lengths,u=a.length,f=0,d=0;for(let p=0;p<u;++p){let g;p===0?s._loop?g=a[u-2]:(g=Rce,h.subtract(a[0],a[1],g),h.add(a[0],g,g)):g=a[p-1],g=N.multiplyByPoint(n,g,X9e);let m=N.multiplyByPoint(n,a[p],Y9e),x;p===u-1?s._loop?x=a[1]:(x=Rce,h.subtract(a[u-1],a[u-2],x),h.add(a[u-1],x,x)):x=a[p+1],x=N.multiplyByPoint(n,x,K9e);let C=c[f];p===d+C&&(d+=C,++f);let A=p-d===0,b=p===d+c[f]-1,T=A?2:0,S=b?2:4;for(let w=T;w<S;++w)zn.writeElements(m,e,t),zn.writeElements(g,e,t+6),zn.writeElements(x,e,t+12),t+=6*3}}};var $9e=new Array(1);tm.prototype.updateIndices=function(e,t,n,i){let r=n.length-1,o=new U9(0,i,this);n[r].push(o);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let d=0;d<f;++d){let p=u[d];p._locatorBuckets=[];let g;if(this.mode===te.SCENE3D){g=$9e;let x=p._actualPositions.length;if(x>0)g[0]=x;else continue}else g=p._segments.lengths;let m=g.length;if(m>0){let x=0;for(let C=0;C<m;++C){let A=g[C]-1;for(let b=0;b<A;++b)c+4>M.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:o,count:x}),x=0,t.push(4),a=[],e.push(a),c=0,o.count=s,s=0,i=0,o=new U9(0,0,this),n[++r]=[o]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),x+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:o,count:x}),c+4>M.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,o.count=s,i=0,s=0,o=new U9(0,0,this),n[++r]=[o])}p._clean()}return o.count=s,i};tm.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let r=0;r<i;++r){let o=t[r];if(o===e)break;n+=o._actualLength}return n};var fb={positions:void 0,lengths:void 0},Mce=new Array(1),Z9e=new h,J9e=new me;tm.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===te.SCENE3D)return Mce[0]=n.length,fb.positions=n,fb.lengths=Mce,fb;zce(e)&&(n=e._segments.positions);let i=t.ellipsoid,r=[],o=this.modelMatrix,s=n.length,a,c=Z9e;for(let u=0;u<s;++u)a=n[u],c=N.multiplyByPoint(o,a,c),r.push(t.project(i.cartesianToCartographic(c,J9e)));if(r.length>0){e._boundingVolume2D=re.fromPoints(r,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(u.z,u.x,u.y)}return fb.positions=r,fb.lengths=e._segments.lengths,fb};var Bce;tm.prototype.writeUpdate=function(e,t,n,i){let r=this.mode,o=i.ellipsoid.maximumRadius*M.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=Bce,c=6*s*3;!l(a)||a.length<c?a=Bce=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,d=u.lengths,p=0,g=0,m=0,x;s=f.length;for(let C=0;C<s;++C){C===0?t._loop?x=f[s-2]:(x=eF,h.subtract(f[0],f[1],x),h.add(f[0],x,x)):x=f[C-1],h.clone(x,df),h.clone(f[C],xs),C===s-1?t._loop?x=f[1]:(x=eF,h.subtract(f[s-1],f[s-2],x),h.add(f[s-1],x,x)):x=f[C+1],h.clone(x,hf);let A=d[g];C===m+A&&(m+=A,++g);let b=C-m===0,T=C===m+d[g]-1;r===te.SCENE2D&&(df.z=0,xs.z=0,hf.z=0),(r===te.SCENE2D||r===te.MORPHING)&&(b||T)&&o-Math.abs(xs.x)<1&&((xs.x<0&&df.x>0||xs.x>0&&df.x<0)&&h.clone(xs,df),(xs.x<0&&hf.x>0||xs.x>0&&hf.x<0)&&h.clone(xs,hf));let S=b?2:0,w=T?2:4;for(let D=S;D<w;++D)zn.writeElements(xs,a,p),zn.writeElements(df,a,p+6),zn.writeElements(hf,a,p+12),p+=6*3}n.copyFromArrayView(a,6*3*Float32Array.BYTES_PER_ELEMENT*e)}};var kg=yd;function Ug(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._billboardCollection=new uf({batchTable:e.batchTable}),this._labelCollection=new Bp({batchTable:e.batchTable}),this._polylineCollection=new kg,this._polylineCollection._useHighlightColor=!0,this._verticesPromise=void 0,this._packedBuffer=void 0,this._ready=!1,this._update=function(t,n){},this._readyPromise=uWe(this)}Object.defineProperties(Ug.prototype,{pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.textureAtlas.texture.sizeInBytes,t=this._labelCollection._textureAtlas.texture.sizeInBytes;return e+t}},readyPromise:{get:function(){return this._readyPromise}}});function Q9e(e,t){let n=e._rectangle,i=e._minHeight,r=e._maxHeight,o=2+he.packedLength+oe.packedLength,s=new Float64Array(o),a=0;return s[a++]=i,s[a++]=r,he.pack(n,s,a),a+=he.packedLength,oe.pack(t,s,a),s}var eWe=new Mi("createVectorTilePoints",5),tWe=new h;function nWe(e,t){let n;if(!l(e._verticesPromise)){n=e._positions;let i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=Q9e(e,t));let r=[n.buffer,i.buffer],o={positions:n.buffer,packedBuffer:i.buffer},s=e._verticesPromise=eWe.scheduleTask(o,r);return l(s)?s.then(function(a){e._positions=new Float64Array(a.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let d=e._batchIds,p=n.length/3;for(let g=0;g<p;++g){let m=d[g],x=h.unpack(n,g*3,tWe),C=c.add();C.position=x,C._batchIndex=m;let A=u.add();A.text=" ",A.position=x,A._batchIndex=m;let b=f.add();b.positions=[h.clone(x),h.clone(x)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}):void 0}}Ug.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,r=this._polylineCollection,o=this._batchIds,s=o.length;for(let a=0;a<s;++a){let c=o[a],u=n.get(a),f=i.get(a),d=r.get(a);t[c]=new Vg(e,c,u,f,d)}};Ug.prototype.applyDebugSettings=function(e,t){e?(z.clone(t,this._billboardCollection._highlightColor),z.clone(t,this._labelCollection._highlightColor),z.clone(t,this._polylineCollection._highlightColor)):(z.clone(z.WHITE,this._billboardCollection._highlightColor),z.clone(z.WHITE,this._labelCollection._highlightColor),z.clone(z.WHITE,this._polylineCollection._highlightColor))};function iWe(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.pointSize=Vg.defaultPointSize,s.color=Vg.defaultColor,s.pointOutlineColor=Vg.defaultPointOutlineColor,s.pointOutlineWidth=Vg.defaultPointOutlineWidth,s.labelColor=z.WHITE,s.labelOutlineColor=z.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=$r.FILL,s.labelText=void 0,s.backgroundColor=new z(.165,.165,.165,.8),s.backgroundPadding=new W(7,5),s.backgroundEnabled=!1,s.scaleByDistance=void 0,s.translucencyByDistance=void 0,s.distanceDisplayCondition=void 0,s.heightOffset=0,s.anchorLineEnabled=!1,s.anchorLineColor=z.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=gi.CENTER,s.verticalOrigin=vn.CENTER,s.labelHorizontalOrigin=gi.RIGHT,s.labelVerticalOrigin=vn.BASELINE}}var rWe=new z,oWe=new z,sWe=new z,aWe=new z,cWe=new z,lWe=new z,bv=new St,Ev=new St,W9=new Tt;Ug.prototype.applyStyle=function(e,t){if(!l(e)){iWe(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];if(l(e.show)&&(s.show=e.show.evaluate(s)),l(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),l(e.color)&&(s.color=e.color.evaluateColor(s,rWe)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,oWe)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,sWe)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,aWe)),l(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),l(e.font)&&(s.font=e.font.evaluate(s)),l(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),l(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,l(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,cWe)),l(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),l(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),l(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);bv.near=a.x,bv.nearValue=a.y,bv.far=a.z,bv.farValue=a.w,s.scaleByDistance=bv}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);Ev.near=a.x,Ev.nearValue=a.y,Ev.far=a.z,Ev.farValue=a.w,s.translucencyByDistance=Ev}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);W9.near=a.x,W9.far=a.y,s.distanceDisplayCondition=W9}else s.distanceDisplayCondition=void 0;l(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),l(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),l(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,lWe)),l(e.image)?s.image=e.image.evaluate(s):s.image=void 0,l(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),l(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),l(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),l(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),l(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};function uWe(e){return new Promise(function(t,n){e._update=function(i,r){let o=nWe(i,r.mapProjection.ellipsoid);i._ready&&(i._polylineCollection.update(r),i._billboardCollection.update(r),i._labelCollection.update(r)),l(o)&&o.then(function(){t()}).catch(function(s){n(s)})}})}Ug.prototype.update=function(e){this._update(this,e)};Ug.prototype.isDestroyed=function(){return!1};Ug.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),ue(this)};var tF=Ug;function Np(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=y(e.ellipsoid,oe.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=y(e.center,h.ZERO),this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._update=function(t,n){},this._readyPromise=gWe(this),this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=qn.BOTH}Object.defineProperties(Np.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},readyPromise:{get:function(){return this._readyPromise}}});function fWe(e){let t=new Float64Array(3+h.packedLength+oe.packedLength+he.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,h.pack(e._center,t,n),n+=h.packedLength,oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,he.pack(e._rectangle,t,n),t}function dWe(e,t){let n=1,i=t[n++],r=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)r[a]=Ai.unpack(t,n),n+=Ai.packedLength;let o=t[n++],s=e._batchedIndices=new Array(o);for(let a=0;a<o;++a){let c=z.unpack(t,n);n+=z.packedLength;let u=t[n++],f=t[n++],d=t[n++],p=new Array(d);for(let g=0;g<d;++g)p[g]=t[n++];s[a]=new rf({color:c,offset:u,count:f,batchIds:p})}}var hWe=new Mi("createVectorTilePolygons",5),mWe=new z;function pWe(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._positions,n=e._counts,i=e._indexCounts,r=e._indices,o=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!l(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),r=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(he.center(e._rectangle)),o=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(o.length);let g=e._batchTable,m=s.length;for(let x=0;x<m;++x){let C=g.getColor(x,mWe);s[x]=C.toRgba()}a=e._packedBuffer=fWe(e)}let c=[t.buffer,n.buffer,i.buffer,r.buffer,o.buffer,s.buffer,a.buffer],u={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:r.buffer,batchIds:o.buffer,batchTableColors:s.buffer},f=e._polygonMinimumHeights,d=e._polygonMaximumHeights;l(f)&&l(d)&&(f=f.slice(),d=d.slice(),c.push(f.buffer,d.buffer),u.minimumHeights=f,u.maximumHeights=d);let p=e._verticesPromise=hWe.scheduleTask(u,c);return l(p)?p.then(function(g){e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let m=new Float64Array(g.packedBuffer),x=m[0];dWe(e,m),e._indices=Le.getSizeInBytes(x)===2?new Uint16Array(g.indices):new Uint32Array(g.indices),e._indexOffsets=new Uint32Array(g.indexOffsets),e._indexCounts=new Uint32Array(g.indexCounts),e._batchedPositions=new Float32Array(g.positions),e._vertexBatchIds=new Uint16Array(g.batchIds),e._ready=!0}):void 0}}function _We(e){e._ready&&!l(e._primitive)&&(e._primitive=new Eg({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._verticesPromise=void 0)}Np.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Np.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Np.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Np.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};function gWe(e){return new Promise(function(t,n){e._update=function(i,r){let o=pWe(i);i._ready&&(i._primitive.debugWireframe=i.debugWireframe,i._primitive.forceRebatch=i.forceRebatch,i._primitive.classificationType=i.classificationType,i._primitive.update(r)),l(o)&&o.then(function(){_We(i),t(i)}).catch(function(s){n(s)})}})}Np.prototype.update=function(e){this._update(this,e)};Np.prototype.isDestroyed=function(){return!1};Np.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var nF=Np;var iF=`attribute vec4 currentPosition;
- attribute vec4 previousPosition;
- attribute vec4 nextPosition;
- attribute vec2 expandAndWidth;
- attribute float a_batchId;
- uniform mat4 u_modifiedModelView;
- void main()
- {
- float expandDir = expandAndWidth.x;
- float width = abs(expandAndWidth.y) + 0.5;
- bool usePrev = expandAndWidth.y < 0.0;
- vec4 p = u_modifiedModelView * currentPosition;
- vec4 prev = u_modifiedModelView * previousPosition;
- vec4 next = u_modifiedModelView * nextPosition;
- float angle;
- vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle);
- gl_Position = czm_viewportOrthographic * positionWC;
- }
- `;function xd(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,oe.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._update=function(t,n){},this._readyPromise=OWe(this),this._verticesPromise=void 0}Object.defineProperties(xd.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},readyPromise:{get:function(){return this._readyPromise}}});function yWe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,s=2+he.packedLength+oe.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,he.pack(t,a,c),c+=he.packedLength,oe.pack(r,a,c),c+=oe.packedLength,h.pack(o,a,c),a}var xWe=new Mi("createVectorTilePolylines",5),db={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function CWe(e,t){if(!l(e._va)&&!l(e._verticesPromise)){let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=yWe(e));let a=[n.buffer,i.buffer,r.buffer,o.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=e._verticesPromise=xWe.scheduleTask(c,a);return l(u)?u.then(function(f){e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let d=f.indexDatatype;e._indices=d===Le.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),e._ready=!0}):void 0}}function AWe(e,t){if(e._ready&&!l(e._va)){let n=e._currentPositions,i=e._previousPositions,r=e._nextPositions,o=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+r.byteLength;c+=o.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let u=at.createVertexBuffer({context:t,typedArray:i,usage:Ne.STATIC_DRAW}),f=at.createVertexBuffer({context:t,typedArray:n,usage:Ne.STATIC_DRAW}),d=at.createVertexBuffer({context:t,typedArray:r,usage:Ne.STATIC_DRAW}),p=at.createVertexBuffer({context:t,typedArray:o,usage:Ne.STATIC_DRAW}),g=at.createVertexBuffer({context:t,typedArray:s,usage:Ne.STATIC_DRAW}),m=at.createIndexBuffer({context:t,typedArray:a,usage:Ne.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Le.UNSIGNED_SHORT:Le.UNSIGNED_INT}),x=[{index:db.previousPosition,vertexBuffer:u,componentDatatype:K.FLOAT,componentsPerAttribute:3},{index:db.currentPosition,vertexBuffer:f,componentDatatype:K.FLOAT,componentsPerAttribute:3},{index:db.nextPosition,vertexBuffer:d,componentDatatype:K.FLOAT,componentsPerAttribute:3},{index:db.expandAndWidth,vertexBuffer:p,componentDatatype:K.FLOAT,componentsPerAttribute:2},{index:db.a_batchId,vertexBuffer:g,componentDatatype:K.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Qn({context:t,attributes:x,indexBuffer:m}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var Sv=new N,Hce=new h;function TWe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return N.clone(n,Sv),N.multiplyByPoint(Sv,e._center,Hce),N.setTranslation(Sv,Hce,Sv),Sv},u_highlightColor:function(){return e._highlightColor}})}function bWe(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ve.fromCache({blending:hn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var EWe=`uniform vec4 u_highlightColor;
- void main()
- {
- gl_FragColor = u_highlightColor;
- }
- `;function SWe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(iF),r=n.getFragmentShaderCallback(!1,void 0,!1)(EWe),o=new Fe({defines:["VECTOR_TILE",Et.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[tf,i]}),s=new Fe({defines:["VECTOR_TILE"],sources:[r]});e._sp=Wt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:db})}function wWe(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new Ze({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Ce.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}xd.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,r=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let o,s,a=n.length,c=0,u=0;for(o=0;o<a;++o)n[o]===t&&(c+=r[o+1]-r[o]);if(c===0)return;let f=new Float64Array(c*3);for(o=0;o<a;++o)if(n[o]===t){let d=r[o],p=r[o+1]-d;for(s=0;s<p;++s){let g=(d+s)*3;f[u++]=i[g],f[u++]=i[g+1],f[u++]=i[g+2]}}return f};xd.prototype.getPositions=function(e){return xd.getPolylinePositions(this,e)};xd.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new bo(e,o)}};xd.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function vWe(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.color=z.WHITE}}var DWe=new z,PWe=z.WHITE,IWe=!0;xd.prototype.applyStyle=function(e,t){if(!l(e)){vWe(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.color=l(e.color)?e.color.evaluateColor(s,DWe):PWe,s.show=l(e.show)?e.show.evaluate(s):IWe}};function OWe(e){return new Promise(function(t,n){e._update=function(i,r){let o=r.context,s=CWe(i,o);if(TWe(i,o),SWe(i,o),bWe(i),i._ready){let a=r.passes;(a.render||a.pick)&&wWe(i,r)}!l(s)||s.then(function(){AWe(i,o),t()}).catch(function(a){n(a)})}})}xd.prototype.update=function(e){this._update(this,e)};xd.prototype.isDestroyed=function(){return!1};xd.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var hb=xd;var rF=`attribute vec3 startEllipsoidNormal;
- attribute vec3 endEllipsoidNormal;
- attribute vec4 startPositionAndHeight;
- attribute vec4 endPositionAndHeight;
- attribute vec4 startFaceNormalAndVertexCorner;
- attribute vec4 endFaceNormalAndHalfWidth;
- attribute float a_batchId;
- uniform mat4 u_modifiedModelView;
- uniform vec2 u_minimumMaximumVectorHeights;
- varying vec4 v_startPlaneEC;
- varying vec4 v_endPlaneEC;
- varying vec4 v_rightPlaneEC;
- varying float v_halfWidth;
- varying vec3 v_volumeUpEC;
- void main()
- {
- float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251);
- float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd));
- vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz;
- vec3 right = normalize(cross(forward, startEllipsoidNormal));
- vec4 position = vec4(startPositionAndHeight.xyz, 1.0);
- position.xyz += forward * isEnd;
- v_volumeUpEC = czm_normal * normalize(cross(right, forward));
- float offset;
- vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd);
- offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd);
- offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset;
- position.xyz += offset * ellipsoidNormal;
- position = u_modifiedModelView * position;
- right = czm_normal * right;
- vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd);
- scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd));
- vec3 miterPushNormal = czm_normal * normalize(scratchNormal);
- offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position));
- offset = offset / dot(miterPushNormal, right);
- position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0)));
- gl_Position = czm_depthClamp(czm_projection * position);
- position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0);
- vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz;
- v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz));
- v_rightPlaneEC = vec4(right, -dot(right, position.xyz));
- position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0);
- vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz;
- v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz));
- v_halfWidth = endFaceNormalAndHalfWidth.w;
- }
- `;var oF=`#ifdef GL_EXT_frag_depth
- #extension GL_EXT_frag_depth : enable
- #endif
- varying vec4 v_startPlaneEC;
- varying vec4 v_endPlaneEC;
- varying vec4 v_rightPlaneEC;
- varying float v_halfWidth;
- varying vec3 v_volumeUpEC;
- uniform vec4 u_highlightColor;
- void main()
- {
- float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture2D(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));
- if (logDepthOrDepth == 0.0) {
- #ifdef DEBUG_SHOW_VOLUME
- gl_FragColor = vec4(0.0, 0.0, 1.0, 0.5);
- return;
- #else // DEBUG_SHOW_VOLUME
- discard;
- #endif // DEBUG_SHOW_VOLUME
- }
- vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
- eyeCoordinate /= eyeCoordinate.w;
- float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate);
- halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC));
- float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);
- float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz);
- float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz);
- if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {
- #ifdef DEBUG_SHOW_VOLUME
- gl_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5);
- return;
- #else // DEBUG_SHOW_VOLUME
- discard;
- #endif // DEBUG_SHOW_VOLUME
- }
- gl_FragColor = u_highlightColor;
- czm_writeDepthClamp();
- }
- `;function Fp(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,oe.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new W(fi._defaultMinTerrainHeight,fi._defaultMaxTerrainHeight),this._boundingVolume=Ai.fromRectangle(e.rectangle,fi._defaultMinTerrainHeight,fi._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._update=function(t,n){},this._readyPromise=jWe(this),this._verticesPromise=void 0}Object.defineProperties(Fp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},readyPromise:{get:function(){return this._readyPromise}}});function RWe(e,t,n){let i=fi.getMinimumMaximumHeights(t,n),r=i.minimumTerrainHeight,o=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=r,s.y=o;let a=e._boundingVolume,c=e._rectangle;Ai.fromRectangle(c,r,o,n,a)}function MWe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,s=2+he.packedLength+oe.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,he.pack(t,a,c),c+=he.packedLength,oe.pack(r,a,c),c+=oe.packedLength,h.pack(o,a,c),a}var BWe=new Mi("createVectorTileClampedPolylines"),zg={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function LWe(e,t){if(!l(e._va)&&!l(e._verticesPromise)){let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=MWe(e));let a=[n.buffer,i.buffer,r.buffer,o.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=e._verticesPromise=BWe.scheduleTask(c,a);return l(u)?u.then(function(f){e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let d=f.indexDatatype;e._indices=d===Le.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),e._ready=!0}):void 0}}function NWe(e,t){if(e._ready&&!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,r=e._startPositionAndHeights,o=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=r.byteLength+o.byteLength,f+=s.byteLength+a.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let d=at.createVertexBuffer({context:t,typedArray:n,usage:Ne.STATIC_DRAW}),p=at.createVertexBuffer({context:t,typedArray:i,usage:Ne.STATIC_DRAW}),g=at.createVertexBuffer({context:t,typedArray:r,usage:Ne.STATIC_DRAW}),m=at.createVertexBuffer({context:t,typedArray:o,usage:Ne.STATIC_DRAW}),x=at.createVertexBuffer({context:t,typedArray:s,usage:Ne.STATIC_DRAW}),C=at.createVertexBuffer({context:t,typedArray:a,usage:Ne.STATIC_DRAW}),A=at.createVertexBuffer({context:t,typedArray:c,usage:Ne.STATIC_DRAW}),b=at.createIndexBuffer({context:t,typedArray:u,usage:Ne.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?Le.UNSIGNED_SHORT:Le.UNSIGNED_INT}),T=[{index:zg.startEllipsoidNormal,vertexBuffer:d,componentDatatype:K.FLOAT,componentsPerAttribute:3},{index:zg.endEllipsoidNormal,vertexBuffer:p,componentDatatype:K.FLOAT,componentsPerAttribute:3},{index:zg.startPositionAndHeight,vertexBuffer:g,componentDatatype:K.FLOAT,componentsPerAttribute:4},{index:zg.endPositionAndHeight,vertexBuffer:m,componentDatatype:K.FLOAT,componentsPerAttribute:4},{index:zg.startFaceNormalAndVertexCorner,vertexBuffer:x,componentDatatype:K.FLOAT,componentsPerAttribute:4},{index:zg.endFaceNormalAndHalfWidth,vertexBuffer:C,componentDatatype:K.FLOAT,componentsPerAttribute:4},{index:zg.a_batchId,vertexBuffer:A,componentDatatype:K.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Qn({context:t,attributes:T,indexBuffer:b}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var wv=new N,Gce=new h;function FWe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return N.clone(n,wv),N.multiplyByPoint(wv,e._center,Gce),N.setTranslation(wv,Gce,wv),wv},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function Wce(e){return Ve.fromCache({cull:{enabled:!0,face:Yi.FRONT},blending:hn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:yi.EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:yi.EQUAL,backOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},reference:tn.CESIUM_3D_TILE_MASK,mask:tn.CESIUM_3D_TILE_MASK}})}function VWe(e){l(e._rs)||(e._rs=Wce(!1),e._rs3DTiles=Wce(!0))}function kWe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(rF),r=n.getFragmentShaderCallback(!1,void 0,!0)(oF),o=new Fe({defines:["VECTOR_TILE",Et.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[tf,i]}),s=new Fe({defines:["VECTOR_TILE"],sources:[r]});e._sp=Wt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:zg})}function UWe(e,t){let n=e._command;if(!l(e._command)){let r=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new Ze({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:r,boundingVolume:e._boundingVolume,pass:Ce.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let o=Ze.shallowClone(n,n.derivedCommands.tileset);o.renderState=e._rs3DTiles,o.pass=Ce.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=o}let i=e._classificationType;(i===qn.TERRAIN||i===qn.BOTH)&&t.commandList.push(n),(i===qn.CESIUM_3D_TILE||i===qn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}Fp.prototype.getPositions=function(e){return hb.getPolylinePositions(this,e)};Fp.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new bo(e,o)}};Fp.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function zWe(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.color=z.WHITE}}var HWe=new z,GWe=z.WHITE,WWe=!0;Fp.prototype.applyStyle=function(e,t){if(!l(e)){zWe(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.color=l(e.color)?e.color.evaluateColor(s,HWe):GWe,s.show=l(e.show)?e.show.evaluate(s):WWe}};function jWe(e){return fi.initialize().then(function(){return RWe(e,e._rectangle,e._ellipsoid),new Promise(function(t,n){e._update=function(i,r){let o=r.context,s=LWe(i,o);if(FWe(i,o),kWe(i,o),VWe(i),i._ready){let a=r.passes;(a.render||a.pick)&&UWe(i,r)}!l(s)||s.then(function(){NWe(i,o),t(i)}).catch(function(a){n(a)})}})})}Fp.prototype.update=function(e){this._update(this,e)};Fp.prototype.isDestroyed=function(){return!1};Fp.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var sF=Fp;function nm(e,t,n,i,r){this._tileset=e,this._tile=t,this._resource=n,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,$We(this,i,r)}Object.defineProperties(nm.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return l(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.trianglesLength),l(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.geometryByteLength),l(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return l(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},readyPromise:{get:function(){let e=l(this._points)?this._points.readyPromise:void 0,t=l(this._polygons)?this._polygons.readyPromise:void 0,n=l(this._polylines)?this._polylines.readyPromise:void 0,i=this;return Promise.all([e,t,n]).then(function(){return i})}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function qWe(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function YWe(e,t){let n,i,r,o,s=y(e.POLYGONS_LENGTH,0),a=y(e.POLYLINES_LENGTH,0),c=y(e.POINTS_LENGTH,0);if(s>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,p,c)}let u=l(n)||l(i)||l(r),f=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(r);if(u&&f)throw new fe("If one group of batch ids is defined, then all batch ids must be defined.");if(!l(n)&&!l(i)&&!l(r)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),o=0;o<s;++o)n[o]=p++;if(!l(i)&&a>0)for(i=new Uint16Array(a),o=0;o<a;++o)i[o]=p++;if(!l(r)&&c>0)for(r=new Uint16Array(c),o=0;o<c;++o)r[o]=p++}return{polygons:n,polylines:i,points:r}}var Cd=Uint32Array.BYTES_PER_ELEMENT;function XWe(e){return new hb(e)}function KWe(e){return new sF(e)}function $We(e,t,n){n=y(n,0);let i=new Uint8Array(t),r=new DataView(t);n+=Cd;let o=r.getUint32(n,!0);if(o!==1)throw new fe(`Only Vector tile version 1 is supported. Version ${o} is not.`);n+=Cd;let s=r.getUint32(n,!0);if(n+=Cd,s===0)return Promise.resolve(e);let a=r.getUint32(n,!0);if(n+=Cd,a===0)throw new fe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=Cd;let u=r.getUint32(n,!0);n+=Cd;let f=r.getUint32(n,!0);n+=Cd;let d=r.getUint32(n,!0);n+=Cd;let p=r.getUint32(n,!0);n+=Cd;let g=r.getUint32(n,!0);n+=Cd;let m=r.getUint32(n,!0);n+=Cd;let x=Vr(i,n,a);n+=a;let C=new Uint8Array(t,n,c);n+=c;let A,b;u>0&&(A=Vr(i,n,u),n+=u,f>0&&(b=new Uint8Array(t,n,f),b=new Uint8Array(b),n+=f));let T=y(x.POLYGONS_LENGTH,0),S=y(x.POLYLINES_LENGTH,0),w=y(x.POINTS_LENGTH,0),D=T+S+w,I=new ml(e,D,A,b,qWe(e));if(e._batchTable=I,D===0)return;let O=new pl(x,C),B=O.getGlobalProperty("REGION");if(!l(B))throw new fe("Feature table global property: REGION must be defined");let L=he.unpack(B),_=B[4],E=B[5],v=e._tile.computedTransform,P=O.getGlobalProperty("RTC_CENTER",K.FLOAT,3);l(P)?(P=h.unpack(P),N.multiplyByPoint(v,P,P)):(P=he.center(L),P.height=M.lerp(_,E,.5),P=oe.WGS84.cartographicToCartesian(P));let R=YWe(x,C);if(n+=(4-n%4)%4,T>0){O.featuresLength=T;let F=y(O.getPropertyArray("POLYGON_COUNTS",K.UNSIGNED_INT,1),O.getPropertyArray("POLYGON_COUNT",K.UNSIGNED_INT,1));if(!l(F))throw new fe("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let U=y(O.getPropertyArray("POLYGON_INDEX_COUNTS",K.UNSIGNED_INT,1),O.getPropertyArray("POLYGON_INDEX_COUNT",K.UNSIGNED_INT,1));if(!l(U))throw new fe("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let k=F.reduce(function(G,$){return G+$*2},0),H=U.reduce(function(G,$){return G+$},0),V=new Uint32Array(t,n,H);n+=d;let q=new Uint16Array(t,n,k);n+=p;let j,X;l(x.POLYGON_MINIMUM_HEIGHTS)&&l(x.POLYGON_MAXIMUM_HEIGHTS)&&(j=O.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",K.FLOAT,1),X=O.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",K.FLOAT,1)),e._polygons=new nF({positions:q,counts:F,indexCounts:U,indices:V,minimumHeight:_,maximumHeight:E,polygonMinimumHeights:j,polygonMaximumHeights:X,center:P,rectangle:L,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:I,batchIds:R.polygons,modelMatrix:v})}if(S>0){O.featuresLength=S;let F=y(O.getPropertyArray("POLYLINE_COUNTS",K.UNSIGNED_INT,1),O.getPropertyArray("POLYLINE_COUNT",K.UNSIGNED_INT,1));if(!l(F))throw new fe("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let U=O.getPropertyArray("POLYLINE_WIDTHS",K.UNSIGNED_SHORT,1);if(!l(U)){U=new Uint16Array(S);for(let X=0;X<S;++X)U[X]=2}let k=F.reduce(function(X,G){return X+G*3},0),H=new Uint16Array(t,n,k);n+=g;let V=e._tileset,q=V.examineVectorLinesFunction;if(l(q)){let X=QI(new Uint16Array(H),L,_,E,oe.WGS84);ZWe(X,F,R.polylines,I,e.url,q)}let j=XWe;l(V.classificationType)&&(j=KWe),e._polylines=j({positions:H,widths:U,counts:F,batchIds:R.polylines,minimumHeight:_,maximumHeight:E,center:P,rectangle:L,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:I,classificationType:V.classificationType,keepDecodedPositions:V.vectorKeepDecodedPositions})}if(w>0){let F=new Uint16Array(t,n,w*3);n+=m,e._points=new tF({positions:F,batchIds:R.points,minimumHeight:_,maximumHeight:E,rectangle:L,batchTable:I})}return Promise.resolve(e)}function jce(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}nm.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};nm.prototype.getFeature=function(e){return jce(this),this._features[e]};nm.prototype.applyDebugSettings=function(e,t){l(this._polygons)&&this._polygons.applyDebugSettings(e,t),l(this._polylines)&&this._polylines.applyDebugSettings(e,t),l(this._points)&&this._points.applyDebugSettings(e,t)};nm.prototype.applyStyle=function(e){jce(this),l(this._polygons)&&this._polygons.applyStyle(e,this._features),l(this._polylines)&&this._polylines.applyStyle(e,this._features),l(this._points)&&this._points.applyStyle(e,this._features)};nm.prototype.update=function(e,t){let n=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons._ready),l(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines._ready),l(this._points)&&(this._points.update(t),n=n&&this._points._ready),l(this._batchTable)&&n&&this._batchTable.update(e,t)};nm.prototype.getPolylinePositions=function(e){let t=this._polylines;if(!!l(t))return t.getPositions(e)};nm.prototype.isDestroyed=function(){return!1};nm.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function ZWe(e,t,n,i,r,o){let s=t.length,a=0;for(let c=0;c<s;c++){let u=t[c]*3,f=e.slice(a,a+u);a+=u,o(f,n[c],r,i)}}var aF=nm;function Xa(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy}Object.defineProperties(Xa.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(l(this._metadataTable))return this._metadataTable.class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return l(this._metadataTable)&&(e+=this._metadataTable.byteLength),l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}});Xa.prototype.hasProperty=function(e,t){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(t)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t))};Xa.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};Xa.prototype.propertyExists=function(e){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(e)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e))};Xa.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var j9=[];Xa.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,l(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(j9)),l(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(j9)),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,j9)),t};Xa.prototype.getProperty=function(e,t){let n;if(l(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),l(n))||l(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),l(n))||l(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),l(n)))return n};Xa.prototype.setProperty=function(e,t,n){return l(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.setProperty(e,t,n)?!0:l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)};Xa.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};Xa.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};Xa.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};Xa.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};Xa.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Xa.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Xa.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(!!l(t))return t.getClassName(e)};var Tl=Xa;function vv(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty,i=e.textures,r=l(t.channels)?t.channels:[0],o=t,s=nu.createModelTextureReader({textureInfo:o,channels:e7e(r),texture:i[o.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,u=n.hasValueTransform||l(a)||l(c);a=y(a,n.offset),c=y(c,n.scale),a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=u,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(vv.prototype,{textureReader:{get:function(){return this._textureReader}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});vv.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?!e.isVariableLengthArray&&e.arrayLength<=4&&t===Fn.SCALAR&&n===Dn.UINT8:Fn.isVectorType(t)||t===Fn.SCALAR?n===Dn.UINT8:!1};var JWe=[void 0,"float","vec2","vec3","vec4"],QWe=[void 0,"int","ivec2","ivec3","ivec4"];vv.prototype.getGlslType=function(){let e=this._classProperty,t=Fn.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?JWe[t]:QWe[t]};vv.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function e7e(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var cF=vv;function q9(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyTexture,n=e.class,i=e.textures,r=t.extensions,o=t.extras,s={};if(l(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new cF({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=o,this._extensions=r}Object.defineProperties(q9.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});q9.prototype.getProperty=function(e){return this._properties[e]};var mb=q9;function pb(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,r=t.scale,o=n.hasValueTransform||l(i)||l(r);i=y(i,n.offset),r=y(r,n.scale),i=n.unpackVectorAndMatrixTypes(i),r=n.unpackVectorAndMatrixTypes(r),this._offset=i,this._scale=r,this._hasValueTransform=o,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(pb.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function Vp(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let r in t.properties)t.properties.hasOwnProperty(r)&&(i[r]=new pb({property:t.properties[r],classProperty:n.properties[r]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Vp.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Vp.prototype.getProperty=function(e){return this._properties[e]};function Dv(e){e=y(e,y.EMPTY_OBJECT),this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=l(t)?t.length:0,this._propertyTables=t,this._propertyTextures=e.propertyTextures,this._propertyAttributes=e.propertyAttributes,this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(Dv.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!l(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n<t;n++)e+=this._propertyTables[n].byteLength;return e}}});Dv.prototype.getPropertyTable=function(e){return this._propertyTables[e]};Dv.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};Dv.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};var Ka=Dv;function Pv(e){e=y(e,y.EMPTY_OBJECT);let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],c=n.classes[a.class],u=new hd({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new Tl({id:s,name:a.name,count:a.count,metadataTable:u,extras:a.extras,extensions:a.extensions}))}let r=[];if(l(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];r.push(new mb({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let o=[];if(l(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];o.push(new Vp({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new Ka({schema:n,propertyTables:i,propertyTextures:r,propertyAttributes:o,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function Iv(e){e=y(e,y.EMPTY_OBJECT);let t=e.extension,n=e.schema,i,r=[],o;if(l(t.featureTables))for(o=Object.keys(t.featureTables).sort(),i=0;i<o.length;i++){let a=o[i],c=t.featureTables[a],u=n.classes[c.class],f=new hd({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});r.push(new Tl({id:a,count:c.count,metadataTable:f,extras:c.extras,extensions:c.extensions}))}let s=[];if(l(t.featureTextures))for(o=Object.keys(t.featureTextures).sort(),i=0;i<o.length;i++){let a=o[i],c=t.featureTextures[a];s.push(new mb({id:a,propertyTexture:t7e(c),class:n.classes[c.class],textures:e.textures}))}return new Ka({schema:n,propertyTables:r,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function t7e(e){let t={class:e.class,properties:{}},n=e.properties;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i],o={channels:n7e(r.channels),extras:r.extras,extensions:r.extensions};t.properties[i]=rt(r.texture,o,!0)}return t}function n7e(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]="rgba".indexOf(e[i]);return n}function mf(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.extension,i=e.extensionLegacy,r=e.gltfResource,o=e.baseResource,s=e.supportedImageFormats,a=e.cacheKey,c=y(e.asynchronous,!0);this._gltfResource=r,this._baseResource=o,this._gltf=t,this._extension=n,this._extensionLegacy=i,this._supportedImageFormats=s,this._cacheKey=a,this._asynchronous=c,this._bufferViewLoaders=[],this._textureLoaders=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=Vt.UNLOADED,this._promise=void 0}l(Object.create)&&(mf.prototype=Object.create(hi.prototype),mf.prototype.constructor=mf);Object.defineProperties(mf.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});mf.prototype.load=function(){let e=a7e(this),t=d7e(this),n=h7e(this);this._gltf=void 0,this._state=Vt.LOADING;let i=this;this._promise=Promise.all([e,t,n]).then(function(r){if(i.isDestroyed())return;let o=r[0],s=r[1],a=r[2];return l(i._extension)?i._structuralMetadata=Pv({extension:i._extension,schema:a,bufferViews:o,textures:s}):i._structuralMetadata=Iv({extension:i._extensionLegacy,schema:a,bufferViews:o,textures:s}),i._state=Vt.READY,i}).catch(function(r){if(i.isDestroyed())return;i.unload(),i._state=Vt.FAILED;let o="Failed to load structural metadata";return Promise.reject(i.getError(o,r))})};function i7e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.values,o=i.arrayOffsets,s=i.stringOffsets;l(r)&&(t[r]=!0),l(o)&&(t[o]=!0),l(s)&&(t[s]=!0)}}function r7e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.bufferView,o=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;l(r)&&(t[r]=!0),l(o)&&(t[o]=!0),l(s)&&(t[s]=!0)}}function o7e(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let r=t[i];i7e(r.properties,n)}return n}function s7e(e){let t=e.featureTables,n={};if(l(t)){for(let i in t)if(t.hasOwnProperty(i)){let o=t[i].properties;l(o)&&r7e(o,n)}}return n}function a7e(e){let t;l(e._extension)?t=o7e(e._extension):t=s7e(e._extensionLegacy);let n=[],i={};for(let r in t)if(t.hasOwnProperty(r)){let o=Ar.loadBufferView({gltf:e._gltf,bufferViewId:parseInt(r),gltfResource:e._gltfResource,baseResource:e._baseResource});n.push(o.promise),e._bufferViewLoaders.push(o),i[r]=o}return Promise.all(n).then(function(){let r={};for(let o in i)if(i.hasOwnProperty(o)){let s=i[o],a=new Uint8Array(s.typedArray);r[o]=a}return qce(e),r})}function c7e(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i].properties;l(o)&&l7e(o,t)}return t}function l7e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function u7e(e){let t={},n=e.featureTextures;if(l(n)){for(let i in n)if(n.hasOwnProperty(i)){let o=n[i].properties;l(o)&&f7e(o,t)}}return t}function f7e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let r=e[n].texture;t[r.index]=r}}function d7e(e){let t;l(e._extension)?t=c7e(e._extension):t=u7e(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,r=e._baseResource,o=e._supportedImageFormats,s=e._asynchronous,a=[],c={};for(let u in t)if(t.hasOwnProperty(u)){let f=Ar.loadTexture({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:r,supportedImageFormats:o,asynchronous:s});a.push(f.promise),e._textureLoaders.push(f),c[u]=f}return Promise.all(a).then(function(){let u={};for(let f in c)if(c.hasOwnProperty(f)){let d=c[f];u[f]=d.texture}return u})}function h7e(e){let t=y(e._extension,e._extensionLegacy),n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Ar.loadSchema({resource:i})}else n=Ar.loadSchema({schema:t.schema});return e._schemaLoader=n,n.promise.then(function(i){return i.schema})}mf.prototype.process=function(e){if(this._state!==Vt.LOADING)return;let t=this._textureLoaders,n=t.length;for(let i=0;i<n;++i)t[i].process(e)};function qce(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Ar.unload(t[i]);e._bufferViewLoaders.length=0}function m7e(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Ar.unload(t[i]);e._textureLoaders.length=0}mf.prototype.unload=function(){qce(this),m7e(this),l(this._schemaLoader)&&Ar.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var _b={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};_b.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return _b.TRANSLATION;case"ROTATION":return _b.ROTATION;case"SCALE":return _b.SCALE;case"_FEATURE_ID":return _b.FEATURE_ID}};var Zo=Object.freeze(_b);var p7e=65534,_7e=255;function im(e){e=y(e,y.EMPTY_OBJECT);let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new Kce(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],g7e(this)}Object.defineProperties(im.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function g7e(e){let t=e._triangleIndices,n=e._edges,i=[],r=e._extraVertices,o=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],u=t[a+1],f=t[a+2],d=!1,p=d||n.hasEdge(c,u),g=d||n.hasEdge(u,f),m=d||n.hasEdge(f,c),x=Yce(i,c,u,f,p,g,m);for(;l(x);){let C=s[x];if(!l(C)){C=o+r.length;let A=x;for(;A>=o;)A=r[A-o];r.push(A),s[x]=C}C>p7e&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):C>_7e&&t instanceof Uint8Array&&(t=new Uint16Array(t)),x===c?(c=C,t[a]=C):x===u?(u=C,t[a+1]=C):(f=C,t[a+2]=C),x=Yce(i,c,u,f,p,g,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function Yce(e,t,n,i,r,o,s){let a=s?1:0,c=r?1:0,u=0,f=Y9(e,t,a,c,u);if(f===0)return t;let d=0,p=r?1:0,g=o?1:0,m=Y9(e,n,d,p,g);if(m===0)return n;let x=s?1:0,C=0,A=o?1:0,b=Y9(e,i,x,C,A);if(b===0)return i;let T=f&m&b,S,w,D;if(T&1<<0)S=0,w=1,D=2;else if(T&1<<1)S=0,D=1,w=2;else if(T&1<<2)w=0,S=1,D=2;else if(T&1<<3)w=0,D=1,S=2;else if(T&1<<4)D=0,S=1,w=2;else if(T&1<<5)D=0,w=1,S=2;else{let L=X9(f),_=X9(m),E=X9(b);return L<_&&L<E?t:_<E?n:i}let I=t*3;e[I+S]=a,e[I+w]=c,e[I+D]=u;let O=n*3;e[O+S]=d,e[O+w]=p,e[O+D]=g;let B=i*3;e[B+S]=x,e[B+w]=C,e[B+D]=A}function Y9(e,t,n,i,r){let o=t*3,s=e[o],a=e[o+1],c=e[o+2];return l(s)?(s===n&&a===i&&c===r)<<0|(s===n&&a===r&&c===i)<<1|(s===i&&a===n&&c===r)<<2|(s===i&&a===r&&c===n)<<3|(s===r&&a===n&&c===i)<<4|(s===r&&a===i&&c===n)<<5:63}function X9(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}im.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,r=t.length,o=e.constructor,s=new o(e.length+r*i);s.set(e);for(let a=0;a<r;a++){let c=t[a]*i,u=n+a*i;for(let f=0;f<i;f++)s[u+f]=s[c+f]}return s};im.createTexture=function(e){let t=e.cache.modelOutliningCache;if(l(t)||(t=e.cache.modelOutliningCache={}),l(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,Bt.maximumTextureSize),i=n,r=Xce(i),o=[];for(;i>1;)i>>=1,o.push(Xce(i));let s=new wt({context:e,source:{arrayBufferView:r,mipLevels:o},width:n,height:1,pixelFormat:ct.LUMINANCE,sampler:new on({wrapS:mn.CLAMP_TO_EDGE,wrapT:mn.CLAMP_TO_EDGE,minificationFilter:It.LINEAR_MIPMAP_LINEAR,magnificationFilter:Xi.LINEAR})});return t.outlineTexture=s,s};function Xce(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function Kce(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],r=e[n+1],o=Math.min(i,r),s=Math.max(i,r),a=o*this._originalVertexCount+s;this._edges.add(a)}}Kce.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),r=n*this._originalVertexCount+i;return this._edges.has(r)};function $ce(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function y7e(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function lF(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}lF.prototype.postProcess=function(e){this.needsOutlines&&(x7e(this),A7e(this,e))};function x7e(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,r=new im({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=r.updatedTriangleIndices,n.indexDatatype=Le.fromTypedArray(n.typedArray);let o=C7e(r.outlineCoordinates),s=new $ce(o);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let u=0;u<c;u++){let f=a[u].attribute;f.typedArray=r.updateAttribute(f.typedArray)}}function C7e(e){let t=new kt.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=K.FLOAT,t.type=qt.VEC3,t.normalized=!1,t.count=e.length/3,t}function A7e(e,t){T7e(e.attributePlans,t),l(e.indicesPlan)&&b7e(e.indicesPlan,t)}function T7e(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=r.attribute,s=o.typedArray;if(r.loadBuffer){let a=at.createVertexBuffer({typedArray:s,context:t,usage:Ne.STATIC_DRAW});a.vertexArrayDestroyable=!1,o.buffer=a}r.loadTypedArray||(o.typedArray=void 0)}}function b7e(e,t){let n=e.indices;if(e.loadBuffer){let i=at.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Ne.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}lF.AttributeLoadPlan=$ce;lF.IndicesLoadPlan=y7e;var gb=lF;function Ov(e){e=y(e,y.EMPTY_OBJECT),this.webp=y(e.webp,!1),this.basis=y(e.basis,!1)}var E7e=kt.Attribute,S7e=kt.Indices,Jce=kt.FeatureIdAttribute,Qce=kt.FeatureIdTexture,ele=kt.FeatureIdImplicitRange,w7e=kt.MorphTarget,v7e=kt.Primitive,D7e=kt.Instances,P7e=kt.Skin,I7e=kt.Node,O7e=kt.AnimatedPropertyType,R7e=kt.AnimationSampler,M7e=kt.AnimationTarget,B7e=kt.AnimationChannel,L7e=kt.Animation,N7e=kt.ArticulationStage,F7e=kt.Articulation,V7e=kt.Asset,k7e=kt.Scene,U7e=kt.Components,z7e=kt.MetallicRoughness,H7e=kt.SpecularGlossiness,G7e=kt.Material,ho={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function Ca(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltfResource,n=e.baseResource,i=e.typedArray,r=y(e.releaseGltfJson,!1),o=y(e.asynchronous,!0),s=y(e.incrementallyLoadTextures,!0),a=y(e.upAxis,On.Y),c=y(e.forwardAxis,On.Z),u=y(e.loadAttributesAsTypedArray,!1),f=y(e.loadAttributesFor2D,!1),d=y(e.loadIndicesForWireframe,!1),p=y(e.loadPrimitiveOutline,!0),g=y(e.renameBatchIdSemantic,!1);n=l(n)?n:t.clone(),this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=n,this._typedArray=i,this._releaseGltfJson=r,this._asynchronous=o,this._incrementallyLoadTextures=s,this._upAxis=a,this._forwardAxis=c,this._loadAttributesAsTypedArray=u,this._loadAttributesFor2D=f,this._loadIndicesForWireframe=d,this._loadPrimitiveOutline=p,this._renameBatchIdSemantic=g,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=ho.NOT_LOADED,this._textureState=ho.NOT_LOADED,this._promise=void 0,this._texturesLoadedPromise=void 0,this._process=function(m,x){},this._processTextures=function(m,x){},this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._structuralMetadataLoader=void 0,this._postProcessBuffers=[],this._components=void 0}l(Object.create)&&(Ca.prototype=Object.create(hi.prototype),Ca.prototype.constructor=Ca);Object.defineProperties(Ca.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){}},components:{get:function(){return this._components}},texturesLoadedPromise:{get:function(){return this._texturesLoadedPromise}}});Ca.prototype.load=function(){let e=Ar.loadGltfJson({gltfResource:this._gltfResource,baseResource:this._baseResource,typedArray:this._typedArray,gltfJson:this._gltfJson});this._gltfJsonLoader=e,this._state=ho.LOADING,this._textureState=ho.LOADING;let t=this,n,i=new Promise(function(r,o){n=new Promise(function(s,a){t._process=function(c,u){if(!Et.supportsWebP.initialized){Et.supportsWebP.initialize();return}if(c._state===ho.LOADED){c._state=ho.PROCESSING;let f=new Ov({webp:Et.supportsWebP(),basis:u.context.supportsBasis}),d;l(c._gltfJsonLoader)?d=c._gltfJsonLoader.gltf:d=c._gltfJson,Mje(c,d,f,u,o,a),l(c._gltfJsonLoader)&&c._releaseGltfJson&&(Ar.unload(c._gltfJsonLoader),c._gltfJsonLoader=void 0)}c._state===ho.PROCESSING&&W7e(c,u),c._state===ho.POST_PROCESSING&&(j7e(c,u.context),c._state=ho.PROCESSED),c._state===ho.PROCESSED&&(ule(c),c._state=ho.READY,r(c))},t._processTextures=function(c,u){if(c._textureState===ho.LOADED&&(c._textureState=ho.PROCESSING),c._textureState===ho.PROCESSING){let f,d=c._textureLoaders,p=d.length;for(f=0;f<p;++f)d[f].process(u)}c._textureState===ho.PROCESSED&&(c._textureState=ho.READY,s(c))}})});return this._promise=e.promise.then(function(){if(!t.isDestroyed())return t._state=ho.LOADED,t._textureState=ho.LOADED,i}).catch(function(r){if(!t.isDestroyed())return t._state=ho.FAILED,t._textureState=ho.FAILED,Zce(t,r)}),this._texturesLoadedPromise=n.catch(function(r){if(!t.isDestroyed())return t._textureState=ho.FAILED,Zce(t,r)}),this._promise};function Zce(e,t){e.unload();let n="Failed to load glTF";return t=e.getError(n,t),Promise.reject(t)}function W7e(e,t){let n=e._bufferViewLoaders,i=n.length;for(let s=0;s<i;++s)n[s].process(t);let r=e._geometryLoaders,o=r.length;for(let s=0;s<o;++s)r[s].process(t);l(e._structuralMetadataLoader)&&e._structuralMetadataLoader.process(t)}function j7e(e,t){let n=e._primitiveLoadPlans,i=n.length;for(let r=0;r<i;r++){let o=n[r];o.postProcess(t),o.needsOutlines&&q7e(e,o)}}function q7e(e,t){let n=e._postProcessBuffers,i=t.primitive,r=i.outlineCoordinates;l(r)&&n.push(r.buffer);let o=i.attributes,s=o.length;for(let c=0;c<s;c++){let u=o[c];l(u.buffer)&&n.push(u.buffer)}let a=i.indices;l(a)&&l(a.buffer)&&n.push(a.buffer)}Ca.prototype.process=function(e){this._process(this,e),this._processTextures(this,e)};function Y7e(e,t,n,i,r,o,s,a){let u=t.accessors[n].bufferView,f=Ar.loadVertexBuffer({gltf:t,gltfResource:e._gltfResource,baseResource:e._baseResource,bufferViewId:u,draco:r,attributeSemantic:i,accessorId:n,asynchronous:e._asynchronous,dequantize:o,loadBuffer:s,loadTypedArray:a});return e._geometryLoaders.push(f),f}function X7e(e,t,n,i,r,o){let s=Ar.loadIndexBuffer({gltf:t,accessorId:n,gltfResource:e._gltfResource,baseResource:e._baseResource,draco:i,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:o});return e._geometryLoaders.push(s),s}function K7e(e,t,n){let i=Ar.loadBufferView({gltf:t,bufferViewId:n,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(i),i}function tle(e,t,n){let i=t.byteOffset,r=_s(e,t),o=t.count,s=ps(t.type),a=t.componentType,c=K.getSizeInBytes(a),u=c*s,f=o*s;if(r===u)return n=new Uint8Array(n),K.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let d=K.createTypedArray(a,f),p=new DataView(n.buffer),g=new Array(s),m=Ag(t.componentType);i=n.byteOffset+i;for(let x=0;x<o;++x){m(p,i,s,c,g);for(let C=0;C<s;++C)d[x*s+C]=g[C];i+=r}return d}function $7e(e,t){let n=e.type;if(n===qt.SCALAR)return t.fill(0);let i=qt.getMathType(n);return t.fill(i.clone(i.ZERO))}function Z7e(e,t,n,i){let r=e.type,o=e.count;if(r===qt.SCALAR)for(let s=0;s<o;s++)n[s]=t[s];else if(r===qt.VEC4&&i)for(let s=0;s<o;s++)n[s]=Re.unpack(t,s*4);else{let s=qt.getMathType(r),a=qt.getNumberOfComponents(r);for(let c=0;c<o;c++)n[c]=s.unpack(t,c*a)}return n}function uF(e,t,n,i){let r=t.accessors[n],o=r.count,s=new Array(o),a=r.bufferView;if(l(a)){let u=K7e(e,t,a).promise.then(function(f){if(e.isDestroyed())return;let d=f.typedArray,p=tle(t,r,d);i=y(i,!1),Z7e(r,p,s,i)});return e._loaderPromises.push(u),s}return $7e(r,s)}function rm(e,t){if(!!l(t))return e===Number?t[0]:e.unpack(t)}function J7e(e){return e===Number?0:new e}function Q7e(e,t,n,i,r){let o=e.accessors[t],s=qt.getMathType(o.type),a=new E7e;return a.name=n,a.semantic=i,a.setIndex=r,a.constant=J7e(s),a.componentDatatype=o.componentType,a.normalized=y(o.normalized,!1),a.count=o.count,a.type=o.type,a.min=rm(s,o.min),a.max=rm(s,o.max),a.byteOffset=o.byteOffset,a.byteStride=_s(e,o),a}function nle(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var eje={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function ile(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let r=t.fromGltfSemantic(i),o=eje;return o.gltfSemantic=n,o.renamedSemantic=i,o.modelSemantic=r,o}function tje(e,t,n,i){e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i&&(e.typedArray=K.createArrayBufferView(t.quantization.componentDatatype,t.typedArray.buffer))}function nje(e,t,n,i,r,o){if(r&&(n.buffer=i.buffer),o){let s=i.typedArray;n.typedArray=tle(e,t,s),n.byteOffset=0,n.byteStride=void 0}}function rle(e,t,n,i,r,o,s,a){let c=t.accessors[n],u=c.bufferView,f=i.gltfSemantic,d=i.renamedSemantic,p=i.modelSemantic,g=l(p)?nle(d):void 0,x=Q7e(t,n,f,p,g);if(!l(r)&&!l(u))return x;let A=Y7e(e,t,n,f,r,o,s,a).promise.then(function(b){e.isDestroyed()||(l(r)&&l(r.attributes)&&l(r.attributes[f])?tje(x,b,s,a):nje(t,c,x,b,s,a))});return e._loaderPromises.push(A),x}function ole(e,t,n,i,r,o,s,a){let c=ile(e,jt,i),d=c.modelSemantic===jt.POSITION&&!o&&e._loadAttributesFor2D&&!a.scene3DOnly,p=e._loadAttributesAsTypedArray,g=!p,m=p||d,A=rle(e,t,n,c,r,!1,s?!1:g,s?!0:m),b=new gb.AttributeLoadPlan(A);return b.loadBuffer=g,b.loadTypedArray=m,b}function ije(e,t,n,i,r,o){let s=l(i.ROTATION),a=l(i.TRANSLATION)&&l(t.accessors[i.TRANSLATION].min)&&l(t.accessors[i.TRANSLATION].max),c=ile(e,Zo,r),u=c.modelSemantic,f=u===Zo.TRANSLATION||u===Zo.ROTATION||u===Zo.SCALE,p=u===Zo.TRANSLATION&&e._loadAttributesFor2D&&!o.scene3DOnly,g=e._loadAttributesAsTypedArray||(s||!a)&&f||u===Zo.FEATURE_ID||!o.context.instancedArrays,m=!g;return g=g||p,rle(e,t,n,c,void 0,!0,m,g)}function rje(e,t,n,i,r,o){let s=t.accessors[n],a=s.bufferView;if(!l(i)&&!l(a))return;let c=new S7e;c.count=s.count;let u=e._loadAttributesAsTypedArray,f=e._loadIndicesForWireframe&&!o.context.webgl2,d=!u,p=u||f,C=X7e(e,t,n,i,r?!1:d,r?!0:p).promise.then(function(b){e.isDestroyed()||(c.indexDatatype=b.indexDatatype,c.buffer=b.buffer,c.typedArray=b.typedArray)});e._loaderPromises.push(C);let A=new gb.IndicesLoadPlan(c);return A.loadBuffer=d,A.loadTypedArray=p,A}function kp(e,t,n,i,r){let o=nu.getImageIdFromTexture({gltf:t,textureId:n.index,supportedImageFormats:i});if(!l(o))return;let s=Ar.loadTexture({gltf:t,textureInfo:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:i,asynchronous:e._asynchronous});e._textureLoaders.push(s);let a=nu.createModelTextureReader({textureInfo:n}),c=s.promise.then(function(u){e.isUnloaded()||e.isDestroyed()||(a.texture=u.texture,l(r)&&(a.texture.sampler=r))});return e._texturesPromises.push(c),a}function oje(e,t,n,i){let r=new G7e,o=y(n.extensions,y.EMPTY_OBJECT),s=o.KHR_materials_pbrSpecularGlossiness,a=n.pbrMetallicRoughness;if(r.unlit=l(o.KHR_materials_unlit),l(s)){let c=new H7e;r.specularGlossiness=c,l(s.diffuseTexture)&&(c.diffuseTexture=kp(e,t,s.diffuseTexture,i)),l(s.specularGlossinessTexture)&&l(s.specularGlossinessTexture)&&(c.specularGlossinessTexture=kp(e,t,s.specularGlossinessTexture,i)),c.diffuseFactor=rm(se,s.diffuseFactor),c.specularFactor=rm(h,s.specularFactor),c.glossinessFactor=s.glossinessFactor,r.pbrSpecularGlossiness=s}else if(l(a)){let c=new z7e;l(a.baseColorTexture)&&(c.baseColorTexture=kp(e,t,a.baseColorTexture,i)),l(a.metallicRoughnessTexture)&&(c.metallicRoughnessTexture=kp(e,t,a.metallicRoughnessTexture,i)),c.baseColorFactor=rm(se,a.baseColorFactor),c.metallicFactor=a.metallicFactor,c.roughnessFactor=a.roughnessFactor,r.metallicRoughness=c}return l(n.emissiveTexture)&&(r.emissiveTexture=kp(e,t,n.emissiveTexture,i)),l(n.normalTexture)&&(r.normalTexture=kp(e,t,n.normalTexture,i)),l(n.occlusionTexture)&&(r.occlusionTexture=kp(e,t,n.occlusionTexture,i)),r.emissiveFactor=rm(h,n.emissiveFactor),r.alphaMode=n.alphaMode,r.alphaCutoff=n.alphaCutoff,r.doubleSided=n.doubleSided,r}function sle(e,t){let n=new Jce;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function ale(e,t,n,i){let r=new Jce,o=e.featureIds;return r.featureCount=n,r.propertyTableId=t,r.setIndex=nle(o.attribute),r.positionalLabel=i,r}function cle(e,t){let n=new ele;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function lle(e,t,n,i){let r=new ele,o=e.featureIds;r.propertyTableId=t,r.featureCount=n,r.offset=y(o.constant,0);let s=y(o.divisor,0);return r.repeat=s===0?void 0:s,r.positionalLabel=i,r}function sje(e,t,n,i,r){let o=new Qce;o.featureCount=n.featureCount,o.nullFeatureId=n.nullFeatureId,o.propertyTableId=n.propertyTable,o.label=n.label,o.positionalLabel=r;let s=n.texture;o.textureReader=kp(e,t,s,i,on.NEAREST);let c=(l(s.channels)?s.channels:[0]).map(function(u){return"rgba".charAt(u)}).join("");return o.textureReader.channels=c,o}function aje(e,t,n,i,r,o,s){let a=new Qce,c=n.featureIds,u=c.texture;return a.featureCount=o,a.propertyTableId=i,a.textureReader=kp(e,t,u,r,on.NEAREST),a.textureReader.channels=c.channels,a.positionalLabel=s,a}function cje(e,t,n,i,r,o){let s=new w7e,a=void 0,c=!1;for(let u in n)if(n.hasOwnProperty(u)){let f=n[u],d=ole(e,t,f,u,a,c,i,o);s.attributes.push(d.attribute),r.attributePlans.push(d)}return s}function lje(e,t,n,i,r,o){let s=new v7e,a=new gb(s);e._primitiveLoadPlans.push(a);let c=n.material;l(c)&&(s.material=oje(e,t,t.materials[c],r));let u=y(n.extensions,y.EMPTY_OBJECT),f=!1,d=u.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(f=!0,a.needsOutlines=!0,a.outlineIndices=uje(e,t,d,a));let p=u.KHR_draco_mesh_compression,g=n.attributes;if(l(g)){for(let S in g)if(g.hasOwnProperty(S)){let w=g[S],D=ole(e,t,w,S,p,i,f,o);a.attributePlans.push(D),s.attributes.push(D.attribute)}}let m=n.targets;if(l(m)){let S=m.length;for(let w=0;w<S;++w)s.morphTargets.push(cje(e,t,m[w],f,a,o))}let x=n.indices;if(l(x)){let S=rje(e,t,x,p,f,o);l(S)&&(a.indicesPlan=S,s.indices=S.indices)}let C=u.EXT_structural_metadata,A=u.EXT_mesh_features,b=u.EXT_feature_metadata,T=l(b);return l(A)?fje(e,t,s,A,r):T&&dje(e,t,s,b,r),l(C)?hje(s,C):T&&mje(e,s,b),s.primitiveType=n.mode,s}function uje(e,t,n){let i=n.indices;return uF(e,t,i,!1)}function fje(e,t,n,i,r){let o;l(i)&&l(i.featureIds)?o=i.featureIds:o=[];for(let s=0;s<o.length;s++){let a=o[s],c=`featureId_${s}`,u;l(a.texture)?u=sje(e,t,a,r,c):l(a.attribute)?u=sle(a,c):u=cle(a,c),n.featureIds.push(u)}}function dje(e,t,n,i,r){let o=t.extensions.EXT_feature_metadata.featureTables,s=0,a=i.featureIdAttributes;if(l(a)){let u=a.length;for(let f=0;f<u;++f){let d=a[f],p=d.featureTable,g=e._sortedPropertyTableIds.indexOf(p),m=o[p].count,x=`featureId_${s}`;s++;let C;l(d.featureIds.attribute)?C=ale(d,g,m,x):C=lle(d,g,m,x),n.featureIds.push(C)}}let c=i.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let d=c[f],p=d.featureTable,g=e._sortedPropertyTableIds.indexOf(p),m=o[p].count,x=`featureId_${s}`;s++;let C=aje(e,t,d,g,r,m,x);n.featureIds.push(C)}}}function hje(e,t){!l(t)||(l(t.propertyTextures)&&(e.propertyTextureIds=t.propertyTextures),l(t.propertyAttributes)&&(e.propertyAttributeIds=t.propertyAttributes))}function mje(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function pje(e,t,n,i){let r=n.EXT_mesh_gpu_instancing,o=new D7e,s=r.attributes;if(l(s)){for(let f in s)if(s.hasOwnProperty(f)){let d=s[f];o.attributes.push(ije(e,t,d,s,f,i))}}let a=y(r.extensions,y.EMPTY_OBJECT),c=n.EXT_instance_features,u=a.EXT_feature_metadata;return l(c)?_je(o,c):l(u)&&gje(t,o,u,e._sortedPropertyTableIds),o}function _je(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let r=n[i],o=`instanceFeatureId_${i}`,s;l(r.attribute)?s=sle(r,o):s=cle(r,o),e.featureIds.push(s)}}function gje(e,t,n,i){let r=e.extensions.EXT_feature_metadata.featureTables,o=n.featureIdAttributes;if(l(o)){let s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.featureTable,f=i.indexOf(u),d=r[u].count,p=`instanceFeatureId_${a}`,g;l(c.featureIds.attribute)?g=ale(c,f,d,p):g=lle(c,f,d,p),t.featureIds.push(g)}}}function yje(e,t,n,i,r){let o=new I7e;o.name=n.name,o.matrix=rm(N,n.matrix),o.translation=rm(h,n.translation),o.rotation=rm(Re,n.rotation),o.scale=rm(h,n.scale);let s=y(n.extensions,y.EMPTY_OBJECT),a=s.EXT_mesh_gpu_instancing,c=s.AGI_articulations;l(a)&&(o.instances=pje(e,t,s,r)),l(c)&&(o.articulationName=c.articulationName);let u=n.mesh;if(l(u)){let f=t.meshes[u],d=f.primitives,p=d.length;for(let C=0;C<p;++C)o.primitives.push(lje(e,t,d[C],l(o.instances),i,r));let g=y(n.weights,f.weights),x=o.primitives[0].morphTargets.length;o.morphWeights=l(g)?g.slice():new Array(x).fill(0)}return o}function xje(e,t,n,i){let r,o,s=t.nodes.length,a=new Array(s);for(r=0;r<s;++r){let c=yje(e,t,t.nodes[r],n,i);c.index=r,a[r]=c}for(r=0;r<s;++r){let c=t.nodes[r].children;if(l(c)){let u=c.length;for(o=0;o<u;++o)a[r].children.push(a[c[o]])}}return a}function Cje(e,t,n,i){let r=new P7e,o=n.joints,s=o.length,a=new Array(s);for(let u=0;u<s;++u)a[u]=i[o[u]];r.joints=a;let c=n.inverseBindMatrices;return l(c)?r.inverseBindMatrices=uF(e,t,c):r.inverseBindMatrices=new Array(s).fill(N.IDENTITY),r}function Aje(e,t,n){let i,r=t.skins;if(!l(r))return[];let o=t.skins.length,s=new Array(o);for(i=0;i<o;++i){let c=Cje(e,t,t.skins[i],n);c.index=i,s[i]=c}let a=n.length;for(i=0;i<a;++i){let c=t.nodes[i].skin;l(c)&&(n[i].skin=s[c])}return s}function Tje(e,t,n,i,r){let o=new mf({gltf:t,extension:n,extensionLegacy:i,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:r,asynchronous:e._asynchronous});return o.load(),e._structuralMetadataLoader=o,o}function bje(e,t,n){let i=new R7e,r=n.input;i.input=uF(e,t,r);let o=n.interpolation;i.interpolation=y(Bh[o],Bh.LINEAR);let s=n.output;return i.output=uF(e,t,s,!0),i}function Eje(e,t){let n=new M7e,i=e.node;if(!l(i))return;n.node=t[i];let r=e.path.toUpperCase();return n.path=O7e[r],n}function Sje(e,t,n){let i=new B7e,r=e.sampler;return i.sampler=t[r],i.target=Eje(e.target,n),i}function wje(e,t,n,i){let r,o=new L7e;o.name=n.name;let s=n.samplers,a=s.length,c=new Array(a);for(r=0;r<a;r++){let p=bje(e,t,s[r]);p.index=r,c[r]=p}let u=n.channels,f=u.length,d=new Array(f);for(r=0;r<f;r++)d[r]=Sje(u[r],c,i);return o.samplers=c,o.channels=d,o}function vje(e,t,n){let i,r=t.animations;if(!l(r))return[];let o=t.animations.length,s=new Array(o);for(i=0;i<o;++i){let a=wje(e,t,t.animations[i],n);a.index=i,s[i]=a}return s}function Dje(e){let t=new N7e;t.name=e.name;let n=e.type.toUpperCase();return t.type=_c[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function Pje(e){let t=new F7e;t.name=e.name;let n=e.stages,i=n.length,r=new Array(i);for(let o=0;o<i;o++){let s=Dje(n[o]);r[o]=s}return t.stages=r,t}function Ije(e){let n=y(e.extensions,y.EMPTY_OBJECT).AGI_articulations;if(!l(n))return[];let i=n.articulations;if(!l(i))return[];let r=i.length,o=new Array(r);for(let s=0;s<r;s++){let a=Pje(i[s]);o[s]=a}return o}function Oje(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=y(t,e.nodes),t=l(t)?t:[],t}function Rje(e,t){let n=new k7e,i=Oje(e);return n.nodes=i.map(function(r){return t[r]}),n}function Mje(e,t,n,i,r,o){let s=y(t.extensions,y.EMPTY_OBJECT),a=s.EXT_structural_metadata,c=s.EXT_feature_metadata;if(l(c)){let b=c.featureTables,T=c.featureTextures,S=l(b)?b:[],w=l(T)?T:[];e._sortedPropertyTableIds=Object.keys(S).sort(),e._sortedFeatureTextureIds=Object.keys(w).sort()}let u=xje(e,t,n,i),f=Aje(e,t,u),d=vje(e,t,u),p=Ije(t),g=Rje(t,u),m=new U7e,x=new V7e,C=t.asset.copyright;if(l(C)){let b=C.split(";").map(function(T){return new Gt(T.trim())});x.credits=b}if(m.asset=x,m.scene=g,m.nodes=u,m.skins=f,m.animations=d,m.articulations=p,m.upAxis=e._upAxis,m.forwardAxis=e._forwardAxis,e._components=m,l(a)||l(c)){let T=Tje(e,t,a,c,n).promise.then(function(S){e.isDestroyed()||(m.structuralMetadata=S.structuralMetadata)});e._loaderPromises.push(T)}let A=[];A.push.apply(A,e._loaderPromises),e._incrementallyLoadTextures||A.push.apply(A,e._texturesPromises),Promise.all(A).then(function(){e.isDestroyed()||(e._state=ho.POST_PROCESSING)}).catch(r),Promise.all(e._texturesPromises).then(function(){e.isDestroyed()||(e._textureState=ho.PROCESSED)}).catch(o)}function Bje(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Ar.unload(t[i]);e._textureLoaders.length=0}function ule(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Ar.unload(t[i]);e._bufferViewLoaders.length=0}function Lje(e){let t=e._geometryLoaders,n=t.length;for(let i=0;i<n;++i)Ar.unload(t[i]);e._geometryLoaders.length=0}function Nje(e){let t=e._postProcessBuffers,n=t.length;for(let i=0;i<n;i++){let r=t[i];r.isDestroyed()||r.destroy()}t.length=0}function Fje(e){l(e._structuralMetadataLoader)&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}Ca.prototype.isUnloaded=function(){return this._state===ho.UNLOADED};Ca.prototype.unload=function(){l(this._gltfJsonLoader)&&Ar.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,Bje(this),ule(this),Lje(this),Nje(this),Fje(this),this._components=void 0,this._state=ho.UNLOADED};var Cx=kt.AnimatedPropertyType;function $9(e){e=y(e,y.EMPTY_OBJECT);let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,Uje(this)}Object.defineProperties($9.prototype,{channel:{get:function(){return this._channel}},runtimeAnimation:{get:function(){return this._runtimeAnimation}},runtimeNode:{get:function(){return this._runtimeNode}},splines:{get:function(){return this._splines}}});function Vje(e,t){let n=[],i=[],r=[],o=t.length;for(let s=0;s<o;s+=3)i.push(t[s]),n.push(t[s+1]),r.push(t[s+2]);return i.splice(0,1),r.length=r.length-1,new _y({times:e,points:n,inTangents:i,outTangents:r})}function fle(e,t,n,i){if(e.length===1&&t.length===1)return new vA(t[0]);switch(n){case Bh.STEP:return new ZO({times:e,points:t});case Bh.CUBICSPLINE:return Vje(e,t);case Bh.LINEAR:return i===Cx.ROTATION?new iT({times:e,points:t}):new jm({times:e,points:t})}}function kje(e,t,n,i,r){let o=[];if(i===Cx.WEIGHTS){let a=t.length/r,c,u;for(c=0;c<r;c++){let f=new Array(a),d=c;if(n===Bh.CUBICSPLINE)for(u=0;u<a;u+=3)f[u]=t[d],f[u+1]=t[d+r],f[u+2]=t[d+2*r],d+=r*3;else for(u=0;u<a;u++)f[u]=t[d],d+=r;o.push(fle(e,f,n,i))}}else o.push(fle(e,t,n,i));return o}var K9;function Uje(e){let t=e._channel,n=t.sampler,i=n.input,r=n.output,o=n.interpolation,a=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=kje(i,r,o,a,u);switch(e._splines=f,e._path=a,a){case Cx.TRANSLATION:case Cx.SCALE:K9=new h;break;case Cx.ROTATION:K9=new Re;break;case Cx.WEIGHTS:break}}$9.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,r=this._runtimeNode;if(n===Cx.WEIGHTS){let o=r.morphWeights,s=o.length;for(let a=0;a<s;a++){let c=t[a],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);o[a]=c.evaluate(u)}}else{if(r.userAnimated)return;{let o=t[0],s=i.clampAnimations?o.clampTime(e):o.wrapTime(e);r[n]=o.evaluate(s,K9)}}};var fF=$9;function Z9(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=ee.clone(n.startTime),this._delay=y(n.delay,0),this._stopTime=ee.clone(n.stopTime),this.removeOnStop=y(n.removeOnStop,!1),this._multiplier=y(n.multiplier,1),this._reverse=y(n.reverse,!1),this._loop=y(n.loop,Xr.NONE),this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new ge,this.update=new ge,this.stop=new ge,this._state=Ws.STOPPED,this._computedStartTime=void 0,this._duration=void 0;let i=this;this._raiseStartEvent=function(){i.start.raiseEvent(e,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(e,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(e,i)},this._model=e,this._localStartTime=void 0,this._localStopTime=void 0,zje(this)}Object.defineProperties(Z9.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},animationTime:{get:function(){return this._animationTime}}});function zje(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,o=e._animation.channels,s=o.length,a=[];for(let c=0;c<s;c++){let u=o[c],f=u.target;if(!l(f))continue;let d=f.node.index,p=i._runtimeNodes[d],g=new fF({channel:u,runtimeAnimation:e,runtimeNode:p}),m=u.sampler.input;t=Math.min(t,m[0]),n=Math.max(n,m[m.length-1]),a.push(g)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}Z9.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var dF=Z9;function Up(e){this.animationAdded=new ge,this.animationRemoved=new ge,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(Up.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function J9(e,t,n){let i=e._model,r=new dF(i,t,n);return e._runtimeAnimations.push(r),e.animationAdded.raiseEvent(i,r),r}Up.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return J9(this,n[i],e);let r=n.length;for(let o=0;o<r;++o)if(n[o].name===e.name){i=o;break}return J9(this,n[i],e)};Up.prototype.addAll=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=[],r=n.length;for(let o=0;o<r;++o){let s=J9(this,n[o],e);i.push(s)}return i};Up.prototype.remove=function(e){if(!l(e))return!1;let t=this._runtimeAnimations,n=t.indexOf(e);return n!==-1?(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0):!1};Up.prototype.removeAll=function(){let e=this._model,t=this._runtimeAnimations,n=t.length;this._runtimeAnimations.length=0;for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])};Up.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};Up.prototype.get=function(e){return this._runtimeAnimations[e]};var hF=[];function Hje(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}Up.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&ee.equals(e.time,this._previousTime))return!1;this._previousTime=ee.clone(e.time,this._previousTime);let i=!1,r=e.time,o=this._model;for(let s=0;s<n;++s){let a=t[s];l(a._computedStartTime)||(a._computedStartTime=ee.addSeconds(y(a.startTime,r),a.delay,new ee)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,u=a._duration,f=a.stopTime,d=ee.lessThanOrEquals(c,r),p=l(f)&&ee.greaterThan(r,f),g=0;if(u!==0){let C=ee.secondsDifference(p?f:r,c);g=l(a._animationTime)?a._animationTime(u,C):C/u}let m=a.loop===Xr.REPEAT||a.loop===Xr.MIRRORED_REPEAT,x=(d||m&&!l(a.startTime))&&(g<=1||m)&&!p;if(g===a._prevAnimationDelta){let C=a._state===Ws.STOPPED;if(x!==C)continue}if(a._prevAnimationDelta=g,x||a._state===Ws.ANIMATING){if(x&&a._state===Ws.STOPPED&&(a._state=Ws.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Xr.REPEAT)g=g-Math.floor(g);else if(a.loop===Xr.MIRRORED_REPEAT){let A=Math.floor(g),b=g-A;g=A%2===1?1-b:b}a.reverse&&(g=1-g);let C=g*u*a.multiplier;C=M.clamp(C,a.localStartTime,a.localStopTime),a.animate(C),a.update.numberOfListeners>0&&(a._updateEventTime=C,e.afterRender.push(a._raiseUpdateEvent)),i=!0,x||(a._state=Ws.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&hF.push(a))}}n=hF.length;for(let s=0;s<n;++s){let a=hF[s];t.splice(t.indexOf(a),1),e.afterRender.push(Hje(this,o,a))}return hF.length=0,i};var mF=Up;var Rv={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Rv.getStyleCommandsNeeded=function(e,t){return t===0?Rv.ALL_OPAQUE:t===e?Rv.ALL_TRANSLUCENT:Rv.OPAQUE_AND_TRANSLUCENT};var Mc=Object.freeze(Rv);function Mv(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=y(e.useSilhouetteCommands,!1);this._command=t,this._translucentCommand=void 0,this._modelMatrix=N.clone(t.modelMatrix,new N),this._modelMatrix2DDirty=!1,this._styleCommandsNeeded=n.styleCommandsNeeded,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=n.model.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._useSilhouetteCommands=i,this._commandList=[],this._commandList2D=[],this._silhouetteCommandList=[],this._silhouetteCommandList2D=[],this._runtimePrimitive=n.runtimePrimitive,this._model=n.model,Gje(this)}function Gje(e){let t=e._command,n=e._styleCommandsNeeded;if(l(n)&&t.pass!==Ce.TRANSLUCENT){let i=Jje(t);switch(n){case Mc.ALL_OPAQUE:break;case Mc.ALL_TRANSLUCENT:case Mc.OPAQUE_AND_TRANSLUCENT:e._translucentCommand=i;break}}Wje(e)}Object.defineProperties(Mv.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=N.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,qje(this)}},boundingVolume:{get:function(){return this._command.boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,Xje(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,Kje(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,$je(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,Zje(this))}}});function Wje(e){let t=e._commandList,n=e._commandList2D;t.length=0,n.length=0;let i=e._styleCommandsNeeded,r=e._command,o=e._translucentCommand;if(l(i)&&l(o))switch(i){case Mc.ALL_OPAQUE:t.push(r);break;case Mc.ALL_TRANSLUCENT:t.push(o);break;case Mc.OPAQUE_AND_TRANSLUCENT:t.push(r,o);break}else t.push(r);if(e._useSilhouetteCommands){let s=t.length,a=[],c=e._model;for(let f=0;f<s;f++){let d=t[f],p=Qje(d,c),g=eqe(d,c);t[f]=p,a.push(g)}let u=e._silhouetteCommandList;u.push.apply(u,a)}}var jje=new N;function qje(e){let t=e.modelMatrix,n=e.runtimePrimitive.boundingSphere,i=e._commandList,r=i.length;for(let s=0;s<r;s++){let a=i[s];a.modelMatrix=N.clone(t,a.modelMatrix),a.boundingVolume=re.transform(n,a.modelMatrix,a.boundingVolume)}if(!e._useSilhouetteCommands)return;let o=e._silhouetteCommandList;for(let s=0;s<r;s++){let a=o[s];a.modelMatrix=N.clone(t,a.modelMatrix),a.boundingVolume=re.transform(n,a.modelMatrix,a.boundingVolume)}}function Yje(e,t){let n=e.modelMatrix,i=e.runtimePrimitive.boundingSphere,r=e._commandList2D,o=r.length;if(o===0)return;let s=N.clone(n,jje);s[13]-=M.sign(n[13])*2*M.PI*t.mapProjection.ellipsoid.maximumRadius;for(let c=0;c<o;c++){let u=r[c];u.modelMatrix=N.clone(s,u.modelMatrix),u.boundingVolume=re.transform(i,u.modelMatrix,u.boundingVolume)}if(!e._useSilhouetteCommands)return;let a=e._silhouetteCommandList2D;for(let c=0;c<o;c++){let u=a[c];u.modelMatrix=N.clone(s,u.modelMatrix),u.boundingVolume=re.transform(i,u.modelMatrix,u.boundingVolume)}}function Xje(e){let t=e.shadows,n=Zt.castShadows(t),i=Zt.receiveShadows(t),r=e.getAllCommands(),o=r.length;for(let s=0;s<o;s++){let a=r[s],c=a.uniformMap.model_silhouettePass;l(c)&&c()||(a.castShadows=n,a.receiveShadows=i)}}function Kje(e){let t=e.backFaceCulling,n=e.runtimePrimitive.primitive.material.doubleSided,i=e._model.isTranslucent(),r=e._useSilhouetteCommands;t=t&&!n&&!i&&!r;let o=e.getAllCommands(),s=o.length;for(let a=0;a<s;a++){let c=o[a];if(c.pass===Ce.TRANSLUCENT)continue;let u=$e(c.renderState,!0);u.cull.enabled=t,c.renderState=Ve.fromCache(u)}}function $je(e){let t=e.cullFace,n=e.getAllCommands(),i=n.length;for(let r=0;r<i;r++){let o=n[r],s=$e(o.renderState,!0);s.cull.face=t,o.renderState=Ve.fromCache(s)}}function Zje(e){let t=e.debugShowBoundingVolume,n=e.getAllCommands(),i=n.length;for(let r=0;r<i;r++){let o=n[r];o.debugShowBoundingVolume=t}}Mv.prototype.getCommands=function(e){let t=this._commandList,n=this._commandList2D,i=hle(this,e);if(i&&n.length===0){let o=t.length;for(let s=0;s<o;s++){let a=dle(t[s]);n.push(a)}if(this._useSilhouetteCommands){let s=this._silhouetteCommandList,a=this._silhouetteCommandList2D;for(let c=0;c<o;c++){let u=dle(s[c]);a.push(u)}}this._modelMatrix2DDirty=!0}this._modelMatrix2DDirty&&(Yje(this,e),this._modelMatrix2DDirty=!1);let r=[];return r.push.apply(r,t),i&&r.push.apply(r,n),r};Mv.prototype.getSilhouetteCommands=function(e){if(!this._useSilhouetteCommands)return[];let t=[],n=this._silhouetteCommandList,i=this._silhouetteCommandList2D;return t.push.apply(t,n),hle(this,e)&&t.push.apply(t,i),t};Mv.prototype.getAllCommands=function(){let e=[];return e.push.apply(e,this._commandList),e.push.apply(e,this._commandList2D),e.push.apply(e,this._silhouetteCommandList),e.push.apply(e,this._silhouetteCommandList2D),e};function Jje(e){let t=Ze.shallowClone(e);t.pass=Ce.TRANSLUCENT;let n=$e(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=hn.ALPHA_BLEND,t.renderState=Ve.fromCache(n),t}function dle(e){let t=Ze.shallowClone(e);return t.modelMatrix=new N,t.boundingVolume=new re,t}function Qje(e,t){let n=t._silhouetteId%255,i=Ze.shallowClone(e),r=$e(e.renderState,!0);return r.stencilTest={enabled:!0,frontFunction:Z.ALWAYS,backFunction:Z.ALWAYS,reference:n,mask:-1,frontOperation:{fail:Z.KEEP,zFail:Z.KEEP,zPass:Z.REPLACE},backOperation:{fail:Z.KEEP,zFail:Z.KEEP,zPass:Z.REPLACE}},t.isInvisible()&&(r.colorMask={red:!1,green:!1,blue:!1,alpha:!1},r.depthMask=!1),r=Ve.fromCache(r),i.renderState=r,i}function eqe(e,t){let n=t._silhouetteId%255,i=Ze.shallowClone(e),r=$e(e.renderState,!0);r.depthTest.enabled=!0,r.cull.enabled=!1,(e.pass===Ce.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Ce.TRANSLUCENT,r.depthMask=!1,r.blending=hn.ALPHA_BLEND),r.stencilTest={enabled:!0,frontFunction:Z.NOTEQUAL,backFunction:Z.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:Z.KEEP,zFail:Z.KEEP,zPass:Z.KEEP},backOperation:{fail:Z.KEEP,zFail:Z.KEEP,zPass:Z.KEEP}},r=Ve.fromCache(r);let s=$e(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=r,i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function hle(e,t){if(t.mode!==te.SCENE2D||e.model._projectTo2D)return!1;let n=t.mapProjection.ellipsoid.maximumRadius*M.PI,r=e.model.sceneGraph._boundingSphere2D,o=r.center.y-r.radius,s=r.center.y+r.radius;return o<n&&s>n||o<-n&&s>-n}var pF=Mv;var _F=`#if defined(HAS_NORMALS) && !defined(HAS_TANGENTS) && !defined(LIGHTING_UNLIT)
- #ifdef GL_OES_standard_derivatives
- #extension GL_OES_standard_derivatives : enable
- #endif
- #endif
- czm_modelMaterial defaultModelMaterial()
- {
- czm_modelMaterial material;
- material.diffuse = vec3(0.0);
- material.specular = vec3(1.0);
- material.roughness = 1.0;
- material.occlusion = 1.0;
- material.normalEC = vec3(0.0, 0.0, 1.0);
- material.emissive = vec3(0.0);
- material.alpha = 1.0;
- return material;
- }
- vec4 handleAlpha(vec3 color, float alpha)
- {
- #ifdef ALPHA_MODE_MASK
- if (alpha < u_alphaCutoff) {
- discard;
- }
- #endif
- return vec4(color, alpha);
- }
- SelectedFeature selectedFeature;
- void main()
- {
- #ifdef HAS_MODEL_SPLITTER
- modelSplitterStage();
- #endif
- czm_modelMaterial material = defaultModelMaterial();
- ProcessedAttributes attributes;
- geometryStage(attributes);
- FeatureIds featureIds;
- featureIdStage(featureIds, attributes);
- Metadata metadata;
- MetadataClass metadataClass;
- metadataStage(metadata, metadataClass, attributes);
- #ifdef HAS_SELECTED_FEATURE_ID
- selectedFeatureIdStage(selectedFeature, featureIds);
- #endif
- #ifndef CUSTOM_SHADER_REPLACE_MATERIAL
- materialStage(material, attributes, selectedFeature);
- #endif
- #ifdef HAS_CUSTOM_FRAGMENT_SHADER
- customShaderStage(material, attributes, featureIds, metadata, metadataClass);
- #endif
- lightingStage(material, attributes);
- #ifdef HAS_SELECTED_FEATURE_ID
- cpuStylingStage(material, selectedFeature);
- #endif
- #ifdef HAS_MODEL_COLOR
- modelColorStage(material);
- #endif
- #ifdef HAS_PRIMITIVE_OUTLINE
- primitiveOutlineStage(material);
- #endif
- vec4 color = handleAlpha(material.diffuse, material.alpha);
- #ifdef HAS_CLIPPING_PLANES
- modelClippingPlanesStage(color);
- #endif
- #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS)
- silhouetteStage(color);
- #endif
- gl_FragColor = color;
- }
- `;var gF=`precision highp float;
- czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) {
- czm_modelVertexOutput vsOutput;
- vsOutput.positionMC = positionMC;
- vsOutput.pointSize = 1.0;
- return vsOutput;
- }
- void main()
- {
- ProcessedAttributes attributes;
- initializeAttributes(attributes);
- #ifdef USE_DEQUANTIZATION
- dequantizationStage(attributes);
- #endif
- #ifdef HAS_MORPH_TARGETS
- morphTargetsStage(attributes);
- #endif
- #ifdef HAS_SKINNING
- skinningStage(attributes);
- #endif
- #ifdef HAS_PRIMITIVE_OUTLINE
- primitiveOutlineStage();
- #endif
- #ifdef HAS_BITANGENTS
- attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC);
- #endif
- FeatureIds featureIds;
- featureIdStage(featureIds, attributes);
- #ifdef HAS_SELECTED_FEATURE_ID
- SelectedFeature feature;
- selectedFeatureIdStage(feature, featureIds);
- cpuStylingStage(attributes.positionMC, feature);
- #endif
- #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)
- mat4 modelView = czm_modelView3D;
- mat3 normal = czm_normal3D;
- #else
- mat4 modelView = czm_modelView;
- mat3 normal = czm_normal;
- #endif
- #ifdef HAS_INSTANCING
- #ifdef USE_LEGACY_INSTANCING
- mat4 instanceModelView;
- mat3 instanceModelViewInverseTranspose;
- legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose);
- modelView = instanceModelView;
- normal = instanceModelViewInverseTranspose;
- #else
- instancingStage(attributes);
- #endif
- #ifdef USE_PICKING
- v_pickColor = a_pickColor;
- #endif
- #endif
- Metadata metadata;
- MetadataClass metadataClass;
- metadataStage(metadata, metadataClass, attributes);
- #ifdef HAS_CUSTOM_VERTEX_SHADER
- czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC);
- customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass);
- #endif
- vec4 positionClip = geometryStage(attributes, modelView, normal);
- #ifdef HAS_SILHOUETTE
- silhouetteStage(attributes, positionClip);
- #endif
- #ifdef HAS_POINT_CLOUD_SHOW_STYLE
- float show = pointCloudShowStylingStage(attributes, metadata);
- #else
- float show = 1.0;
- #endif
- #ifdef HAS_POINT_CLOUD_COLOR_STYLE
- v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata);
- #endif
- #ifdef PRIMITIVE_TYPE_POINTS
- #ifdef HAS_CUSTOM_VERTEX_SHADER
- gl_PointSize = vsOutput.pointSize;
- #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION)
- gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata);
- #else
- gl_PointSize = 1.0;
- #endif
- gl_PointSize *= show;
- #endif
- gl_Position = show * positionClip;
- }
- `;function Ut(){}Ut.getFailedLoadFunction=function(e,t,n){return function(i){let r=`Failed to load ${t}: ${n}`;l(i)&&(r+=`
- ${i.message}`);let o=new fe(r);return l(i)&&(o.stack=`Original stack:
- ${i.stack}
- Handler stack:
- ${o.stack}`),Promise.reject(o)}};Ut.getNodeTransform=function(e){return l(e.matrix)?e.matrix:N.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:h.ZERO,l(e.rotation)?e.rotation:Re.IDENTITY,l(e.scale)?e.scale:h.ONE)};Ut.getAttributeBySemantic=function(e,t,n){let i=e.attributes,r=i.length;for(let o=0;o<r;++o){let s=i[o],a=l(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};Ut.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.name===t)return o}};Ut.getFeatureIdsByLabel=function(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.positionalLabel===t||i.label===t)return i}};Ut.hasQuantizedAttributes=function(e){if(!l(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(l(n.quantization))return!0}return!1};Ut.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,r=!1;l(t)?(i=jt.getVariableName(t,n),r=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let o=/^color_\d+$/.test(i),s=e.type,a=qt.getGlslType(s);o&&(a="vec4");let c=l(e.quantization),u;return c&&(u=o?"vec4":qt.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:r,glslType:a,quantizedGlslType:u}};var tqe=new h,nqe=new h;Ut.getPositionMinMax=function(e,t,n){let i=Ut.getAttributeBySemantic(e,"POSITION"),r=i.max,o=i.min;return l(n)&&l(t)&&(o=h.add(o,t,nqe),r=h.add(r,n,tqe)),{min:o,max:r}};Ut.getAxisCorrectionMatrix=function(e,t,n){return n=N.clone(N.IDENTITY,n),e===On.Y?n=N.clone(On.Y_UP_TO_Z_UP,n):e===On.X&&(n=N.clone(On.X_UP_TO_Z_UP,n)),t===On.Z&&(n=N.multiplyTransformation(n,On.Z_UP_TO_X_UP,n)),n};var iqe=new Q;Ut.getCullFace=function(e,t){if(!Me.isTriangles(t))return Yi.BACK;let n=N.getMatrix3(e,iqe);return Q.determinant(n)<0?Yi.FRONT:Yi.BACK};Ut.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};function Bv(e,t){let n=e.shaderBuilder;n.addVertexLines([gF]),n.addFragmentLines([_F]);let i=e.model,r=t.context,o=rqe(e),s=new Qn({context:r,indexBuffer:o,attributes:e.attributes});i._pipelineResources.push(s);let a=n.buildShaderProgram(t.context);i._pipelineResources.push(a);let c=e.alphaOptions.pass,u=i.sceneGraph,f=N.multiplyTransformation(u.computedModelMatrix,e.runtimeNode.computedTransform,new N),d;t.mode!==te.SCENE3D&&!t.scene3DOnly&&i._projectTo2D?d=e.runtimePrimitive.boundingSphere2D:d=re.transform(e.boundingSphere,f,e.boundingSphere);let p=$e(Ve.fromCache(e.renderStateOptions),!0);i.opaquePass===Ce.CESIUM_3D_TILE&&(p.stencilTest=tn.setCesium3DTileBit(),p.stencilMask=tn.CESIUM_3D_TILE_MASK),p.cull.face=Ut.getCullFace(f,e.primitiveType),p=Ve.fromCache(p);let g=e.count,m=new Ze({boundingVolume:d,modelMatrix:f,uniformMap:e.uniformMap,renderState:p,vertexArray:s,shaderProgram:a,cull:i.cull,pass:c,count:g,pickId:e.pickId,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:i.debugShowBoundingVolume,castShadows:Zt.castShadows(i.shadows),receiveShadows:Zt.receiveShadows(i.shadows)}),x=i.hasSilhouette(t);return new pF({primitiveRenderResources:e,command:m,useSilhouetteCommands:x})}function rqe(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(!!l(n))return n.buffer}var yF=`vec3 proceduralIBL(
- vec3 positionEC,
- vec3 normalEC,
- vec3 lightDirectionEC,
- vec3 lightColorHdr,
- czm_pbrParameters pbrParameters
- ) {
- vec3 v = -positionEC;
- vec3 positionWC = vec3(czm_inverseView * vec4(positionEC, 1.0));
- vec3 vWC = -normalize(positionWC);
- vec3 l = normalize(lightDirectionEC);
- vec3 n = normalEC;
- vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n)));
- float NdotL = clamp(dot(n, l), 0.001, 1.0);
- float NdotV = abs(dot(n, v)) + 0.001;
- float vertexRadius = length(positionWC);
- float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius);
- float reflectionDotNadir = dot(r, normalize(positionWC));
- r.x = -r.x;
- r = -normalize(czm_temeToPseudoFixed * r);
- r.x = -r.x;
- vec3 diffuseColor = pbrParameters.diffuseColor;
- float roughness = pbrParameters.roughness;
- vec3 specularColor = pbrParameters.f0;
- float inverseRoughness = 1.04 - roughness;
- inverseRoughness *= inverseRoughness;
- vec3 sceneSkyBox = textureCube(czm_environmentMap, r).rgb * inverseRoughness;
- float atmosphereHeight = 0.05;
- float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);
- float blendRegionOffset = roughness * -1.0;
- float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);
- float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);
- float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);
- float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);
- vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight);
- vec3 nadirColor = belowHorizonColor * 0.5;
- vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5);
- vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75);
- vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight);
- vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9);
- float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight;
- float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25));
- vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);
- float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8);
- vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough);
- specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness);
- specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness);
- #ifdef USE_SUN_LUMINANCE
- float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), vWC), 0.001, 1.0);
- float S = acos(LdotZenith);
- float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), vWC), 0.001, 1.0);
- float gamma = acos(NdotL);
- float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith)));
- float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32));
- float luminance = model_luminanceAtZenith * (numerator / denominator);
- #endif
- vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;
- vec3 iblColor = (diffuseIrradiance * diffuseColor * model_iblFactor.x) + (specularIrradiance * czm_srgbToLinear(specularColor * brdfLut.x + brdfLut.y) * model_iblFactor.y);
- float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z);
- vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0);
- iblColor *= lightColor;
- #ifdef USE_SUN_LUMINANCE
- iblColor *= luminance;
- #endif
- return iblColor;
- }
- vec3 textureIBL(
- vec3 positionEC,
- vec3 normalEC,
- vec3 lightDirectionEC,
- czm_pbrParameters pbrParameters
- ) {
- vec3 diffuseColor = pbrParameters.diffuseColor;
- float roughness = pbrParameters.roughness;
- vec3 specularColor = pbrParameters.f0;
- vec3 v = -positionEC;
- vec3 n = normalEC;
- vec3 l = normalize(lightDirectionEC);
- vec3 h = normalize(v + l);
- float NdotV = abs(dot(n, v)) + 0.001;
- float VdotH = clamp(dot(v, h), 0.0, 1.0);
- const mat3 yUpToZUp = mat3(
- -1.0, 0.0, 0.0,
- 0.0, 0.0, -1.0,
- 0.0, 1.0, 0.0
- );
- vec3 cubeDir = normalize(yUpToZUp * model_iblReferenceFrameMatrix * normalize(reflect(-v, n)));
- #ifdef DIFFUSE_IBL
- #ifdef CUSTOM_SPHERICAL_HARMONICS
- vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients);
- #else
- vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients);
- #endif
- #else
- vec3 diffuseIrradiance = vec3(0.0);
- #endif
- #ifdef SPECULAR_IBL
- vec3 r0 = specularColor.rgb;
- float reflectance = max(max(r0.r, r0.g), r0.b);
- vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));
- vec3 F = fresnelSchlick2(r0, r90, VdotH);
- vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;
- #ifdef CUSTOM_SPECULAR_IBL
- vec3 specularIBL = czm_sampleOctahedralProjection(model_specularEnvironmentMaps, model_specularEnvironmentMapsSize, cubeDir, roughness * model_specularEnvironmentMapsMaximumLOD, model_specularEnvironmentMapsMaximumLOD);
- #else
- vec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD);
- #endif
- specularIBL *= F * brdfLut.x + brdfLut.y;
- #else
- vec3 specularIBL = vec3(0.0);
- #endif
- return diffuseColor * diffuseIrradiance + specularColor * specularIBL;
- }
- vec3 imageBasedLightingStage(
- vec3 positionEC,
- vec3 normalEC,
- vec3 lightDirectionEC,
- vec3 lightColorHdr,
- czm_pbrParameters pbrParameters
- ) {
- #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)
- return textureIBL(
- positionEC,
- normalEC,
- lightDirectionEC,
- pbrParameters
- );
- #else
- return proceduralIBL(
- positionEC,
- normalEC,
- lightDirectionEC,
- lightColorHdr,
- pbrParameters
- );
- #endif
- }
- `;var Ax={VERTEX:0,FRAGMENT:1,BOTH:2};Ax.includesVertexShader=function(e){return e===Ax.VERTEX||e===Ax.BOTH};Ax.includesFragmentShader=function(e){return e===Ax.FRAGMENT||e===Ax.BOTH};var Se=Object.freeze(Ax);var Q9={};Q9.name="ImageBasedLightingPipelineStage";Q9.process=function(e,t,n){let i=t.imageBasedLighting,r=e.shaderBuilder;r.addDefine("USE_IBL_LIGHTING",void 0,Se.FRAGMENT),r.addUniform("vec2","model_iblFactor",Se.FRAGMENT),Xl.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",Se.FRAGMENT),l(i.sphericalHarmonicCoefficients)?(r.addDefine("DIFFUSE_IBL",void 0,Se.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,Se.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",Se.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,Se.FRAGMENT),l(i.specularEnvironmentMapAtlas)&&i.specularEnvironmentMapAtlas.ready?(r.addDefine("SPECULAR_IBL",void 0,Se.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,Se.FRAGMENT),r.addUniform("sampler2D","model_specularEnvironmentMaps",Se.FRAGMENT),r.addUniform("vec2","model_specularEnvironmentMapsSize",Se.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",Se.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,Se.FRAGMENT)),l(i.luminanceAtZenith)&&(r.addDefine("USE_SUN_LUMINANCE",void 0,Se.FRAGMENT),r.addUniform("float","model_luminanceAtZenith",Se.FRAGMENT)),r.addFragmentLines([yF]);let o={model_iblFactor:function(){return i.imageBasedLightingFactor},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_luminanceAtZenith:function(){return i.luminanceAtZenith},model_sphericalHarmonicCoefficients:function(){return i.sphericalHarmonicCoefficients},model_specularEnvironmentMaps:function(){return i.specularEnvironmentMapAtlas.texture},model_specularEnvironmentMapsSize:function(){return i.specularEnvironmentMapAtlas.texture.dimensions},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentMapAtlas.maximumMipmapLevel}};e.uniformMap=rt(o,e.uniformMap)};var xF=Q9;var oqe=M.EPSILON16;function Tx(e){e=y(e,y.EMPTY_OBJECT);let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(Tx.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=M.clamp(e,this.minimumValue,this.maximumValue),M.equalsEpsilon(this._currentValue,e,oqe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var sqe=new h,eW=new Q;Tx.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=sqe,r;switch(t){case _c.XROTATE:r=Q.fromRotationX(M.toRadians(n),eW),e=N.multiplyByMatrix3(e,r,e);break;case _c.YROTATE:r=Q.fromRotationY(M.toRadians(n),eW),e=N.multiplyByMatrix3(e,r,e);break;case _c.ZROTATE:r=Q.fromRotationZ(M.toRadians(n),eW),e=N.multiplyByMatrix3(e,r,e);break;case _c.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=N.multiplyByTranslation(e,i,e);break;case _c.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=N.multiplyByTranslation(e,i,e);break;case _c.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=N.multiplyByTranslation(e,i,e);break;case _c.XSCALE:i.x=n,i.y=1,i.z=1,e=N.multiplyByScale(e,i,e);break;case _c.YSCALE:i.x=1,i.y=n,i.z=1,e=N.multiplyByScale(e,i,e);break;case _c.ZSCALE:i.x=1,i.y=1,i.z=n,e=N.multiplyByScale(e,i,e);break;case _c.UNIFORMSCALE:e=N.multiplyByUniformScale(e,n,e);break;default:break}return e};function Hg(e){e=y(e,y.EMPTY_OBJECT);let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,aqe(this)}Object.defineProperties(Hg.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function aqe(e){let n=e.articulation.stages,i=n.length,r=e._runtimeStages,o=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],c=new Tx({stage:a,runtimeArticulation:e});r.push(c);let u=a.name;o[u]=c}}Hg.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var cqe=new N,lqe=new N;Hg.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=N.clone(N.IDENTITY,cqe),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let r=this._runtimeNodes,o=r.length;for(t=0;t<o;t++){let s=r[t],a=N.multiplyTransformation(s.originalTransform,e,lqe);s.transform=a}};var CF=`void modelColorStage(inout czm_modelMaterial material)
- {
- material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend);
- float highlight = ceil(model_colorBlend);
- material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight);
- material.alpha *= model_color.a;
- }
- `;var zp={};zp.name="ModelColorPipelineStage";zp.COLOR_UNIFORM_NAME="model_color";zp.COLOR_BLEND_UNIFORM_NAME="model_colorBlend";zp.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,Se.FRAGMENT),i.addFragmentLines([CF]);let r={},o=t.color;o.alpha===0&&!t.hasSilhouette(n)&&(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),o.alpha<1&&(e.alphaOptions.pass=Ce.TRANSLUCENT),i.addUniform("vec4",zp.COLOR_UNIFORM_NAME,Se.FRAGMENT),r[zp.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",zp.COLOR_BLEND_UNIFORM_NAME,Se.FRAGMENT),r[zp.COLOR_BLEND_UNIFORM_NAME]=function(){return Ds.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=rt(r,e.uniformMap)};var bx=zp;var AF=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE
- vec4 getClippingPlane(
- highp sampler2D packedClippingPlanes,
- int clippingPlaneNumber,
- mat4 transform
- ) {
- int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH;
- int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);
- float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);
- float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);
- float u = (float(pixX) + 0.5) * pixelWidth;
- float v = (float(pixY) + 0.5) * pixelHeight;
- vec4 plane = texture2D(packedClippingPlanes, vec2(u, v));
- return czm_transformPlane(plane, transform);
- }
- #else
- vec4 getClippingPlane(
- highp sampler2D packedClippingPlanes,
- int clippingPlaneNumber,
- mat4 transform
- ) {
- int clippingPlaneStartIndex = clippingPlaneNumber * 2;
- int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH;
- int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);
- float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);
- float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);
- float u = (float(pixX) + 0.5) * pixelWidth;
- float v = (float(pixY) + 0.5) * pixelHeight;
- vec4 oct32 = texture2D(packedClippingPlanes, vec2(u, v)) * 255.0;
- vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
- vec4 plane;
- plane.xyz = czm_octDecode(oct, 65535.0);
- plane.w = czm_unpackFloat(texture2D(packedClippingPlanes, vec2(u + pixelWidth, v)));
- return czm_transformPlane(plane, transform);
- }
- #endif
- float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) {
- vec4 position = czm_windowToEyeCoordinates(fragCoord);
- vec3 clipNormal = vec3(0.0);
- vec3 clipPosition = vec3(0.0);
- float pixelWidth = czm_metersPerPixel(position);
- #ifdef UNION_CLIPPING_REGIONS
- float clipAmount;
- #else
- float clipAmount = 0.0;
- bool clipped = true;
- #endif
- for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) {
- vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
- clipNormal = clippingPlane.xyz;
- clipPosition = -clippingPlane.w * clipNormal;
- float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
- #ifdef UNION_CLIPPING_REGIONS
- clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
- if (amount <= 0.0) {
- discard;
- }
- #else
- clipAmount = max(amount, clipAmount);
- clipped = clipped && (amount <= 0.0);
- #endif
- }
- #ifndef UNION_CLIPPING_REGIONS
- if (clipped) {
- discard;
- }
- #endif
- return clipAmount;
- }
- void modelClippingPlanesStage(inout vec4 color)
- {
- float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix);
- vec4 clippingPlanesEdgeColor = vec4(1.0);
- clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb;
- float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a;
- if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) {
- color = clippingPlanesEdgeColor;
- }
- }
- `;var tW={};tW.name="ModelClippingPlanesPipelineStage";var uqe=new W;tW.process=function(e,t,n){let i=t.clippingPlanes,r=n.context,o=e.shaderBuilder;o.addDefine("HAS_CLIPPING_PLANES",void 0,Se.FRAGMENT),o.addDefine("CLIPPING_PLANES_LENGTH",i.length,Se.FRAGMENT),i.unionClippingRegions&&o.addDefine("UNION_CLIPPING_REGIONS",void 0,Se.FRAGMENT),vs.useFloatTexture(r)&&o.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,Se.FRAGMENT);let s=vs.getTextureResolution(i,r,uqe);o.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,Se.FRAGMENT),o.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,Se.FRAGMENT),o.addUniform("sampler2D","model_clippingPlanes",Se.FRAGMENT),o.addUniform("vec4","model_clippingPlanesEdgeStyle",Se.FRAGMENT),o.addUniform("mat4","model_clippingPlanesMatrix",Se.FRAGMENT),o.addFragmentLines([AF]);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=z.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=rt(a,e.uniformMap)};var TF=tW;function yb(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(yb.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var bF=`mat4 getInstancingTransform()
- {
- mat4 instancingTransform;
- #ifdef HAS_INSTANCE_MATRICES
- instancingTransform = mat4(
- a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0,
- a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0,
- a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0,
- a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0
- );
- #else
- vec3 translation = vec3(0.0, 0.0, 0.0);
- vec3 scale = vec3(1.0, 1.0, 1.0);
- #ifdef HAS_INSTANCE_TRANSLATION
- translation = a_instanceTranslation;
- #endif
- #ifdef HAS_INSTANCE_SCALE
- scale = a_instanceScale;
- #endif
- instancingTransform = mat4(
- scale.x, 0.0, 0.0, 0.0,
- 0.0, scale.y, 0.0, 0.0,
- 0.0, 0.0, scale.z, 0.0,
- translation.x, translation.y, translation.z, 1.0
- );
- #endif
- return instancingTransform;
- }
- #ifdef USE_2D_INSTANCING
- mat4 getInstancingTransform2D()
- {
- mat4 instancingTransform2D;
- #ifdef HAS_INSTANCE_MATRICES
- instancingTransform2D = mat4(
- a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0,
- a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0,
- a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0,
- a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0
- );
- #else
- vec3 translation2D = vec3(0.0, 0.0, 0.0);
- vec3 scale = vec3(1.0, 1.0, 1.0);
- #ifdef HAS_INSTANCE_TRANSLATION
- translation2D = a_instanceTranslation2D;
- #endif
- #ifdef HAS_INSTANCE_SCALE
- scale = a_instanceScale;
- #endif
- instancingTransform2D = mat4(
- scale.x, 0.0, 0.0, 0.0,
- 0.0, scale.y, 0.0, 0.0,
- 0.0, 0.0, scale.z, 0.0,
- translation2D.x, translation2D.y, translation2D.z, 1.0
- );
- #endif
- return instancingTransform2D;
- }
- #endif
- `;var EF=`void instancingStage(inout ProcessedAttributes attributes)
- {
- vec3 positionMC = attributes.positionMC;
- mat4 instancingTransform = getInstancingTransform();
- attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz;
- #ifdef USE_2D_INSTANCING
- mat4 instancingTransform2D = getInstancingTransform2D();
- attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;
- #endif
- }
- `;var SF=`void legacyInstancingStage(
- inout ProcessedAttributes attributes,
- out mat4 instanceModelView,
- out mat3 instanceModelViewInverseTranspose)
- {
- vec3 positionMC = attributes.positionMC;
- mat4 instancingTransform = getInstancingTransform();
- mat4 instanceModel = instancingTransform * u_instance_nodeTransform;
- instanceModelView = u_instance_modifiedModelView;
- instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel);
- attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz;
- #ifdef USE_2D_INSTANCING
- mat4 instancingTransform2D = getInstancingTransform2D();
- attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;
- #endif
- }
- `;var wF=new N,fqe=new N,dqe=new N,Fv={};Fv.name="InstancingPipelineStage";Fv.process=function(e,t,n){let i=t.instances,r=i.attributes[0].count,o=e.shaderBuilder;o.addDefine("HAS_INSTANCING"),o.addVertexLines([bF]);let s=e.model,a=s.sceneGraph,c=n.mode!==te.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,u=[];Dqe(e,n,i,u,c),Pqe(e,n,i,u);let f={};if(i.transformInWorldSpace?(o.addDefine("USE_LEGACY_INSTANCING",void 0,Se.VERTEX),o.addUniform("mat4","u_instance_modifiedModelView",Se.VERTEX),o.addUniform("mat4","u_instance_nodeTransform",Se.VERTEX),f.u_instance_modifiedModelView=function(){let d=N.multiplyTransformation(s.modelMatrix,a.components.transform,wF);return c?N.multiplyTransformation(n.context.uniformState.view3D,d,wF):(n.mode!==te.SCENE3D&&(d=yt.basisTo2D(n.mapProjection,d,wF)),N.multiplyTransformation(n.context.uniformState.view,d,wF))},f.u_instance_nodeTransform=function(){return N.multiplyTransformation(a.axisCorrectionMatrix,e.runtimeNode.computedTransform,fqe)},o.addVertexLines([SF])):o.addVertexLines([EF]),c){o.addDefine("USE_2D_INSTANCING",void 0,Se.VERTEX),o.addUniform("mat4","u_modelView2D",Se.VERTEX);let d=n.context,p=N.fromTranslation(e.instancingReferencePoint2D,new N);f.u_modelView2D=function(){return N.multiplyTransformation(d.uniformState.view,p,dqe)}}e.uniformMap=rt(f,e.uniformMap),e.instanceCount=r,e.attributes.push.apply(e.attributes,u)};var Nv=new N,hqe=new h;function mqe(e,t,n,i,r){let o=N.multiplyTransformation(t,e,Nv);return o=N.multiplyTransformation(o,n,Nv),r=yt.basisTo2D(i.mapProjection,o,r),r}function pqe(e,t,n,i,r){let o=N.fromTranslation(e,Nv),s=N.multiplyTransformation(t,o,Nv);s=N.multiplyTransformation(s,n,Nv);let a=N.getTranslation(s,hqe);return r=rr.computeActualWgs84Position(i,a,r),r}function ple(e,t,n){let i=e.model,r=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=N.multiplyTransformation(i.modelMatrix,r.components.transform,t),n=N.multiplyTransformation(r.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=N.clone(r.computedModelMatrix,t),t=N.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=N.clone(N.IDENTITY,n))}var _le=new N,gle=new N,_qe=new N,gqe=new h;function yqe(e,t,n,i){let r=_le,o=gle;ple(t,r,o);let s=t.instancingReferencePoint2D,a=e.length;for(let c=0;c<a;c++){let u=e[c],f=mqe(u,r,o,n,_qe),d=N.getTranslation(f,gqe),p=h.subtract(d,s,d);i[c]=N.setTranslation(f,p,i[c])}return i}function xqe(e,t,n,i){let r=_le,o=gle;ple(t,r,o);let s=t.instancingReferencePoint2D,a=e.length;for(let c=0;c<a;c++){let u=e[c],f=pqe(u,r,o,n,u);i[c]=h.subtract(f,s,i[c])}return i}var Cqe=new h,Aqe=new h;function Tqe(e,t){let n=e.model.sceneGraph.computedModelMatrix,i=N.multiplyByPoint(n,e.instancingTranslationMin,Cqe),r=rr.computeActualWgs84Position(t,i,i),o=N.multiplyByPoint(n,e.instancingTranslationMax,Aqe),s=rr.computeActualWgs84Position(t,o,o);return h.lerp(r,s,.5,new h)}function iW(e){let n=e.length,i=new Float32Array(n*12);for(let r=0;r<n;r++){let o=e[r],s=12*r;i[s+0]=o[0],i[s+1]=o[4],i[s+2]=o[8],i[s+3]=o[12],i[s+4]=o[1],i[s+5]=o[5],i[s+6]=o[9],i[s+7]=o[13],i[s+8]=o[2],i[s+9]=o[6],i[s+10]=o[10],i[s+11]=o[14]}return i}function bqe(e){let n=e.length,i=new Float32Array(n*3);for(let r=0;r<n;r++){let o=e[r],s=3*r;i[s+0]=o[0],i[s+1]=o[4],i[s+2]=o[8]}return i}var Eqe=new h,Sqe=new Re,wqe=new h;function yle(e,t,n){let i=new Array(t),r=Ut.getAttributeBySemantic(e,Zo.TRANSLATION),o=Ut.getAttributeBySemantic(e,Zo.ROTATION),s=Ut.getAttributeBySemantic(e,Zo.SCALE),a=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=l(r),f=l(o),d=l(s),p=u?r.typedArray:new Float32Array(t*3),g=f?o.typedArray:new Float32Array(t*4),m;d?m=s.typedArray:(m=new Float32Array(t*3),m.fill(1));for(let x=0;x<t;x++){let C=new h(p[x*3],p[x*3+1],p[x*3+2],Eqe);h.maximumByComponent(a,C,a),h.minimumByComponent(c,C,c);let A=new Re(g[x*4],g[x*4+1],g[x*4+2],f?g[x*4+3]:1,Sqe),b=new h(m[x*3],m[x*3+1],m[x*3+2],wqe),T=N.fromTranslationQuaternionRotationScale(C,A,b,new N);i[x]=T}return n.instancingTranslationMax=a,n.instancingTranslationMin=c,i}function vqe(e,t){let n=new Array(t),i=e.typedArray;for(let r=0;r<t;r++)n[r]=new h(i[r*3],i[r*3+1],i[r*3+2]);return n}function Lv(e,t){let n=at.createVertexBuffer({context:t.context,typedArray:e,usage:Ne.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function Dqe(e,t,n,i,r){let o=Ut.getAttributeBySemantic(n,Zo.TRANSLATION),s,a;l(o)&&(s=o.max,a=o.min);let c=Ut.getAttributeBySemantic(n,Zo.ROTATION),u=e.shaderBuilder,f=n.attributes[0].count,d=l(c)||!l(s)||!l(a),p=e.model.statistics,g=!1,m;if(d){u.addDefine("HAS_INSTANCE_MATRICES");let b="Transform";m=yle(n,f,e);let T=iW(m),S=Lv(T,t);e.model._pipelineResources.push(S),mle(e,S,i,b),p.addBuffer(S,g)}else{if(l(o)){u.addDefine("HAS_INSTANCE_TRANSLATION");let T=o.max,S=o.min;e.instancingTranslationMax=T,e.instancingTranslationMin=S;let w=o.buffer,D=o.byteOffset,I=o.byteStride;l(w)||(w=Lv(o.typedArray,t),e.model._pipelineResources.push(w),D=0,I=void 0,p.addBuffer(w,g)),nW(e,w,D,I,i,"Translation")}let b=Ut.getAttributeBySemantic(n,Zo.SCALE);if(l(b)){u.addDefine("HAS_INSTANCE_SCALE");let T=b.buffer,S=b.byteOffset,w=b.byteStride;l(T)||(T=Lv(b.typedArray,t),e.model._pipelineResources.push(T),S=0,w=void 0,p.addBuffer(T,g)),nW(e,T,S,w,i,"Scale")}}if(!r)return;let x=$e(t);x.mode=te.COLUMBUS_VIEW;let C=Tqe(e,x);e.instancingReferencePoint2D=C;let A=e.runtimeNode;if(d){let b=A.instancingTransformsBuffer2D;if(!l(b)){let S=yqe(m,e,x,m),w=iW(S);b=Lv(w,t),e.model._modelResources.push(b),A.instancingTransformsBuffer2D=b}mle(e,b,i,"Transform2D")}else{let b=A.instancingTranslationBuffer2D;if(!l(b)){let D=vqe(o,f),I=xqe(D,e,x,D),O=bqe(I);b=Lv(O,t),e.model._modelResources.push(b),A.instancingTranslationBuffer2D=b}nW(e,b,0,void 0,i,"Translation2D")}}function mle(e,t,n,i){let o=K.getSizeInBytes(K.FLOAT),s=o*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:K.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:K.FLOAT,normalize:!1,offsetInBytes:o*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:K.FLOAT,normalize:!1,offsetInBytes:o*8,strideInBytes:s,instanceDivisor:1}],c=e.shaderBuilder;c.addAttribute("vec4",`a_instancing${i}Row0`),c.addAttribute("vec4",`a_instancing${i}Row1`),c.addAttribute("vec4",`a_instancing${i}Row2`),n.push.apply(n,a)}function nW(e,t,n,i,r,o){r.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:K.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${o}`)}function Pqe(e,t,n,i){let r=n.attributes,o=e.model,s=e.shaderBuilder;for(let a=0;a<r.length;a++){let c=r[a];if(c.semantic!==Zo.FEATURE_ID)continue;c.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=c.setIndex+1);let u=at.createVertexBuffer({context:t.context,typedArray:c.typedArray,usage:Ne.STATIC_DRAW});u.vertexArrayDestroyable=!1,o._pipelineResources.push(u);let f=!1;o.statistics.addBuffer(u,f),i.push({index:e.attributeIndex++,vertexBuffer:u,componentsPerAttribute:qt.getNumberOfComponents(c.type),componentDatatype:c.componentDatatype,normalize:!1,offsetInBytes:c.byteOffset,strideInBytes:c.byteStride,instanceDivisor:1}),s.addAttribute("float",`a_instanceFeatureId_${c.setIndex}`)}}Fv._getInstanceTransformsAsMatrices=yle;Fv._transformsToTypedArray=iW;var vF=Fv;var rW={};rW.name="ModelMatrixUpdateStage";rW.update=function(e,t,n){let i=n.mode!==te.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let r=i?t._computedModelMatrix2D:t._computedModelMatrix;xle(e,t,r,e.transformToRoot),e._transformDirty=!1}};function xle(e,t,n,i){let r;i=N.multiplyTransformation(i,e.transform,new N),e.updateComputedTransform();let o=e.runtimePrimitives.length;for(r=0;r<o;r++){let c=e.runtimePrimitives[r].drawCommand;c.modelMatrix=N.multiplyTransformation(n,i,c.modelMatrix),c.cullFace=Ut.getCullFace(c.modelMatrix,c.primitiveType)}let s=e.children.length;for(r=0;r<s;r++){let a=t._runtimeNodes[e.children[r]];a._transformToRoot=N.clone(i,a._transformToRoot),xle(a,t,n,i),a._transformDirty=!1}}var DF=rW;var Vv={};Vv.name="NodeStatisticsPipelineStage";Vv.process=function(e,t,n){let r=e.model.statistics,o=e.runtimeNode;Cle(r,t.instances),Ale(r,o)};function Cle(e,t){if(!l(t))return;let n=t.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];l(o.buffer)&&e.addBuffer(o.buffer,!1)}}function Ale(e,t){l(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),l(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}Vv._countInstancingAttributes=Cle;Vv._countInstancing2DBuffers=Ale;var PF=Vv;function om(e){e=y(e,y.EMPTY_OBJECT);let t=e.node,n=e.transform,i=e.transformToRoot,r=e.sceneGraph,o=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=r,this._children=o,this._originalTransform=N.clone(n,this._originalTransform),this._transform=N.clone(n,this._transform),this._transformToRoot=N.clone(i,this._transformToRoot),this._computedTransform=new N,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,Iqe(this)}Object.defineProperties(om.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=N.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return l(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters,n=t.translation;h.equals(n,e)||(t.translation=h.clone(e,t.translation),oW(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Re.equals(n,e)||(t.rotation=Re.clone(e,t.rotation),oW(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;h.equals(n,e)||(t.scale=h.clone(e,t.scale),oW(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;for(let n=0;n<t;n++)this._morphWeights[n]=e[n]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}});function Iqe(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=N.multiply(n,t,i);let r=e.node;l(r.matrix)||(e._transformParameters=new sp(r.translation,r.rotation,r.scale)),l(r.morphWeights)&&(e._morphWeights=r.morphWeights.slice());let o=r.articulationName;if(l(o)){let c=e.sceneGraph._runtimeArticulations[o];l(c)&&c.runtimeNodes.push(e)}}function oW(e,t){e._transformDirty=!0,e._transform=N.fromTranslationRotationScale(t,e._transform)}om.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};om.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,l(e.instances)&&t.push(vF),t.push(PF),n.push(DF)};om.prototype.updateComputedTransform=function(){this._computedTransform=N.multiply(this._transformToRoot,this._transform,this._computedTransform)};om.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!l(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let r=0;r<i;r++){l(t[r])||(t[r]=new N);let o=N.multiplyTransformation(this.transformToRoot,this.transform,t[r]),s=N.inverseTransformation(o,t[r]);t[r]=N.multiplyTransformation(s,n[r],t[r])}};var sW={};sW.name="AlphaPipelineStage";sW.process=function(e,t,n){let i=e.alphaOptions,r=e.model;i.pass=y(i.pass,r.opaquePass);let o=e.renderStateOptions;i.pass===Ce.TRANSLUCENT&&(o.cull.enabled=!1,o.depthMask=!1,o.blending=hn.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;l(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,Se.FRAGMENT),s.addUniform("float","u_alphaCutoff",Se.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var IF=sW;var aW={};aW.name="BatchTexturePipelineStage";aW.process=function(e,t,n){let i=e.shaderBuilder,r={},o=e.model,s=o.featureTables[o.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),r.model_featuresLength=function(){return a};let c=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),r.model_batchTexture=function(){return y(c.batchTexture,c.defaultTexture)},i.addUniform("vec4","model_textureStep"),r.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),r.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=rt(r,e.uniformMap)};var OF=aW;var Tle={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};Tle.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var Gg=Object.freeze(Tle);var RF=`void customShaderStage(
- inout czm_modelVertexOutput vsOutput,
- inout ProcessedAttributes attributes,
- FeatureIds featureIds,
- Metadata metadata,
- MetadataClass metadataClass
- ) {
- VertexInput vsInput;
- initializeInputStruct(vsInput, attributes);
- vsInput.featureIds = featureIds;
- vsInput.metadata = metadata;
- vsInput.metadataClass = metadataClass;
- vertexMain(vsInput, vsOutput);
- attributes.positionMC = vsOutput.positionMC;
- }
- `;var MF=`void customShaderStage(
- inout czm_modelMaterial material,
- ProcessedAttributes attributes,
- FeatureIds featureIds,
- Metadata metadata,
- MetadataClass metadataClass
- ) {
- FragmentInput fsInput;
- initializeInputStruct(fsInput, attributes);
- fsInput.featureIds = featureIds;
- fsInput.metadata = metadata;
- fsInput.metadataClass = metadataClass;
- fragmentMain(fsInput, material);
- }
- `;var BF=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) {
- initializeFeatureIds(featureIds, attributes);
- initializeFeatureIdAliases(featureIds);
- }
- `;var LF=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes)
- {
- initializeFeatureIds(featureIds, attributes);
- initializeFeatureIdAliases(featureIds);
- setFeatureIdVaryings();
- }
- `;var Un={};Un.name="FeatureIdPipelineStage";Un.STRUCT_ID_FEATURE_IDS_VS="FeatureIdsVS";Un.STRUCT_ID_FEATURE_IDS_FS="FeatureIdsFS";Un.STRUCT_NAME_FEATURE_IDS="FeatureIds";Un.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS="initializeFeatureIdsVS";Un.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS="initializeFeatureIdsFS";Un.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS="initializeFeatureIdAliasesVS";Un.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS="initializeFeatureIdAliasesFS";Un.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS="void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)";Un.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES="void initializeFeatureIdAliases(inout FeatureIds featureIds)";Un.FUNCTION_ID_SET_FEATURE_ID_VARYINGS="setFeatureIdVaryings";Un.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS="void setFeatureIdVaryings()";Un.process=function(e,t,n){let i=e.shaderBuilder;Oqe(i);let r=e.runtimeNode.node.instances;l(r)&&Rqe(e,r,n),Mqe(e,t,n),i.addVertexLines([LF]),i.addFragmentLines([BF])};function Oqe(e){e.addStruct(Un.STRUCT_ID_FEATURE_IDS_VS,Un.STRUCT_NAME_FEATURE_IDS,Se.VERTEX),e.addStruct(Un.STRUCT_ID_FEATURE_IDS_FS,Un.STRUCT_NAME_FEATURE_IDS,Se.FRAGMENT),e.addFunction(Un.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Un.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,Se.VERTEX),e.addFunction(Un.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Un.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,Se.FRAGMENT),e.addFunction(Un.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Un.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,Se.VERTEX),e.addFunction(Un.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Un.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,Se.FRAGMENT),e.addFunction(Un.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Un.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,Se.VERTEX)}function Rqe(e,t,n){let i=t.featureIds,r=t.attributes[0].count;for(let o=0;o<i.length;o++){let s=i[o],a=s.positionalLabel;s instanceof kt.FeatureIdAttribute?Bqe(e,s,a):ble(e,s,a,r,1,n);let c=s.label;l(c)&&Ele(e,a,c,Se.BOTH)}}function Mqe(e,t,n){let i=t.featureIds,o=Ut.getAttributeBySemantic(t,jt.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,u=Se.BOTH;a instanceof kt.FeatureIdAttribute?Lqe(e,a,c):a instanceof kt.FeatureIdImplicitRange?ble(e,a,c,o,void 0,n):(Nqe(e,a,c,s,n),u=Se.FRAGMENT);let f=a.label;l(f)&&Ele(e,c,f,u)}}function Bqe(e,t,n){let i=e.shaderBuilder;i.addStructField(Un.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Un.STRUCT_ID_FEATURE_IDS_FS,"int",n);let r=t.setIndex,o=n.replace(/_\d+$/,"_"),s=`a_${o}${r}`,a=`v_${o}${r}`,c=`featureIds.${n} = int(czm_round(${s}));`,u=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(Un.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(Un.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(Un.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function Lqe(e,t,n){let i=e.shaderBuilder;i.addStructField(Un.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Un.STRUCT_ID_FEATURE_IDS_FS,"int",n);let r=t.setIndex,o=n.replace(/_\d+$/,"_"),s=[`featureIds.${n} = int(czm_round(attributes.${o}${r}));`];i.addFunctionLines(Un.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(Un.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function ble(e,t,n,i,r,o){Fqe(e,t,i,r,o);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let c=`v_implicit_${n}`;s.addVarying("float",c),s.addStructField(Un.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(Un.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(Un.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(Un.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(Un.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function Nqe(e,t,n,i,r){let o=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[o]=function(){return y(a.texture,r.context.defaultTexture)};let c=a.channels,u=e.shaderBuilder;u.addStructField(Un.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",o,Se.FRAGMENT);let f=`v_texCoord_${a.texCoord}`,d=`texture2D(${o}, ${f}).${c}`,p=`featureIds.${n} = czm_unpackUint(${d});`;u.addFunctionLines(Un.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[p])}function Ele(e,t,n,i){let r=e.shaderBuilder,o=Se.includesVertexShader(i);o&&r.addStructField(Un.STRUCT_ID_FEATURE_IDS_VS,"int",n),r.addStructField(Un.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];o&&r.addFunctionLines(Un.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),r.addFunctionLines(Un.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function Fqe(e,t,n,i,r){let o=e.model,s,a;if(l(t.repeat)){let u=Vqe(t,n);s=at.createVertexBuffer({context:r.context,typedArray:u,usage:Ne.STATIC_DRAW}),s.vertexArrayDestroyable=!1,o._pipelineResources.push(s);let f=!1;o.statistics.addBuffer(s,f)}else a=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:K.FLOAT,strideInBytes:K.getSizeInBytes(K.FLOAT),offsetInBytes:0};e.attributes.push(c)}function Vqe(e,t){let n=e.offset,i=e.repeat,r=new Float32Array(t);for(let o=0;o<t;o++)r[o]=n+Math.floor(o/i);return r}var Ex=Un;var NF=`void metadataStage(out Metadata metadata, out MetadataClass metadataClass, ProcessedAttributes attributes)
- {
- initializeMetadata(metadata, metadataClass, attributes);
- }
- `;var FF=`void metadataStage(out Metadata metadata, out MetadataClass metadataClass, ProcessedAttributes attributes)
- {
- initializeMetadata(metadata, metadataClass, attributes);
- setMetadataVaryings();
- }
- `;var Xn={};Xn.name="MetadataPipelineStage";Xn.STRUCT_ID_METADATA_VS="MetadataVS";Xn.STRUCT_ID_METADATA_FS="MetadataFS";Xn.STRUCT_NAME_METADATA="Metadata";Xn.STRUCT_ID_METADATACLASS_VS="MetadataClassVS";Xn.STRUCT_ID_METADATACLASS_FS="MetadataClassFS";Xn.STRUCT_NAME_METADATACLASS="MetadataClass";Xn.FUNCTION_ID_INITIALIZE_METADATA_VS="initializeMetadataVS";Xn.FUNCTION_ID_INITIALIZE_METADATA_FS="initializeMetadataFS";Xn.FUNCTION_SIGNATURE_INITIALIZE_METADATA="void initializeMetadata(out Metadata metadata, out MetadataClass metadataClass, ProcessedAttributes attributes)";Xn.FUNCTION_ID_SET_METADATA_VARYINGS="setMetadataVaryings";Xn.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS="void setMetadataVaryings()";Xn.METADATACLASS_FIELDS=[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}];Xn.process=function(e,t,n){let{shaderBuilder:i,model:r}=e,o=y(r.structuralMetadata,{}),{propertyAttributes:s,propertyTextures:a}=o,c=new Set;l(s)&&zqe(c,t,s),l(a)&&Wqe(c,a),kqe(i,c),Uqe(i),i.addVertexLines([FF]),i.addFragmentLines([NF]),l(s)&&Hqe(e,t,s),l(a)&&jqe(e,a)};function kqe(e,t){let n=Xn.METADATACLASS_FIELDS;for(let i of t){let r=`${i}MetadataClass`,o=`${r}VS`,s=`${r}FS`;e.addStruct(o,r,Se.VERTEX),e.addStruct(s,r,Se.FRAGMENT);for(let a=0;a<n.length;a++){let c=n[a].shaderName;e.addStructField(o,i,c),e.addStructField(s,i,c)}}}function Uqe(e){e.addStruct(Xn.STRUCT_ID_METADATA_VS,Xn.STRUCT_NAME_METADATA,Se.VERTEX),e.addStruct(Xn.STRUCT_ID_METADATA_FS,Xn.STRUCT_NAME_METADATA,Se.FRAGMENT),e.addStruct(Xn.STRUCT_ID_METADATACLASS_VS,Xn.STRUCT_NAME_METADATACLASS,Se.VERTEX),e.addStruct(Xn.STRUCT_ID_METADATACLASS_FS,Xn.STRUCT_NAME_METADATACLASS,Se.FRAGMENT),e.addFunction(Xn.FUNCTION_ID_INITIALIZE_METADATA_VS,Xn.FUNCTION_SIGNATURE_INITIALIZE_METADATA,Se.VERTEX),e.addFunction(Xn.FUNCTION_ID_INITIALIZE_METADATA_FS,Xn.FUNCTION_SIGNATURE_INITIALIZE_METADATA,Se.FRAGMENT),e.addFunction(Xn.FUNCTION_ID_SET_METADATA_VARYINGS,Xn.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,Se.VERTEX)}function VF(e,t){for(let n=0;n<e.length;n++){let i=e[n].properties;for(let r in i)if(i.hasOwnProperty(r)){let o=i[r];t(r,o)}}}function zqe(e,t,n){let{getAttributeByName:i,getAttributeInfo:r}=Ut;function o(s,a){let c=i(t,a.attribute),f=r(c).glslType;e.add(f)}VF(n,o)}function Hqe(e,t,n){let{getAttributeByName:i,getAttributeInfo:r}=Ut;function o(s,a){let c=i(t,a.attribute),u=r(c);Gqe(e,u,s,a)}VF(n,o)}function Gqe(e,t,n,i){let r=Ut.sanitizeGlslIdentifier(n),o=t.variableName,s=t.glslType,a=e.shaderBuilder;a.addStructField(Xn.STRUCT_ID_METADATA_VS,s,r),a.addStructField(Xn.STRUCT_ID_METADATA_FS,s,r);let c=`${s}MetadataClass`;a.addStructField(Xn.STRUCT_ID_METADATACLASS_VS,c,r),a.addStructField(Xn.STRUCT_ID_METADATACLASS_FS,c,r);let u=`attributes.${o}`;i.hasValueTransform&&(u=Sle(u,{renderResources:e,glslType:s,metadataVariable:r,shaderDestination:Se.BOTH,offset:i.offset,scale:i.scale}));let f=`metadata.${r} = ${u};`;a.addFunctionLines(Xn.FUNCTION_ID_INITIALIZE_METADATA_VS,[f]),a.addFunctionLines(Xn.FUNCTION_ID_INITIALIZE_METADATA_FS,[f]);let d=Xn.METADATACLASS_FIELDS;for(let p=0;p<d.length;p++){let{specName:g,shaderName:m}=d[p],x=i.classProperty[g];if(!l(x))continue;let C=`metadataClass.${r}.${m} = ${s}(${x});`;a.addFunctionLines(Xn.FUNCTION_ID_INITIALIZE_METADATA_VS,[C]),a.addFunctionLines(Xn.FUNCTION_ID_INITIALIZE_METADATA_FS,[C])}}function Wqe(e,t){function n(i,r){let o=r.getGlslType();e.add(o)}VF(t,n)}function jqe(e,t){function n(i,r){r.isGpuCompatible()&&qqe(e,i,r)}VF(t,n)}function qqe(e,t,n){let i=n.textureReader,o=`u_propertyTexture_${i.index}`;e.uniformMap.hasOwnProperty(o)||Yqe(e,o,i);let s=Ut.sanitizeGlslIdentifier(t),a=n.getGlslType(),c=e.shaderBuilder;c.addStructField(Xn.STRUCT_ID_METADATA_FS,a,s);let u=`${a}MetadataClass`;c.addStructField(Xn.STRUCT_ID_METADATACLASS_FS,u,s);let d=`attributes.texCoord_${i.texCoord}`,p=i.channels,g=`texture2D(${o}, ${d}).${p}`;g=n.unpackInShader(g),n.hasValueTransform&&(g=Sle(g,{renderResources:e,glslType:a,metadataVariable:s,shaderDestination:Se.FRAGMENT,offset:n.offset,scale:n.scale}));let m=`metadata.${s} = ${g};`;c.addFunctionLines(Xn.FUNCTION_ID_INITIALIZE_METADATA_FS,[m]);let x=Xn.METADATACLASS_FIELDS;for(let C=0;C<x.length;C++){let{specName:A,shaderName:b}=x[C],T=n.classProperty[A];if(!l(T))continue;let S=`metadataClass.${s}.${b} = ${a}(${T});`;c.addFunctionLines(Xn.FUNCTION_ID_INITIALIZE_METADATA_FS,[S])}}function Yqe(e,t,n){let{shaderBuilder:i,uniformMap:r}=e;i.addUniform("sampler2D",t,Se.FRAGMENT),r[t]=()=>n.texture}function Sle(e,t){let n=t.metadataVariable,i=`u_${n}_offset`,r=`u_${n}_scale`,{shaderBuilder:o,uniformMap:s}=t.renderResources,a=t.glslType,c=t.shaderDestination;return o.addUniform(a,i,c),o.addUniform(a,r,c),s[i]=()=>t.offset,s[r]=()=>t.scale,`czm_valueTransform(${i}, ${r}, ${e})`}var Hp=Xn;var dr={};dr.name="CustomShaderPipelineStage";dr.STRUCT_ID_ATTRIBUTES_VS="AttributesVS";dr.STRUCT_ID_ATTRIBUTES_FS="AttributesFS";dr.STRUCT_NAME_ATTRIBUTES="Attributes";dr.STRUCT_ID_VERTEX_INPUT="VertexInput";dr.STRUCT_NAME_VERTEX_INPUT="VertexInput";dr.STRUCT_ID_FRAGMENT_INPUT="FragmentInput";dr.STRUCT_NAME_FRAGMENT_INPUT="FragmentInput";dr.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS="initializeInputStructVS";dr.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS="void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)";dr.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS="initializeInputStructFS";dr.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS="void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)";dr.process=function(e,t,n){let i=e.shaderBuilder,r=e.model.customShader;l(r.lightingModel)&&(e.lightingOptions.lightingModel=r.lightingModel);let o=e.alphaOptions;r.isTranslucent?o.pass=Ce.TRANSLUCENT:o.pass=void 0;let s=tYe(r,t);if(!s.customShaderEnabled)return;if(rYe(i,r,s),s.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,Se.BOTH),l(r.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,Se.VERTEX),l(r.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,Se.FRAGMENT);let u=Gg.getDefineName(r.mode);i.addDefine(u,void 0,Se.FRAGMENT)}let a=r.uniforms;for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];i.addUniform(f.type,u)}let c=r.varyings;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];i.addVarying(f,u)}e.uniformMap=rt(e.uniformMap,r.uniformMap)};function Xqe(e){let t={};for(let n=0;n<e.length;n++){let i=e[n],r=Ut.getAttributeInfo(i);t[r.variableName]=r}return t}var Kqe={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},$qe={position:"vec3(0.0)",normal:"vec3(0.0, 0.0, 1.0)",tangent:"vec3(1.0, 0.0, 0.0)",bitangent:"vec3(0.0, 1.0, 0.0)",texCoord:"vec2(0.0)",color:"vec4(1.0)",joints:"ivec4(0)",weights:"vec4(0.0)"};function wle(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=Kqe[t],i=$qe[t];if(!!l(n))return{attributeField:[n,e],value:i}}function Zqe(e,t,n){let i=vle(t,e.usedVariablesVertex.attributeSet,!1),r=i.addToShader,o=i.missingAttributes,s,a,c=[],u=[];for(s in r)if(r.hasOwnProperty(s)){let d=[r[s].glslType,s];c.push(d),a=`vsInput.attributes.${s} = attributes.${s};`,u.push(a)}for(let f=0;f<o.length;f++){s=o[f];let d=wle(s);if(!l(d)){dr._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${s}, disabling custom vertex shader`);return}c.push(d.attributeField),a=`vsInput.attributes.${s} = ${d.value};`,u.push(a)}n.enabled=!0,n.attributeFields=c,n.initializationLines=u}function Jqe(e){let t=[],n=[],i=e.usedVariablesFragment.attributeSet;return i.hasOwnProperty("positionWC")&&(t.push(["vec3","positionWC"]),n.push("fsInput.attributes.positionWC = attributes.positionWC;")),i.hasOwnProperty("positionEC")&&(t.push(["vec3","positionEC"]),n.push("fsInput.attributes.positionEC = attributes.positionEC;")),{attributeFields:t,initializationLines:n}}function Qqe(e,t,n){let i=vle(t,e.usedVariablesFragment.attributeSet,!0),r=i.addToShader,o=i.missingAttributes,s,a,c=[],u=[];for(s in r)if(r.hasOwnProperty(s)){let p=[r[s].glslType,s];c.push(p),a=`fsInput.attributes.${s} = attributes.${s};`,u.push(a)}for(let d=0;d<o.length;d++){s=o[d];let p=wle(s);if(!l(p)){dr._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${s}, disabling custom fragment shader.`);return}c.push(p.attributeField),a=`fsInput.attributes.${s} = ${p.value};`,u.push(a)}let f=Jqe(e);n.enabled=!0,n.attributeFields=c.concat(f.attributeFields),n.initializationLines=f.initializationLines.concat(u)}var eYe={positionWC:!0,positionEC:!0};function vle(e,t,n){let i,r,o={};for(r in e)if(e.hasOwnProperty(r)){let a=e[r];i=r,n&&r==="normalMC"?i="normalEC":n&&r==="tangentMC"&&(i="tangentEC"),t.hasOwnProperty(i)&&(o[i]=a)}let s=[];for(r in t)if(t.hasOwnProperty(r)){if(eYe.hasOwnProperty(r))continue;i=r,n&&r==="normalEC"?i="normalMC":n&&r==="tangentEC"&&(i="tangentMC"),e.hasOwnProperty(i)||s.push(r)}return{addToShader:o,missingAttributes:s}}function tYe(e,t){let n={enabled:!1},i={enabled:!1},r=Xqe(t.attributes);l(e.vertexShaderText)&&Zqe(e,r,n),l(e.fragmentShaderText)&&Qqe(e,r,i);let s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&i.enabled;return{vertexLines:n,fragmentLines:i,vertexLinesEnabled:n.enabled,fragmentLinesEnabled:i.enabled,customShaderEnabled:n.enabled||i.enabled,shouldComputePositionWC:s}}function nYe(e,t){let n,i=dr.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(i,dr.STRUCT_NAME_ATTRIBUTES,Se.VERTEX);let r=t.attributeFields;for(n=0;n<r.length;n++){let a=r[n],c=a[0],u=a[1];e.addStructField(i,c,u)}i=dr.STRUCT_ID_VERTEX_INPUT,e.addStruct(i,dr.STRUCT_NAME_VERTEX_INPUT,Se.VERTEX),e.addStructField(i,dr.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(i,Ex.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(i,Hp.STRUCT_NAME_METADATA,"metadata"),e.addStructField(i,Hp.STRUCT_NAME_METADATACLASS,"metadataClass");let o=dr.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(o,dr.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,Se.VERTEX);let s=t.initializationLines;e.addFunctionLines(o,s)}function iYe(e,t){let n,i=dr.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(i,dr.STRUCT_NAME_ATTRIBUTES,Se.FRAGMENT);let r,o,s,a=t.attributeFields;for(n=0;n<a.length;n++)r=a[n],o=r[0],s=r[1],e.addStructField(i,o,s);i=dr.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(i,dr.STRUCT_NAME_FRAGMENT_INPUT,Se.FRAGMENT),e.addStructField(i,dr.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(i,Ex.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(i,Hp.STRUCT_NAME_METADATA,"metadata"),e.addStructField(i,Hp.STRUCT_NAME_METADATACLASS,"metadataClass");let c=dr.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(c,dr.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,Se.FRAGMENT);let u=t.initializationLines;e.addFunctionLines(c,u)}function rYe(e,t,n){let i=n.vertexLines;i.enabled&&(nYe(e,i),e.addVertexLines(["#line 0",t.vertexShaderText,RF]));let r=n.fragmentLines;r.enabled&&(iYe(e,r),e.addFragmentLines(["#line 0",t.fragmentShaderText,MF]))}dr._oneTimeWarning=Lt;var kF=dr;var UF=`void filterByPassType(inout vec3 positionMC, vec4 featureColor)
- {
- bool styleTranslucent = (featureColor.a != 1.0);
- if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
- {
- #ifdef HAS_SILHOUETTE
- positionMC *= float(model_silhouettePass);
- #else
- positionMC *= 0.0;
- #endif
- }
- else if (czm_pass != czm_passTranslucent && styleTranslucent)
- {
- positionMC *= 0.0;
- }
- }
- void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature)
- {
- float show = ceil(feature.color.a);
- positionMC *= show;
- #ifdef HAS_SELECTED_FEATURE_ID_ATTRIBUTE
- filterByPassType(positionMC, feature.color);
- #endif
- }
- `;var zF=`void filterByPassType(vec4 featureColor)
- {
- bool styleTranslucent = (featureColor.a != 1.0);
- if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
- {
- #ifdef HAS_SILHOUETTE
- if(!model_silhouettePass) {
- discard;
- }
- #else
- discard;
- #endif
- }
- else if (czm_pass != czm_passTranslucent && styleTranslucent)
- {
- discard;
- }
- }
- void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature)
- {
- vec4 featureColor = feature.color;
- if (featureColor.a == 0.0)
- {
- discard;
- }
- #ifdef HAS_SELECTED_FEATURE_ID_TEXTURE
- filterByPassType(featureColor);
- #endif
- featureColor = czm_gammaCorrect(featureColor);
- float highlight = ceil(model_colorBlend);
- material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight);
- material.alpha *= featureColor.a;
- }
- `;var cW={};cW.name="CPUStylingPipelineStage";cW.process=function(e,t,n){let i=e.model,r=e.shaderBuilder;r.addVertexLines([UF]),r.addFragmentLines([zF]),r.addDefine("USE_CPU_STYLING",void 0,Se.BOTH),l(i.color)||(r.addUniform("float",bx.COLOR_BLEND_UNIFORM_NAME,Se.FRAGMENT),e.uniformMap[bx.COLOR_BLEND_UNIFORM_NAME]=function(){return Ds.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),r.addUniform("bool","model_commandTranslucent",Se.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Ce.TRANSLUCENT};let o=i.featureTables[i.featureTableId],s=Mc.getStyleCommandsNeeded(o.featuresLength,o.batchTexture.translucentFeaturesLength);s===Mc.ALL_TRANSLUCENT&&(e.alphaOptions.pass=Ce.TRANSLUCENT),e.styleCommandsNeeded=s};var HF=cW;var Wg={};Wg.name="DequantizationPipelineStage";Wg.FUNCTION_ID_DEQUANTIZATION_STAGE_VS="dequantizationStage";Wg.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS="void dequantizationStage(inout ProcessedAttributes attributes)";Wg.process=function(e,t,n){let i=e.shaderBuilder;i.addFunction(Wg.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,Wg.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,Se.VERTEX),i.addDefine("USE_DEQUANTIZATION",void 0,Se.VERTEX);let r=t.attributes;for(let o=0;o<r.length;o++){let s=r[o],a=s.quantization;if(!l(a))continue;let c=Ut.getAttributeInfo(s);sYe(i,c),oYe(e,c)}};function oYe(e,t){let n=e.shaderBuilder,i=e.uniformMap,r=t.variableName,o=t.attribute.quantization;if(o.octEncoded){let s=`model_normalizationRange_${r}`;n.addUniform("float",s,Se.VERTEX),i[s]=function(){return o.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${r}`,a=`model_quantizedVolumeStepSize_${r}`,c=t.glslType;n.addUniform(c,s,Se.VERTEX),n.addUniform(c,a,Se.VERTEX);let u=o.quantizedVolumeOffset,f=o.quantizedVolumeStepSize;/^color_\d+$/.test(r)&&(u=Dle(u,0),f=Dle(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function Dle(e,t){return e instanceof se?e:new se(e.x,e.y,e.z,t)}function sYe(e,t){let n=t.variableName,i=t.attribute.quantization,r;i.octEncoded?r=aYe(n,i):r=cYe(n),e.addFunctionLines(Wg.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[r])}function aYe(e,t){let n=`attributes.${e}`,i=`a_quantized_${e}`,r=`model_normalizationRange_${e}`,o=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${r})${o};`}function cYe(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,r=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${r};`}var GF=Wg;var WF=`void geometryStage(out ProcessedAttributes attributes)
- {
- attributes.positionMC = v_positionMC;
- attributes.positionEC = v_positionEC;
- #ifdef COMPUTE_POSITION_WC_CUSTOM_SHADER
- attributes.positionWC = v_positionWC;
- #endif
- #ifdef HAS_NORMALS
- attributes.normalEC = normalize(v_normalEC);
- #endif
- #ifdef HAS_TANGENTS
- attributes.tangentEC = normalize(v_tangentEC);
- #endif
- #ifdef HAS_BITANGENTS
- attributes.bitangentEC = normalize(v_bitangentEC);
- #endif
- setDynamicVaryings(attributes);
- }
- `;var jF=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal)
- {
- vec4 computedPosition;
- vec3 positionMC = attributes.positionMC;
- v_positionMC = positionMC;
- v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz;
- #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)
- vec3 position2D = attributes.position2D;
- vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz;
- computedPosition = czm_projection * vec4(positionEC, 1.0);
- #else
- computedPosition = czm_projection * vec4(v_positionEC, 1.0);
- #endif
- #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE)
- v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;
- #endif
- #ifdef HAS_NORMALS
- v_normalEC = normal * attributes.normalMC;
- #endif
- #ifdef HAS_TANGENTS
- v_tangentEC = normalize(normal * attributes.tangentMC);
- #endif
- #ifdef HAS_BITANGENTS
- v_bitangentEC = normalize(normal * attributes.bitangentMC);
- #endif
- setDynamicVaryings(attributes);
- return computedPosition;
- }
- `;var jg={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};jg.is3DTiles=function(e){switch(e){case jg.TILE_GLTF:case jg.TILE_B3DM:case jg.TILE_I3DM:case jg.TILE_PNTS:case jg.TILE_GEOJSON:return!0;case jg.GLTF:return!1}};var Os=Object.freeze(jg);var kv=`vec2 computeSt(float featureId)
- {
- float stepX = model_textureStep.x;
- float centerX = model_textureStep.y;
- #ifdef MULTILINE_BATCH_TEXTURE
- float stepY = model_textureStep.z;
- float centerY = model_textureStep.w;
- float xId = mod(featureId, model_textureDimensions.x);
- float yId = floor(featureId / model_textureDimensions.x);
- return vec2(centerX + (xId * stepX), centerY + (yId * stepY));
- #else
- return vec2(centerX + (featureId * stepX), 0.5);
- #endif
- }
- void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds)
- {
- int featureId = featureIds.SELECTED_FEATURE_ID;
- if (featureId < model_featuresLength)
- {
- vec2 featureSt = computeSt(float(featureId));
- feature.id = featureId;
- feature.st = featureSt;
- feature.color = texture2D(model_batchTexture, featureSt);
- }
- else
- {
- feature.id = model_featuresLength + 1;
- feature.st = vec2(0.0);
- feature.color = vec4(1.0);
- }
- #ifdef HAS_NULL_FEATURE_ID
- if (featureId == model_nullFeatureId) {
- feature.id = featureId;
- feature.st = vec2(0.0);
- feature.color = vec4(1.0);
- }
- #endif
- }
- `;var Ad={};Ad.name="SelectedFeatureIdPipelineStage";Ad.STRUCT_ID_SELECTED_FEATURE="SelectedFeature";Ad.STRUCT_NAME_SELECTED_FEATURE="SelectedFeature";Ad.FUNCTION_ID_FEATURE_VARYINGS_VS="updateFeatureStructVS";Ad.FUNCTION_ID_FEATURE_VARYINGS_FS="updateFeatureStructFS";Ad.FUNCTION_SIGNATURE_UPDATE_FEATURE="void updateFeatureStruct(inout SelectedFeature feature)";Ad.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let r=e.model,o=e.runtimeNode.node,s=lYe(r,o,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),uYe(i);let c=s.featureIds.nullFeatureId,u=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),u.model_nullFeatureId=function(){return c}),s.shaderDestination===Se.BOTH&&i.addVertexLines([kv]),i.addFragmentLines([kv])};function Ple(e){return e instanceof kt.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Ile(e){return e instanceof kt.FeatureIdTexture?Se.FRAGMENT:Se.BOTH}function lYe(e,t,n){let i,r;return l(t.instances)&&(r=Ut.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(r))?(i=y(r.label,r.positionalLabel),{featureIds:r,variableName:i,shaderDestination:Ile(r),featureIdDefine:Ple(r)}):(r=Ut.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=y(r.label,r.positionalLabel),{featureIds:r,variableName:i,shaderDestination:Ile(r),featureIdDefine:Ple(r)})}function uYe(e){e.addStructField(Ad.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(Ad.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(Ad.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var Sx=Ad;var Or={};Or.name="GeometryPipelineStage";Or.STRUCT_ID_PROCESSED_ATTRIBUTES_VS="ProcessedAttributesVS";Or.STRUCT_ID_PROCESSED_ATTRIBUTES_FS="ProcessedAttributesFS";Or.STRUCT_NAME_PROCESSED_ATTRIBUTES="ProcessedAttributes";Or.FUNCTION_ID_INITIALIZE_ATTRIBUTES="initializeAttributes";Or.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES="void initializeAttributes(out ProcessedAttributes attributes)";Or.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS="setDynamicVaryingsVS";Or.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS="setDynamicVaryingsFS";Or.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS="void setDynamicVaryings(inout ProcessedAttributes attributes)";Or.process=function(e,t,n){let i=e.shaderBuilder;i.addStruct(Or.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",Se.VERTEX),i.addStruct(Or.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",Se.FRAGMENT),i.addStruct(Sx.STRUCT_ID_SELECTED_FEATURE,Sx.STRUCT_NAME_SELECTED_FEATURE,Se.BOTH),i.addFunction(Or.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Or.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,Se.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Or.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Or.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Or.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Or.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,Se.VERTEX),i.addFunction(Or.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Or.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,Se.FRAGMENT);let r=e.model;r.type===Os.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,Se.FRAGMENT);let s=n.mode!==te.SCENE3D&&!n.scene3DOnly&&r._projectTo2D,a=l(e.runtimeNode.node.instances),c=s&&!a,u=t.attributes.length;for(let f=0;f<u;f++){let d=t.attributes[f],p=qt.getAttributeLocationCount(d.type),g=d.semantic===jt.POSITION,m;p>1?(m=e.attributeIndex,e.attributeIndex+=p):g&&!c?m=0:m=e.attributeIndex++,fYe(e,d,m,p,s,a)}CYe(i,t.attributes),t.primitiveType===Me.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines([jF]),i.addFragmentLines([WF])};function fYe(e,t,n,i,r,o){let s=e.shaderBuilder,a=Ut.getAttributeInfo(t),c=r&&!o;i>1?mYe(e,t,n,i):hYe(e,t,n,c),_Ye(s,a,c),pYe(s,a),l(t.semantic)&&dYe(s,t),gYe(s,a,r),yYe(s,a,c),xYe(s,a)}function dYe(e,t){let n=t.semantic,i=t.setIndex;switch(n){case jt.NORMAL:e.addDefine("HAS_NORMALS");break;case jt.TANGENT:e.addDefine("HAS_TANGENTS");break;case jt.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case jt.TEXCOORD:case jt.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function hYe(e,t,n,i){let r=t.quantization,o,s;l(r)?(o=r.type,s=r.componentDatatype):(o=t.type,s=t.componentDatatype);let a=t.semantic,c=t.setIndex;a===jt.FEATURE_ID&&c>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=c+1);let u=a===jt.POSITION,f=u?0:n,d=qt.getNumberOfComponents(o),p={index:f,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:d,componentDatatype:s,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let g=e.runtimePrimitive.positionBuffer2D,m={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:d,componentDatatype:K.FLOAT,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(m)}function mYe(e,t,n,i){let r=t.quantization,o,s;l(r)?(o=r.type,s=r.componentDatatype):(o=t.type,s=t.componentDatatype);let a=t.normalized,u=qt.getNumberOfComponents(o)/i,f=K.getSizeInBytes(s),d=u*f,p=t.byteStride;for(let g=0;g<i;g++){let m=t.byteOffset+g*d,x={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:s,offsetInBytes:m,strideInBytes:p,normalize:a};e.attributes.push(x)}}function pYe(e,t){let n=t.variableName,i=`v_${n}`,r;n==="normalMC"?(i="v_normalEC",r=t.glslType):n==="tangentMC"?(r="vec3",i="v_tangentEC"):r=t.glslType,e.addVarying(r,i)}function _Ye(e,t,n){let i=t.attribute.semantic,r=t.variableName,o,s;t.isQuantized?(o=`a_quantized_${r}`,s=t.quantizedGlslType):(o=`a_${r}`,s=t.glslType);let a=i===jt.POSITION;a?e.setPositionAttribute(s,o):e.addAttribute(s,o),a&&n&&e.addAttribute("vec3","a_position2D")}function gYe(e,t,n){let i=Or.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,r=Or.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,o=t.variableName;o==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(r,"vec3","tangentEC")):o==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(r,"vec3","normalEC")):(e.addStructField(i,t.glslType,o),e.addStructField(r,t.glslType,o)),o==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function yYe(e,t,n){let i=Or.FUNCTION_ID_INITIALIZE_ATTRIBUTES,r=t.variableName;if(r==="positionMC"&&n){let a="attributes.position2D = a_position2D;";e.addFunctionLines(i,[a])}if(t.isQuantized)return;let s=[];r==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${r} = a_${r};`),e.addFunctionLines(i,s)}function xYe(e,t){let n=t.attribute.semantic,i=t.attribute.setIndex;if(l(n)&&!l(i))return;let r=Or.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,o=t.variableName,s=`v_${o} = attributes.${o};`;e.addFunctionLines(r,[s]),r=Or.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${o} = v_${o};`,e.addFunctionLines(r,[s])}function CYe(e,t){let n=!1,i=!1;for(let r=0;r<t.length;r++){let o=t[r];o.semantic===jt.NORMAL?n=!0:o.semantic===jt.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Or.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Or.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var qF=Or;var YF=`#ifdef LIGHTING_PBR
- vec3 computePbrLighting(czm_modelMaterial inputMaterial, ProcessedAttributes attributes)
- {
- czm_pbrParameters pbrParameters;
- pbrParameters.diffuseColor = inputMaterial.diffuse;
- pbrParameters.f0 = inputMaterial.specular;
- pbrParameters.roughness = inputMaterial.roughness;
- #ifdef USE_CUSTOM_LIGHT_COLOR
- vec3 lightColorHdr = model_lightColorHdr;
- #else
- vec3 lightColorHdr = czm_lightColorHdr;
- #endif
- vec3 color = inputMaterial.diffuse;
- #ifdef HAS_NORMALS
- color = czm_pbrLighting(
- attributes.positionEC,
- inputMaterial.normalEC,
- czm_lightDirectionEC,
- lightColorHdr,
- pbrParameters
- );
- #ifdef USE_IBL_LIGHTING
- color += imageBasedLightingStage(
- attributes.positionEC,
- inputMaterial.normalEC,
- czm_lightDirectionEC,
- lightColorHdr,
- pbrParameters
- );
- #endif
- #endif
- color *= inputMaterial.occlusion;
- color += inputMaterial.emissive;
- #ifndef HDR
- color = czm_acesTonemapping(color);
- #endif
- return color;
- }
- #endif
- void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes)
- {
- vec3 color = vec3(0.0);
- #ifdef LIGHTING_PBR
- color = computePbrLighting(material, attributes);
- #else // unlit
- color = material.diffuse;
- #endif
- #ifdef HAS_POINT_CLOUD_COLOR_STYLE
- color = czm_gammaCorrect(color);
- #elif !defined(HDR)
- color = czm_linearToSrgb(color);
- #endif
- material.diffuse = color;
- }
- `;var AYe={UNLIT:0,PBR:1},Gp=Object.freeze(AYe);var lW={};lW.name="LightingPipelineStage";lW.process=function(e,t){let n=e.model,i=e.lightingOptions,r=e.shaderBuilder;if(l(n.lightColor)){r.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,Se.FRAGMENT),r.addUniform("vec3","model_lightColorHdr",Se.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}i.lightingModel===Gp.PBR?r.addDefine("LIGHTING_PBR",void 0,Se.FRAGMENT):r.addDefine("LIGHTING_UNLIT",void 0,Se.FRAGMENT),r.addFragmentLines([YF])};var XF=lW;var KF=`bool isDefaultStyleColor(vec3 color)
- {
- return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));
- }
- vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend)
- {
- vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend);
- vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor;
- return color;
- }
- vec2 computeTextureTransform(vec2 texCoord, mat3 textureTransform)
- {
- return vec2(textureTransform * vec3(texCoord, 1.0));
- }
- #ifdef HAS_NORMALS
- vec3 computeNormal(ProcessedAttributes attributes)
- {
- vec3 ng = attributes.normalEC;
- vec3 normal = ng;
- #if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)
- vec2 normalTexCoords = TEXCOORD_NORMAL;
- #ifdef HAS_NORMAL_TEXTURE_TRANSFORM
- normalTexCoords = computeTextureTransform(normalTexCoords, u_normalTextureTransform);
- #endif
- #ifdef HAS_BITANGENTS
- vec3 t = attributes.tangentEC;
- vec3 b = attributes.bitangentEC;
- mat3 tbn = mat3(t, b, ng);
- vec3 n = texture2D(u_normalTexture, normalTexCoords).rgb;
- normal = normalize(tbn * (2.0 * n - 1.0));
- #elif defined(GL_OES_standard_derivatives)
- vec3 positionEC = attributes.positionEC;
- vec3 pos_dx = dFdx(positionEC);
- vec3 pos_dy = dFdy(positionEC);
- vec3 tex_dx = dFdx(vec3(normalTexCoords,0.0));
- vec3 tex_dy = dFdy(vec3(normalTexCoords,0.0));
- vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);
- t = normalize(t - ng * dot(ng, t));
- vec3 b = normalize(cross(ng, t));
- mat3 tbn = mat3(t, b, ng);
- vec3 n = texture2D(u_normalTexture, normalTexCoords).rgb;
- normal = normalize(tbn * (2.0 * n - 1.0));
- #endif
- #endif
- #ifdef HAS_DOUBLE_SIDED_MATERIAL
- if (czm_backFacing()) {
- normal = -normal;
- }
- #endif
- return normal;
- }
- #endif
- void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature)
- {
- #ifdef HAS_NORMALS
- material.normalEC = computeNormal(attributes);
- #endif
- vec4 baseColorWithAlpha = vec4(1.0);
- #ifdef HAS_BASE_COLOR_TEXTURE
- vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR;
- #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM
- baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform);
- #endif
- baseColorWithAlpha = czm_srgbToLinear(texture2D(u_baseColorTexture, baseColorTexCoords));
- #ifdef HAS_BASE_COLOR_FACTOR
- baseColorWithAlpha *= u_baseColorFactor;
- #endif
- #elif defined(HAS_BASE_COLOR_FACTOR)
- baseColorWithAlpha = u_baseColorFactor;
- #endif
- #ifdef HAS_POINT_CLOUD_COLOR_STYLE
- baseColorWithAlpha = v_pointCloudColor;
- #elif defined(HAS_COLOR_0)
- vec4 color = attributes.color_0;
- #ifdef HAS_SRGB_COLOR
- color = czm_srgbToLinear(color);
- #endif
- baseColorWithAlpha *= color;
- #endif
- material.diffuse = baseColorWithAlpha.rgb;
- material.alpha = baseColorWithAlpha.a;
- #ifdef USE_CPU_STYLING
- material.diffuse = blend(material.diffuse, feature.color.rgb, model_colorBlend);
- #endif
- #ifdef HAS_OCCLUSION_TEXTURE
- vec2 occlusionTexCoords = TEXCOORD_OCCLUSION;
- #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM
- occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform);
- #endif
- material.occlusion = texture2D(u_occlusionTexture, occlusionTexCoords).r;
- #endif
- #ifdef HAS_EMISSIVE_TEXTURE
- vec2 emissiveTexCoords = TEXCOORD_EMISSIVE;
- #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM
- emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform);
- #endif
- vec3 emissive = czm_srgbToLinear(texture2D(u_emissiveTexture, emissiveTexCoords).rgb);
- #ifdef HAS_EMISSIVE_FACTOR
- emissive *= u_emissiveFactor;
- #endif
- material.emissive = emissive;
- #elif defined(HAS_EMISSIVE_FACTOR)
- material.emissive = u_emissiveFactor;
- #endif
- #if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)
- #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE
- vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS;
- #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM
- specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform);
- #endif
- vec4 specularGlossiness = czm_srgbToLinear(texture2D(u_specularGlossinessTexture, specularGlossinessTexCoords));
- vec3 specular = specularGlossiness.rgb;
- float glossiness = specularGlossiness.a;
- #ifdef HAS_SPECULAR_FACTOR
- specular *= u_specularFactor;
- #endif
- #ifdef HAS_GLOSSINESS_FACTOR
- glossiness *= u_glossinessFactor;
- #endif
- #else
- #ifdef HAS_SPECULAR_FACTOR
- vec3 specular = clamp(u_specularFactor, vec3(0.0), vec3(1.0));
- #else
- vec3 specular = vec3(1.0);
- #endif
- #ifdef HAS_GLOSSINESS_FACTOR
- float glossiness = clamp(u_glossinessFactor, 0.0, 1.0);
- #else
- float glossiness = 1.0;
- #endif
- #endif
- #ifdef HAS_DIFFUSE_TEXTURE
- vec2 diffuseTexCoords = TEXCOORD_DIFFUSE;
- #ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM
- diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform);
- #endif
- vec4 diffuse = czm_srgbToLinear(texture2D(u_diffuseTexture, diffuseTexCoords));
- #ifdef HAS_DIFFUSE_FACTOR
- diffuse *= u_diffuseFactor;
- #endif
- #elif defined(HAS_DIFFUSE_FACTOR)
- vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0));
- #else
- vec4 diffuse = vec4(1.0);
- #endif
- czm_pbrParameters parameters = czm_pbrSpecularGlossinessMaterial(
- diffuse.rgb,
- specular,
- glossiness
- );
- material.diffuse = parameters.diffuseColor;
- material.alpha = diffuse.a;
- material.specular = parameters.f0;
- material.roughness = parameters.roughness;
- #elif defined(LIGHTING_PBR)
- #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE
- vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS;
- #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM
- metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform);
- #endif
- vec3 metallicRoughness = texture2D(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb;
- float metalness = clamp(metallicRoughness.b, 0.0, 1.0);
- float roughness = clamp(metallicRoughness.g, 0.04, 1.0);
- #ifdef HAS_METALLIC_FACTOR
- metalness *= u_metallicFactor;
- #endif
- #ifdef HAS_ROUGHNESS_FACTOR
- roughness *= u_roughnessFactor;
- #endif
- #else
- #ifdef HAS_METALLIC_FACTOR
- float metalness = clamp(u_metallicFactor, 0.0, 1.0);
- #else
- float metalness = 1.0;
- #endif
- #ifdef HAS_ROUGHNESS_FACTOR
- float roughness = clamp(u_roughnessFactor, 0.04, 1.0);
- #else
- float roughness = 1.0;
- #endif
- #endif
- czm_pbrParameters parameters = czm_pbrMetallicRoughnessMaterial(
- material.diffuse,
- metalness,
- roughness
- );
- material.diffuse = parameters.diffuseColor;
- material.specular = parameters.f0;
- material.roughness = parameters.roughness;
- #endif
- }
- `;var TYe=kt.Material,uW=kt.MetallicRoughness,fW=kt.SpecularGlossiness,Uv={};Uv.name="MaterialPipelineStage";Uv.process=function(e,t,n){let i=t.material,r=e.uniformMap,o=e.shaderBuilder,s=n.context.defaultTexture,a=n.context.defaultNormalTexture,c=n.context.defaultEmissiveTexture;bYe(i,r,o,s,a,c),l(i.specularGlossiness)?EYe(i,r,o,s):SYe(i,r,o,s);let u=Ut.getAttributeBySemantic(t,jt.NORMAL),f=e.lightingOptions;i.unlit||!u?f.lightingModel=Gp.UNLIT:f.lightingModel=Gp.PBR;let p=e.model.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=p;let g=e.alphaOptions;i.alphaMode===vp.BLEND?g.pass=Ce.TRANSLUCENT:i.alphaMode===vp.MASK&&(g.alphaCutoff=i.alphaCutoff),o.addFragmentLines([KF]),i.doubleSided&&o.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,Se.FRAGMENT)};function Ole(e,t,n,i,r){let o=`HAS_${r}_TEXTURE_TRANSFORM`;e.addDefine(o,void 0,Se.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,Se.FRAGMENT),t[s]=function(){return n.transform}}function qg(e,t,n,i,r,o){e.addUniform("sampler2D",i,Se.FRAGMENT),t[i]=function(){return y(n.texture,o)};let s=`HAS_${r}_TEXTURE`;e.addDefine(s,void 0,Se.FRAGMENT);let c=`v_texCoord_${n.texCoord}`,u=`TEXCOORD_${r}`;e.addDefine(u,c,Se.FRAGMENT);let f=n.transform;l(f)&&!Q.equals(f,Q.IDENTITY)&&Ole(e,t,n,i,r)}function bYe(e,t,n,i,r,o){let s=e.emissiveTexture;l(s)&&qg(n,t,s,"u_emissiveTexture","EMISSIVE",o);let a=e.emissiveFactor;l(a)&&!h.equals(a,TYe.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",Se.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,Se.FRAGMENT));let c=e.normalTexture;l(c)&&qg(n,t,c,"u_normalTexture","NORMAL",r);let u=e.occlusionTexture;l(u)&&qg(n,t,u,"u_occlusionTexture","OCCLUSION",i)}function EYe(e,t,n,i){let r=e.specularGlossiness;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,Se.FRAGMENT);let o=r.diffuseTexture;l(o)&&qg(n,t,o,"u_diffuseTexture","DIFFUSE",i);let s=r.diffuseFactor;l(s)&&!se.equals(s,fW.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",Se.FRAGMENT),t.u_diffuseFactor=function(){return r.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,Se.FRAGMENT));let a=r.specularGlossinessTexture;l(a)&&qg(n,t,a,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i);let c=r.specularFactor;l(c)&&!h.equals(c,fW.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_specularFactor",Se.FRAGMENT),t.u_specularFactor=function(){return r.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,Se.FRAGMENT));let u=r.glossinessFactor;l(u)&&u!==fW.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",Se.FRAGMENT),t.u_glossinessFactor=function(){return r.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,Se.FRAGMENT))}function SYe(e,t,n,i){let r=e.metallicRoughness;n.addDefine("USE_METALLIC_ROUGHNESS",void 0,Se.FRAGMENT);let o=r.baseColorTexture;l(o)&&qg(n,t,o,"u_baseColorTexture","BASE_COLOR",i);let s=r.baseColorFactor;l(s)&&!se.equals(s,uW.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",Se.FRAGMENT),t.u_baseColorFactor=function(){return r.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,Se.FRAGMENT));let a=r.metallicRoughnessTexture;l(a)&&qg(n,t,a,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let c=r.metallicFactor;l(c)&&c!==uW.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",Se.FRAGMENT),t.u_metallicFactor=function(){return r.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,Se.FRAGMENT));let u=r.roughnessFactor;l(u)&&u!==uW.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",Se.FRAGMENT),t.u_roughnessFactor=function(){return r.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,Se.FRAGMENT))}Uv._processTexture=qg;Uv._processTextureTransform=Ole;var $F=Uv;var ZF=`void morphTargetsStage(inout ProcessedAttributes attributes)
- {
- vec3 positionMC = attributes.positionMC;
- attributes.positionMC = getMorphedPosition(positionMC);
- #ifdef HAS_NORMALS
- vec3 normalMC = attributes.normalMC;
- attributes.normalMC = getMorphedNormal(normalMC);
- #endif
- #ifdef HAS_TANGENTS
- vec3 tangentMC = attributes.tangentMC;
- attributes.tangentMC = getMorphedTangent(tangentMC);
- #endif
- }
- `;var So={};So.name="MorphTargetsPipelineStage";So.FUNCTION_ID_GET_MORPHED_POSITION="getMorphedPosition";So.FUNCTION_SIGNATURE_GET_MORPHED_POSITION="vec3 getMorphedPosition(in vec3 position)";So.FUNCTION_ID_GET_MORPHED_NORMAL="getMorphedNormal";So.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL="vec3 getMorphedNormal(in vec3 normal)";So.FUNCTION_ID_GET_MORPHED_TANGENT="getMorphedTangent";So.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT="vec3 getMorphedTangent(in vec3 tangent)";So.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,Se.VERTEX),OYe(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=d.semantic;p!==jt.POSITION&&p!==jt.NORMAL&&p!==jt.TANGENT||(vYe(e,d,e.attributeIndex,a),e.attributeIndex++)}}RYe(n);let o=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${o}]`,Se.VERTEX),n.addVertexLines([ZF]);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=rt(s,e.uniformMap)};var wYe={attributeString:void 0,functionId:void 0};function vYe(e,t,n,i){let r=e.shaderBuilder;DYe(e,t,n);let o=PYe(t,wYe);IYe(r,o,i)}function DYe(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:qt.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function PYe(e,t){switch(e.semantic){case jt.POSITION:t.attributeString="Position",t.functionId=So.FUNCTION_ID_GET_MORPHED_POSITION;break;case jt.NORMAL:t.attributeString="Normal",t.functionId=So.FUNCTION_ID_GET_MORPHED_NORMAL;break;case jt.TANGENT:t.attributeString="Tangent",t.functionId=So.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function IYe(e,t,n){let i=t.attributeString,r=`a_target${i}_${n}`,o=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",r),e.addFunctionLines(t.functionId,[o])}function OYe(e){e.addFunction(So.FUNCTION_ID_GET_MORPHED_POSITION,So.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,Se.VERTEX);let t="vec3 morphedPosition = position;";e.addFunctionLines(So.FUNCTION_ID_GET_MORPHED_POSITION,[t]),e.addFunction(So.FUNCTION_ID_GET_MORPHED_NORMAL,So.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,Se.VERTEX);let n="vec3 morphedNormal = normal;";e.addFunctionLines(So.FUNCTION_ID_GET_MORPHED_NORMAL,[n]),e.addFunction(So.FUNCTION_ID_GET_MORPHED_TANGENT,So.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,Se.VERTEX);let i="vec3 morphedTangent = tangent;";e.addFunctionLines(So.FUNCTION_ID_GET_MORPHED_TANGENT,[i])}function RYe(e){let t="return morphedPosition;";e.addFunctionLines(So.FUNCTION_ID_GET_MORPHED_POSITION,[t]);let n="return morphedNormal;";e.addFunctionLines(So.FUNCTION_ID_GET_MORPHED_NORMAL,[n]);let i="return morphedTangent;";e.addFunctionLines(So.FUNCTION_ID_GET_MORPHED_TANGENT,[i])}var JF=So;var dW={};dW.name="PickingPipelineStage";dW.process=function(e,t,n){let i=n.context,r=e.runtimeNode,o=e.shaderBuilder,s=e.model,a=r.node.instances;if(e.hasPropertyTable)MYe(e,t,a,i);else if(l(a))BYe(e,i);else{let c=Rle(e),u=i.createPickId(c);s._pipelineResources.push(u),s._pickIds.push(u),o.addUniform("vec4","czm_pickColor",Se.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor"}};function Rle(e,t){let n=e.model,i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},r;if(Os.is3DTiles(n.type)){let o=n.content;r={content:o,primitive:o.tileset,detail:i}}else r={primitive:n,detail:i};return r.id=n.id,l(t)&&(r.instanceId=t),r}function MYe(e,t,n){let i=e.model,r,o,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?r=i.featureTableId:l(n)?(o=Ut.getFeatureIdsByLabel(n.featureIds,a),r=o.propertyTableId):(o=Ut.getFeatureIdsByLabel(t.featureIds,s),r=o.propertyTableId);let c=i.featureTables[r];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",Se.FRAGMENT);let f=c.batchTexture;e.uniformMap.model_pickTexture=function(){return y(f.pickTexture,f.defaultTexture)},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture2D(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function BYe(e,t){let n=e.instanceCount,i=new Array(n),r=new Uint8Array(n*4),o=e.model,s=o._pipelineResources;for(let d=0;d<n;d++){let p=Rle(e,d),g=t.createPickId(p);s.push(g),i[d]=g;let m=g.color;r[d*4+0]=z.floatToByte(m.red),r[d*4+1]=z.floatToByte(m.green),r[d*4+2]=z.floatToByte(m.blue),r[d*4+3]=z.floatToByte(m.alpha)}o._pickIds=i;let a=at.createVertexBuffer({context:t,typedArray:r,usage:Ne.STATIC_DRAW});a.vertexArrayDestroyable=!1;let c=!1;o.statistics.addBuffer(a,c),s.push(a);let u={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:K.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,Se.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var QF=dW;var e2=`float getPointSizeFromAttenuation(vec3 positionEC) {
- float pointSize = model_pointCloudParameters.x;
- float geometricError = model_pointCloudParameters.y;
- float depthMultiplier = model_pointCloudParameters.z;
- float depth = -positionEC.z;
- return min((geometricError / depth) * depthMultiplier, pointSize);
- }
- #ifdef HAS_POINT_CLOUD_SHOW_STYLE
- float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
- float tiles3d_tileset_time = model_pointCloudParameters.w;
- return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time));
- }
- #endif
- #ifdef HAS_POINT_CLOUD_COLOR_STYLE
- vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
- float tiles3d_tileset_time = model_pointCloudParameters.w;
- return getColorFromStyle(attributes, metadata, tiles3d_tileset_time);
- }
- #endif
- #ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE
- float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
- float tiles3d_tileset_time = model_pointCloudParameters.w;
- return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time));
- }
- #elif defined(HAS_POINT_CLOUD_ATTENUATION)
- float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
- return getPointSizeFromAttenuation(v_positionEC);
- }
- #endif
- `;var LYe=new se,pW={};pW.name="PointCloudStylingPipelineStage";pW.process=function(e,t,n){let i=e.shaderBuilder,r=e.model,o=r.style,s=r.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(r.featureTableId)&&r.featureTables[r.featureTableId].featuresLength>0,u=!l(a)&&c;if(l(o)&&!u){let x=kYe(a),C=UYe(o,x);zYe(i,C);let b=HYe(C).indexOf("normalMC")>=0,T=Ut.getAttributeBySemantic(t,jt.NORMAL);if(b&&!T)throw new fe("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,Se.VERTEX),C.styleTranslucent&&(e.alphaOptions.pass=Ce.TRANSLUCENT)}let f=r.pointCloudShading;r._attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,Se.VERTEX);let d,p,g;Os.is3DTiles(r.type)&&(p=!0,d=r.content,g=d.tile.refine===Eo.ADD),i.addUniform("vec4","model_pointCloudParameters",Se.VERTEX),i.addVertexLines([e2]);let m=e.uniformMap;m.model_pointCloudParameters=function(){let x=LYe,C=1;p&&(C=g?5:d.tileset.maximumScreenSpaceError),x.x=y(f.maximumAttenuation,C),x.x*=n.pixelRatio;let A=NYe(e,t,f,d);x.y=A*f.geometricErrorScale;let b=n.context,T=n.camera.frustum,S;return n.mode===te.SCENE2D||T instanceof en?S=Number.POSITIVE_INFINITY:S=b.drawingBufferHeight/n.camera.frustum.sseDenominator,x.z=S,p&&(x.w=d.tileset.timeSinceLoad),x}};var Mle=new h;function NYe(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let r=Ut.getAttributeBySemantic(t,jt.POSITION),o=r.count,s=e.runtimeNode.transform,a=h.subtract(r.max,r.min,Mle);a=N.multiplyByPointAsVector(s,a,Mle);let c=a.x*a.y*a.z;return M.cbrt(c/o)}var FYe={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},VYe={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function kYe(e){let t=$e(VYe);if(!l(e))return t;for(let n=0;n<e.length;n++){let r=e[n].properties;for(let o in r)r.hasOwnProperty(o)&&(t[o]=`metadata.${o}`)}return t}var hW="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function UYe(e,t){let n=FYe,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${hW})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${hW})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${hW})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function zYe(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,Se.BOTH),e.addVertexLines([n]),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,Se.VERTEX),e.addVertexLines([i]));let r=t.pointSizeStyleFunction;l(r)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,Se.VERTEX),e.addVertexLines([r]))}function mW(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function HYe(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,r=[];return l(t)&&mW(t,r),l(n)&&mW(n,r),l(i)&&mW(i,r),r}var t2=pW;var n2=`void primitiveOutlineStage() {
- v_outlineCoordinates = a_outlineCoordinates;
- }
- `;var i2=`void primitiveOutlineStage(inout czm_modelMaterial material) {
- if (!model_showOutline) {
- return;
- }
- float outlineX =
- texture2D(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r;
- float outlineY =
- texture2D(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r;
- float outlineZ =
- texture2D(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r;
- float outlineness = max(outlineX, max(outlineY, outlineZ));
- material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness);
- }
- `;var _W={};_W.name="PrimitiveOutlinePipelineStage";_W.process=function(e,t,n){let i=e.shaderBuilder,r=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,Se.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let o=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:o.buffer,componentsPerAttribute:qt.getNumberOfComponents(o.type),componentDatatype:o.componentDatatype,offsetInBytes:o.byteOffset,strideInBytes:o.byteStride,normalize:o.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",Se.FRAGMENT);let a=im.createTexture(n.context);r.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",Se.FRAGMENT),r.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",Se.FRAGMENT),r.model_showOutline=function(){return c.showOutline},i.addVertexLines([n2]),i.addFragmentLines([i2])};var r2=_W;var Wp={};Wp.name="PrimitiveStatisticsPipelineStage";Wp.process=function(e,t,n){let i=e.model,r=i.statistics;Ble(r,t),Lle(r,e.runtimePrimitive),Nle(r,t),Fle(r,t.material),Vle(r,t.featureIds),kle(r,i)};function Ble(e,t){let n=l(t.indices)?t.indices.count:Ut.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Me.POINTS?e.pointsLength+=n:Me.isTriangles(i)&&(e.trianglesLength+=GYe(i,n));let r=t.attributes,o=r.length;for(let c=0;c<o;c++){let u=r[c];if(l(u.buffer)){let f=l(u.typedArray);e.addBuffer(u.buffer,f)}}let s=t.outlineCoordinates;l(s)&&l(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(l(a)&&l(a.buffer)){let c=l(a.typedArray);e.addBuffer(a.buffer,c)}}function GYe(e,t){switch(e){case Me.TRIANGLES:return t/3;case Me.TRIANGLE_STRIP:case Me.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function Lle(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function Nle(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,r=n.length;for(let o=0;o<r;o++){let s=n[o].attributes,a=s.length;for(let c=0;c<a;c++){let u=s[c];l(u.buffer)&&e.addBuffer(u.buffer,i)}}}function Fle(e,t){let n=WYe(t),i=n.length;for(let r=0;r<i;r++){let o=n[r];l(o)&&l(o.texture)&&e.addTexture(o.texture)}}function WYe(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return l(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function Vle(e,t){let n=t.length;for(let i=0;i<n;i++){let r=t[i];if(r instanceof kt.FeatureIdTexture){let o=r.textureReader;l(o.texture)&&e.addTexture(o.texture)}}}function kle(e,t){let n=t.structuralMetadata;l(n)&&(jYe(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let r=i.length;for(let o=0;o<r;o++){let s=i[o];e.addBatchTexture(s.batchTexture)}}function jYe(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let r=0;r<i;r++){let s=n[r].properties;for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].textureReader;l(u.texture)&&e.addTexture(u.texture)}}}Wp._countGeometry=Ble;Wp._count2DPositions=Lle;Wp._countMorphTargetAttributes=Nle;Wp._countMaterialTextures=Fle;Wp._countFeatureIdTextures=Vle;Wp._countBinaryMetadata=kle;var o2=Wp;var qYe=new N,YYe=new N,gW={};gW.name="SceneMode2DPipelineStage";gW.process=function(e,t,n){let i=Ut.getAttributeBySemantic(t,jt.POSITION),r=e.shaderBuilder,o=e.model,s=o.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=N.multiplyTransformation(s,a,qYe),u=$Ye(e,c,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let d=e.runtimeNode.node.instances;if(l(d))return;if(l(i.typedArray)){let x=QYe(i,c,u,n);f.positionBuffer2D=x,o._modelResources.push(x),i.typedArray=void 0}r.addDefine("USE_2D_POSITIONS",void 0,Se.VERTEX),r.addUniform("mat4","u_modelView2D",Se.VERTEX);let p=N.fromTranslation(u.center,new N),g=n.context,m={u_modelView2D:function(){return N.multiplyTransformation(g.uniformState.view,p,YYe)}};e.uniformMap=rt(m,e.uniformMap)};var XYe=new h,KYe=new h;function $Ye(e,t,n){let i=N.multiplyByPoint(t,e.positionMin,XYe),r=rr.computeActualWgs84Position(n,i,i),o=N.multiplyByPoint(t,e.positionMax,KYe),s=rr.computeActualWgs84Position(n,o,o);return re.fromCornerPoints(r,s,new re)}var Ule=new h;function ZYe(e,t){let n=e.length,i=new Float32Array(n),r=t.quantizedVolumeOffset,o=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=h.fromArray(e,s,Ule),c=h.multiplyComponents(a,o,a),u=h.add(c,r,c);i[s]=u.x,i[s+1]=u.y,i[s+2]=u.z}return i}function JYe(e,t,n,i){let r;l(e.quantization)?r=ZYe(e.typedArray,e.quantization):r=e.typedArray.slice();let o=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=r.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=o;c<s;c+=a){let u=h.fromArray(r,c,Ule);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=N.multiplyByPoint(t,u,u),d=rr.computeActualWgs84Position(i,f,f),p=h.subtract(d,n,d);r[c]=p.x,r[c+1]=p.y,r[c+2]=p.z}return r}function QYe(e,t,n,i){let r=$e(i);r.mode=te.COLUMBUS_VIEW;let o=n.center,s=JYe(e,t,o,r),a=at.createVertexBuffer({context:i.context,typedArray:s,usage:Ne.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var s2=gW;var a2=`void skinningStage(inout ProcessedAttributes attributes)
- {
- mat4 skinningMatrix = getSkinningMatrix();
- mat3 skinningMatrixMat3 = mat3(skinningMatrix);
- vec4 positionMC = vec4(attributes.positionMC, 1.0);
- attributes.positionMC = vec3(skinningMatrix * positionMC);
- #ifdef HAS_NORMALS
- vec3 normalMC = attributes.normalMC;
- attributes.normalMC = skinningMatrixMat3 * normalMC;
- #endif
- #ifdef HAS_TANGENTS
- vec3 tangentMC = attributes.tangentMC;
- attributes.tangentMC = skinningMatrixMat3 * tangentMC;
- #endif
- }
- `;var sm={};sm.name="SkinningPipelineStage";sm.FUNCTION_ID_GET_SKINNING_MATRIX="getSkinningMatrix";sm.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX="mat4 getSkinningMatrix()";sm.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,Se.VERTEX),tXe(n,t);let i=e.runtimeNode,r=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${r.length}]`,Se.VERTEX),n.addVertexLines([a2]);let o={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=rt(o,e.uniformMap)};function eXe(e){let t=-1,n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];(o.semantic===jt.JOINTS||o.semantic===jt.WEIGHTS)&&(t=Math.max(t,o.setIndex))}return t}function tXe(e,t){e.addFunction(sm.FUNCTION_ID_GET_SKINNING_MATRIX,sm.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,Se.VERTEX);let n="mat4 skinnedMatrix = mat4(0);";e.addFunctionLines(sm.FUNCTION_ID_GET_SKINNING_MATRIX,[n]);let i,r,o=["x","y","z","w"],s=eXe(t);for(i=0;i<=s;i++)for(r=0;r<=3;r++){let c=o[r],u=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(sm.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}let a="return skinnedMatrix;";e.addFunctionLines(sm.FUNCTION_ID_GET_SKINNING_MATRIX,[a])}var c2=sm;var yW={};yW.name="WireframePipelineStage";yW.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,Se.FRAGMENT);let r=e.model,o=nXe(t,e.indices,n);r._pipelineResources.push(o),e.wireframeIndexBuffer=o;let s=!1;r.statistics.addBuffer(o,s);let a=e.primitiveType,c=e.count;e.primitiveType=Me.LINES,e.count=hw.getWireframeIndicesCount(a,c)};function nXe(e,t,n){let r=Ut.getAttributeBySemantic(e,jt.POSITION).count,o=n.context.webgl2,s;if(l(t)){let f=t.buffer,d=t.count;l(f)&&o?(s=f.sizeInBytes===d?new Uint8Array(d):Le.createTypedArray(r,d),f.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=hw.createWireframeIndices(a,r,s),u=Le.fromSizeInBytes(c.BYTES_PER_ELEMENT);return at.createIndexBuffer({context:n.context,typedArray:c,usage:Ne.STATIC_DRAW,indexDatatype:u})}var l2=yW;function xb(e){e=y(e,y.EMPTY_OBJECT);let t=e.primitive,n=e.node,i=e.model;this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.updateStages=[]}xb.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,r=this.model,o=r.customShader,s=r.style,a=e.context.webgl2,u=e.mode!==te.SCENE3D&&!e.scene3DOnly&&r._projectTo2D,f=l(n.morphTargets)&&n.morphTargets.length>0,d=l(i.skin),p=l(o),m=!(p&&l(o.fragmentShaderText))||o.mode!==Gg.REPLACE_MATERIAL,x=Ut.hasQuantizedAttributes(n.attributes),C=r.debugWireframe&&Me.isTriangles(n.primitiveType)&&(r._enableDebugWireframe||a),A=r.pointCloudShading,b=l(A)&&A.attenuation,T=n.primitiveType===Me.POINTS&&(l(s)||b),S=r._enableShowOutline&&l(n.outlineCoordinates),w=iXe(r,i,n);u&&t.push(s2),t.push(qF),C&&t.push(l2),f&&t.push(JF),d&&t.push(c2),T&&t.push(t2),x&&t.push(GF),m&&t.push($F),t.push(Ex),t.push(Hp),w.hasPropertyTable&&(t.push(Sx),t.push(OF),t.push(HF)),p&&t.push(kF),t.push(XF),r.allowPicking&&t.push(QF),S&&t.push(r2),t.push(IF),t.push(o2)};function iXe(e,t,n){let i;return l(t.instances)&&(i=Ut.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=Ut.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}function wx(e){e=y(e,y.EMPTY_OBJECT),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],rXe(this)}Object.defineProperties(wx.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function rXe(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,r=i.length,o=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<r;c++){let u=i[c].index,f=o[u];s.push(f);let d=n[c],p=zle(f,d,new N);a.push(p)}}function zle(e,t,n){let i=N.multiplyTransformation(e.transformToRoot,e.transform,n);return n=N.multiplyTransformation(i,t,n),n}wx.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],r=this.inverseBindMatrices[n];e[n]=zle(i,r,e[n])}};function zv(){this.pass=void 0,this.alphaCutoff=void 0}function vx(e){this.name=e,this.fields=[]}vx.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};vx.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};function Dx(e){this.signature=e,this.body=[]}Dx.prototype.addLines=function(e){let t=e.map(function(n){return` ${n}`});Array.prototype.push.apply(this.body,t)};Dx.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};function Rs(){this._positionAttributeLine=void 0,this._nextAttributeLocation=1,this._attributeLocations={},this._attributeLines=[],this._structs={},this._functions={},this._vertexShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]},this._fragmentShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]}}Object.defineProperties(Rs.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Rs.prototype.addDefine=function(e,t,n){n=y(n,Se.BOTH);let i=e;l(t)&&(i+=` ${t.toString()}`),Se.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),Se.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Rs.prototype.addStruct=function(e,t,n){this._structs[e]=new vx(t),Se.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),Se.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Rs.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};Rs.prototype.addFunction=function(e,t,n){this._functions[e]=new Dx(t),Se.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),Se.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Rs.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};Rs.prototype.addUniform=function(e,t,n){n=y(n,Se.BOTH);let i=`uniform ${e} ${t};`;Se.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),Se.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Rs.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`attribute ${e} ${t};`,this._attributeLocations[t]=0,0};Rs.prototype.addAttribute=function(e,t){let n=`attribute ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=sXe(e),i};Rs.prototype.addVarying=function(e,t){let n=`varying ${e} ${t};`;this._vertexShaderParts.varyingLines.push(n),this._fragmentShaderParts.varyingLines.push(n)};Rs.prototype.addVertexLines=function(e){Array.prototype.push.apply(this._vertexShaderParts.shaderLines,e)};Rs.prototype.addFragmentLines=function(e){Array.prototype.push.apply(this._fragmentShaderParts.shaderLines,e)};Rs.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=oXe(this),i=aXe(this),r=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(`
- `),o=new Fe({defines:this._vertexShaderParts.defineLines,sources:[r]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(`
- `),a=new Fe({defines:this._fragmentShaderParts.defineLines,sources:[s]});return Wt.fromCache({context:e,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};Rs.prototype.clone=function(){return $e(this,!0)};function oXe(e){let t=[],n=[],i,r=e._vertexShaderParts.structIds,o,s,a;for(i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),t.push.apply(t,a);for(r=e._fragmentShaderParts.structIds,i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}function sXe(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function aXe(e){let t=[],n=[],i,r=e._vertexShaderParts.functionIds,o,s,a;for(i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),t.push.apply(t,a);for(r=e._fragmentShaderParts.functionIds,i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}function Hv(e){this.shaderBuilder=new Rs,this.model=e,this.uniformMap={},this.alphaOptions=new zv,this.renderStateOptions=Ve.getState(Ve.fromCache({depthTest:{enabled:!0,func:wc.LESS_OR_EQUAL}}))}var u2=`void silhouetteStage(inout vec4 color) {
- if(model_silhouettePass) {
- color = czm_gammaCorrect(model_silhouetteColor);
- }
- }
- `;var f2=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) {
- #ifdef HAS_NORMALS
- if(model_silhouettePass) {
- vec3 normal = normalize(czm_normal3D * attributes.normalMC);
- normal.x *= czm_projection[0][0];
- normal.y *= czm_projection[1][1];
- positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z;
- }
- #endif
- }
- `;var Gv={};Gv.name="ModelSilhouettePipelineStage";Gv.silhouettesLength=0;Gv.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++Gv.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,Se.BOTH),i.addVertexLines([f2]),i.addFragmentLines([u2]),i.addUniform("vec4","model_silhouetteColor",Se.FRAGMENT),i.addUniform("float","model_silhouetteSize",Se.VERTEX),i.addUniform("bool","model_silhouettePass",Se.BOTH);let r={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=rt(r,e.uniformMap)};var d2=Gv;var h2=`void modelSplitterStage()
- {
- #ifndef SHADOW_MAP
- if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
- if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
- #endif
- }
- `;var Cb={};Cb.name="ModelSplitterPipelineStage";Cb.SPLIT_DIRECTION_UNIFORM_NAME="model_splitDirection";Cb.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,Se.FRAGMENT),i.addFragmentLines([h2]);let r={};i.addUniform("float",Cb.SPLIT_DIRECTION_UNIFORM_NAME,Se.FRAGMENT),r[Cb.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=rt(r,e.uniformMap)};var m2=Cb;function Wv(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=$e(e.uniformMap),this.alphaOptions=$e(e.alphaOptions),this.renderStateOptions=$e(e.renderStateOptions,!0),this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0,this.instancingTranslationMax=void 0,this.instancingTranslationMin=void 0,this.instancingReferencePoint2D=void 0}function jv(e){e=y(e,y.EMPTY_OBJECT),this.lightingModel=y(e.lightingModel,Gp.UNLIT)}function qv(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.hasPropertyTable=!1,this.uniformMap=$e(e.uniformMap),this.alphaOptions=$e(e.alphaOptions),this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:Ut.getAttributeBySemantic(n,"POSITION").count,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=Ut.getPositionMinMax(n,e.instancingTranslationMin,e.instancingTranslationMax);this.positionMin=h.clone(i.min,new h),this.positionMax=h.clone(i.max,new h),this.boundingSphere=re.fromCornerPoints(this.positionMin,this.positionMax,new re),this.lightingOptions=new jv,this.pickId=void 0,this.renderStateOptions=$e(e.renderStateOptions,!0),this.styleCommandsNeeded=void 0}function Aa(e){e=y(e,y.EMPTY_OBJECT);let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=N.clone(N.IDENTITY),this._computedModelMatrix2D=N.clone(N.IDENTITY),this._axisCorrectionMatrix=Ut.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new N),this._runtimeArticulations={},cXe(this)}Object.defineProperties(Aa.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function cXe(e){let t=e._components,n=t.scene,r=e._model.modelMatrix;Hle(e,r);let o=t.articulations,s=o.length,a=e._runtimeArticulations;for(let b=0;b<s;b++){let T=o[b],S=new Hg({articulation:T,sceneGraph:e}),w=S.name;a[w]=S}let c=t.nodes,u=c.length;e._runtimeNodes=new Array(u);let d=n.nodes.length,p=N.IDENTITY;for(let b=0;b<d;b++){let T=n.nodes[b],S=Gle(e,T,p);e._rootNodes.push(S)}let g=t.skins,m=e._runtimeSkins,x=g.length;for(let b=0;b<x;b++){let T=g[b];m.push(new wx({skin:T,sceneGraph:e}))}let C=e._skinnedNodes,A=C.length;for(let b=0;b<A;b++){let T=C[b],S=e._runtimeNodes[T],D=c[T].skin.index;S._runtimeSkin=m[D],S.updateJointMatrices()}e.applyArticulations()}function Hle(e,t){let n=e._components,i=e._model;e._computedModelMatrix=N.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=N.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=N.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var lXe=new h;function uXe(e,t){let n=e._computedModelMatrix,i=N.getTranslation(n,lXe);if(!h.equals(i,h.ZERO))e._computedModelMatrix2D=yt.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let r=e.boundingSphere.center,o=yt.wgs84To2DModelMatrix(t.mapProjection,r,e._computedModelMatrix2D);e._computedModelMatrix2D=N.multiply(o,n,e._computedModelMatrix2D)}e._boundingSphere2D=re.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function Gle(e,t,n){let i=[],r=Ut.getNodeTransform(t),o=t.children.length;for(let f=0;f<o;f++){let d=t.children[f],p=N.multiplyTransformation(n,r,new N),g=Gle(e,d,p);i.push(g)}let s=new om({node:t,transform:r,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let f=0;f<a;f++)s.runtimePrimitives.push(new xb({primitive:t.primitives[f],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let u=t.name;if(l(u)){let f=e._model,d=new yb(f,s);f._nodesByName[u]=d}return c}var fXe=new h,dXe=new h,hXe=new h,mXe=new h;Aa.prototype.buildDrawCommands=function(e){let t=this._model,n=new Hv(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages,r,o,s;for(r=0;r<i.length;r++)i[r].process(n,t,e);let a=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,fXe),c=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,dXe);for(r=0;r<this._runtimeNodes.length;r++){let u=this._runtimeNodes[r];u.configurePipeline();let f=u.pipelineStages,d=new Wv(n,u);for(o=0;o<f.length;o++)f[o].process(d,u.node,e);let p=u.computedTransform;for(o=0;o<u.runtimePrimitives.length;o++){let g=u.runtimePrimitives[o];g.configurePipeline(e);let m=g.pipelineStages,x=new qv(d,g);for(s=0;s<m.length;s++)m[s].process(x,g.primitive,e);g.boundingSphere=re.clone(x.boundingSphere,new re);let C=N.multiplyByPoint(p,x.positionMin,hXe),A=N.multiplyByPoint(p,x.positionMax,mXe);h.minimumByComponent(a,C,a),h.maximumByComponent(c,A,c);let b=Bv(x,e);g.drawCommand=b}}this._boundingSphere=re.fromCornerPoints(a,c,new re),this._boundingSphere=re.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),t._boundingSphere=re.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};Aa.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model;l(n.color)&&t.push(bx),n.imageBasedLighting.enabled&&t.push(xF),n.isClippingEnabled()&&t.push(TF),l(n.splitDirection)&&n.splitDirection!==as.NONE&&t.push(m2),n.hasSilhouette(e)&&t.push(d2)};Aa.prototype.update=function(e,t){let n,i,r;for(n=0;n<this._runtimeNodes.length;n++){let o=this._runtimeNodes[n];for(i=0;i<o.updateStages.length;i++)o.updateStages[i].update(o,this,e);let s=e.mode!==te.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<o.runtimePrimitives.length;i++){let a=o.runtimePrimitives[i];for(r=0;r<a.updateStages.length;r++)a.updateStages[r].update(a,this)}}};Aa.prototype.updateModelMatrix=function(e,t){Hle(this,e),t.mode!==te.SCENE3D&&uXe(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let r=this._runtimeNodes[n[i]];r._transformDirty=!0}};Aa.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){let i=e[n];this._runtimeNodes[i].updateJointMatrices()}};function Wle(e,t,n,i){if(n&&!t.show)return;let r=t.children.length;for(let a=0;a<r;a++){let c=t.getChild(a);Wle(e,c,n,i)}let o=t.runtimePrimitives,s=o.length;for(let a=0;a<s;a++){let c=o[a];i(c)}}function p2(e,t,n){let i=e._rootNodes,r=i.length;for(let o=0;o<r;o++){let s=i[o],a=e._runtimeNodes[s];Wle(e,a,t,n)}}Aa.prototype.updateBackFaceCulling=function(e){p2(this,!1,function(t){let n=t.drawCommand;n.backFaceCulling=e})};Aa.prototype.updateShadows=function(e){p2(this,!1,function(t){let n=t.drawCommand;n.shadows=e})};Aa.prototype.updateShowBoundingVolume=function(e){p2(this,!1,function(t){let n=t.drawCommand;n.debugShowBoundingVolume=e})};Aa.prototype.getDrawCommands=function(e){let t=[],n=[],i=this._model.hasSilhouette(e);return p2(this,!0,function(r){let o=r.drawCommand,s=o.getCommands(e);if(t.push.apply(t,s),i){let a=o.getSilhouetteCommands(e);n.push.apply(n,a)}}),t.push.apply(t,n),t};Aa.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],r=n[1],o=this._runtimeArticulations[i];l(o)&&o.setArticulationStage(r,t)};Aa.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};function am(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdSet={},this._batchTextureIdMap=new xt}Object.defineProperties(am.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}});am.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdSet={},this._batchTextureIdMap.removeAll()};am.prototype.addBuffer=function(e,t){if(!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};am.prototype.addTexture=function(e){this._textureIdSet.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes),this._textureIdSet[e._id]=!0};am.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};function pf(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(pf.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return l(this._color)||(this._color=new z),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}});pf.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};pf.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};pf.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};pf.prototype.getPropertyNames=function(e){return di("ModelFeature.getPropertyNames","ModelFeature.getPropertyNames is deprecated in CesiumJS 1.95, and will be removed in 1.98. Use ModelFeature.getPropertyIds instead"),this._featureTable.getPropertyIds(e)};pf.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};pf.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};function Gr(e){let t=e.model,n=e.propertyTable;this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=Mc.ALL_OPAQUE,pXe(this)}Object.defineProperties(Gr.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return l(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function pXe(e){let t=e._model,n=Os.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let r,o=new Array(i);if(n){let s=t.content;for(r=0;r<i;r++)o[r]=new bo(s,r)}else for(r=0;r<i;r++)o[r]=new pf({model:t,featureId:r,featureTable:e});e._features=o,e._featuresLength=i,e._batchTexture=new Cr({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}Gr.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=Mc.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};Gr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Gr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Gr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Gr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Gr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Gr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Gr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};Gr.prototype.getFeature=function(e){return this._features[e]};Gr.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};Gr.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};Gr.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};Gr.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};Gr.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};Gr.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};Gr.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};Gr.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};Gr.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var _Xe=new z;Gr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(Cr.DEFAULT_COLOR_VALUE),this.setAllShow(Cr.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?y(e.color.evaluateColor(n,_Xe),Cr.DEFAULT_COLOR_VALUE):Cr.DEFAULT_COLOR_VALUE,r=l(e.show)?y(e.show.evaluate(n),Cr.DEFAULT_SHOW_VALUE):Cr.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,r)}};Gr.prototype.isDestroyed=function(){return!1};Gr.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var jle={};function Td(e){this._count=e.count,this._properties=$e(e.properties,!0)}Td.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,jle)};Td.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,jle,e)};Td.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return $e(n[e],!0)};Td.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i[e]=$e(n,!0),!0):!1};function bd(e){let t=e.count,n=e.batchTable,i=e.binaryBody,r=y(e.parseAsPropertyAttributes,!1),o=e.customAttributeOutput,s=gXe(n),a=new Td({count:t,properties:s.jsonProperties}),c=AXe(s.hierarchy,i),u=$h.BATCH_TABLE_CLASS_NAME,f,d,p;if(r){let x=xXe(t,u,s.binaryProperties,i,o);p=x.transcodedSchema,d=[new Vp({propertyAttribute:x.propertyAttributeJson,class:x.transcodedClass})]}else{let x=yXe(t,u,s.binaryProperties,i);p=x.transcodedSchema;let C=x.featureTableJson;f=new hd({count:C.count,properties:C.properties,class:x.transcodedClass,bufferViews:x.bufferViewsTypedArrays}),d=[]}let g=new Tl({id:0,name:"Batch Table",count:t,metadataTable:f,jsonMetadataTable:a,batchTableHierarchy:c}),m={schema:p,propertyTables:[g],propertyAttributes:d,extensions:s.extensions,extras:s.extras};return new Ka(m)}function gXe(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,r;l(t)?(bd._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),r=t):l(i)&&(r=i["3DTILES_batch_table_hierarchy"]);let o={},s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let c=e[a];Array.isArray(c)?o[a]=c:s[a]=c}return{binaryProperties:s,jsonProperties:o,hierarchy:r,extras:n,extensions:i}}function yXe(e,t,n,i){let r={},o={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;if(!l(i))throw new fe(`Property ${d} requires a batch table binary.`);let p=n[d],g=nf(p);o[d]={bufferView:a},r[d]=qle(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:r};let u=new Zh(c);return{featureTableJson:{class:t,count:e,properties:o},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function xXe(e,t,n,i,r){let o={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;let p=n[d];if(!l(i)&&!l(p.typedArray))throw new fe(`Property ${d} requires a batch table binary.`);let g=Ut.sanitizeGlslIdentifier(d);(g===""||o.hasOwnProperty(g))&&(g=`property_${a}`,a++);let m=qle(p);m.name=d,o[g]=m;let x=g.toUpperCase();x.startsWith("_")||(x=`_${x}`);let C=p.typedArray;l(C)||(C=nf(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let A=new kt.Attribute;A.name=x,A.count=e,A.type=p.type,A.componentDatatype=K.fromTypedArray(C),A.typedArray=C,r.push(A),s[g]={attribute:x}}let c={classes:{}};c.classes[t]={properties:o};let u=new Zh(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function qle(e){let t=CXe(e.componentType);return{type:e.type,componentType:t}}function CXe(e){switch(e){case"BYTE":return"INT8";case"UNSIGNED_BYTE":return"UINT8";case"SHORT":return"INT16";case"UNSIGNED_SHORT":return"UINT16";case"INT":return"INT32";case"UNSIGNED_INT":return"UINT32";case"FLOAT":return"FLOAT32";case"DOUBLE":return"FLOAT64"}}function AXe(e,t){if(l(e))return new Ic({extension:e,binaryBody:t})}bd._deprecationWarning=di;var Px={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},TXe=kt.FeatureIdAttribute;function Yg(e){e=y(e,y.EMPTY_OBJECT);let t=e.b3dmResource,n=e.baseResource,i=e.arrayBuffer,r=y(e.byteOffset,0),o=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,On.Y),u=y(e.forwardAxis,On.X),f=y(e.loadAttributesAsTypedArray,!1),d=y(e.loadAttributesFor2D,!1),p=y(e.loadIndicesForWireframe,!1),g=y(e.loadPrimitiveOutline,!0);n=l(n)?n:t.clone(),this._b3dmResource=t,this._baseResource=n,this._arrayBuffer=i,this._byteOffset=r,this._releaseGltfJson=o,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadAttributesFor2D=d,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=g,this._state=Px.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=N.IDENTITY}l(Object.create)&&(Yg.prototype=Object.create(hi.prototype),Yg.prototype.constructor=Yg);Object.defineProperties(Yg.prototype,{promise:{get:function(){return this._promise}},texturesLoadedPromise:{get:function(){return this._gltfLoader.texturesLoadedPromise}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Yg.prototype.load=function(){let e=WT.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,r=e.batchTableJson,o=e.batchTableBinary,s=new pl(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",K.FLOAT,3);l(a)&&(this._transform=N.fromTranslation(h.fromArray(a))),this._batchTable={json:r,binary:o};let c=new Ca({typedArray:e.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,renameBatchIdSemantic:!0});this._gltfLoader=c,this._state=Px.LOADING;let u=this;return c.load(),this._promise=c.promise.then(function(){if(u.isDestroyed())return;let f=c.components;return f.transform=u._transform,EXe(u,f),u._components=f,u._state=Px.READY,u}).catch(function(f){if(!u.isDestroyed())return bXe(u,f)}),this._promise};function bXe(e,t){e.unload(),e._state=Px.FAILED;let n="Failed to load b3dm";return t=e.getError(n,t),Promise.reject(t)}Yg.prototype.process=function(e){this._state===Px.LOADING&&(this._state=Px.PROCESSING),this._state===Px.PROCESSING&&this._gltfLoader.process(e)};function EXe(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let r;if(l(n.json))r=bd({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new Tl({name:$h.BATCH_TABLE_CLASS_NAME,count:i});r=new Ka({schema:{},propertyTables:[a]})}let o=t.scene.nodes,s=o.length;for(let a=0;a<s;a++)Yle(o[a]);t.structuralMetadata=r}function Yle(e){let t=e.children.length;for(let i=0;i<t;i++)Yle(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let r=e.primitives[i],o=Ut.getAttributeBySemantic(r,jt.FEATURE_ID);if(l(o)){o.setIndex=0;let s=new TXe;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",r.featureIds.push(s)}}}Yg.prototype.unload=function(){l(this._gltfLoader)&&this._gltfLoader.unload(),this._components=void 0};var _2=Yg;function _f(e){e=y(e,y.EMPTY_OBJECT),this._geoJson=e.geoJson,this._promise=void 0,this._process=function(t,n){},this._components=void 0}l(Object.create)&&(_f.prototype=Object.create(hi.prototype),_f.prototype.constructor=_f);Object.defineProperties(_f.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});_f.prototype.load=function(){let e=this,t=new Promise(function(n){e._process=function(i,r){l(i._components)||(i._components=MXe(i._geoJson,r),i._geoJson=void 0,n(i))}});return this._promise=t,t};_f.prototype.process=function(e){this._process(this,e)};function SXe(){this.lines=void 0,this.properties=void 0}function wXe(){this.features=[]}function vXe(e){let t=e[0],n=e[1],i=y(e[2],0);return new h(t,n,i)}function xW(e){let t=e.length,n=new Array(t);for(let r=0;r<t;r++)n[r]=vXe(e[r]);return[n]}function DXe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=xW(e[i])[0];return n}function Kle(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=xW(e[i])[0];return n}function PXe(e){let t=e.length,n=[];for(let i=0;i<t;i++)Array.prototype.push.apply(n,Kle(e[i]));return n}var IXe={LineString:xW,MultiLineString:DXe,MultiPolygon:PXe,Polygon:Kle};function $le(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=IXe[n],r=e.geometry.coordinates;if(!l(i)||!l(r))return;let o=new SXe;o.lines=i(r),o.properties=e.properties,t.features.push(o)}function OXe(e,t){let n=e.features,i=n.length;for(let r=0;r<i;r++)$le(n[r],t)}var RXe={FeatureCollection:OXe,Feature:$le},Xle=new h;function MXe(e,t){let n=new wXe,i=RXe[e.type];l(i)&&i(e,n);let r=n.features.length;if(r===0)throw new fe("GeoJSON must have at least one feature");let o={};for(let ce=0;ce<r;ce++){let de=n.features[ce],ie=y(de.properties,y.EMPTY_OBJECT);for(let ae in ie)ie.hasOwnProperty(ae)&&(l(o[ae])||(o[ae]=new Array(r)))}for(let ce=0;ce<r;ce++){let de=n.features[ce];for(let ie in o)if(o.hasOwnProperty(ie)){let ae=y(de.properties[ie],"");o[ie][ce]=ae}}let s=new Td({count:r,properties:o}),c=[new Tl({id:0,count:r,jsonMetadataTable:s})],u=new Zh({}),f=new Ka({schema:u,propertyTables:c}),d=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),p=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let ce=0;ce<r;ce++){let de=n.features[ce],ie=de.lines.length;for(let ae=0;ae<ie;ae++){let _e=de.lines[ae],be=_e.length;for(let Te=0;Te<be;Te++)h.minimumByComponent(d,_e[Te],d),h.maximumByComponent(p,_e[Te],p)}}let g=h.midpoint(d,p,new h),m=h.fromDegrees(g.x,g.y,g.z,oe.WGS84,new h),x=yt.eastNorthUpToFixedFrame(m,oe.WGS84,new N),C=N.inverseTransformation(x,new N),A=0,b=0;for(let ce=0;ce<r;ce++){let de=n.features[ce],ie=de.lines.length;for(let ae=0;ae<ie;ae++){let _e=de.lines[ae];A+=_e.length,b+=(_e.length-1)*2}}let T=new Float32Array(A*3),S=new Float32Array(A),w=Le.createTypedArray(A,b),D=Le.fromTypedArray(w),I=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),O=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),B=0,L=0;for(let ce=0;ce<r;ce++){let de=n.features[ce],ie=de.lines.length;for(let ae=0;ae<ie;ae++){let _e=de.lines[ae],be=_e.length;for(let Te=0;Te<be;Te++){let Oe=_e[Te],Be=h.fromDegrees(Oe.x,Oe.y,Oe.z,oe.WGS84,Xle),tt=N.multiplyByPoint(C,Be,Xle);h.minimumByComponent(I,tt,I),h.maximumByComponent(O,tt,O),h.pack(tt,T,B*3),S[B]=ce,Te<be-1&&(w[L*2]=B,w[L*2+1]=B+1,L++),B++}}}let _=at.createVertexBuffer({typedArray:T,context:t.context,usage:Ne.STATIC_DRAW});_.vertexArrayDestroyable=!1;let E=at.createVertexBuffer({typedArray:S,context:t.context,usage:Ne.STATIC_DRAW});E.vertexArrayDestroyable=!1;let v=at.createIndexBuffer({typedArray:w,context:t.context,usage:Ne.STATIC_DRAW,indexDatatype:D});v.vertexArrayDestroyable=!1;let P=new kt.Attribute;P.semantic=jt.POSITION,P.componentDatatype=K.FLOAT,P.type=qt.VEC3,P.count=A,P.min=I,P.max=O,P.buffer=_;let R=new kt.Attribute;R.semantic=jt.FEATURE_ID,R.setIndex=0,R.componentDatatype=K.FLOAT,R.type=qt.SCALAR,R.count=A,R.buffer=E;let F=[P,R],U=new kt.Material;U.unlit=!0;let k=new kt.Indices;k.indexDatatype=D,k.count=w.length,k.buffer=v;let H=new kt.FeatureIdAttribute;H.featureCount=r,H.propertyTableId=0,H.setIndex=0,H.positionalLabel="featureId_0";let V=[H],q=new kt.Primitive;q.attributes=F,q.indices=k,q.featureIds=V,q.primitiveType=Me.LINES,q.material=U;let j=[q],X=new kt.Node;X.index=0,X.primitives=j;let G=[X],$=new kt.Scene;$.nodes=G;let J=new kt.Components;return J.scene=$,J.nodes=G,J.transform=x,J.structuralMetadata=f,J}_f.prototype.unload=function(){this._components=void 0};var Ix={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},g2=kt.Attribute,BXe=kt.FeatureIdAttribute,LXe=kt.Instances;function Xg(e){e=y(e,y.EMPTY_OBJECT);let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,r=y(e.byteOffset,0),o=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,On.Y),u=y(e.forwardAxis,On.X),f=y(e.loadAttributesAsTypedArray,!1),d=y(e.loadIndicesForWireframe,!1),p=y(e.loadPrimitiveOutline,!0);i=l(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=r,this._releaseGltfJson=o,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadIndicesForWireframe=d,this._loadPrimitiveOutline=p,this._state=Ix.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._transform=N.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}l(Object.create)&&(Xg.prototype=Object.create(hi.prototype),Xg.prototype.constructor=Xg);Object.defineProperties(Xg.prototype,{promise:{get:function(){return this._promise}},texturesLoadedPromise:{get:function(){return this._gltfLoader.texturesLoadedPromise}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Xg.prototype.load=function(){let e=nb.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,r=e.batchTableBinary,o=e.gltfFormat,s=new pl(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!l(a))throw new fe("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",K.FLOAT,3);l(c)&&(this._transform=N.fromTranslation(h.fromArray(c))),this._batchTable={json:i,binary:r};let u={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(o===0){let p=fa(e.gltf);p=p.replace(/[\s\0]+$/,"");let g=this._baseResource.getDerivedResource({url:p});u.gltfResource=g,u.baseResource=g}else u.gltfResource=this._i3dmResource,u.typedArray=e.gltf;let f=new Ca(u);this._gltfLoader=f,this._state=Ix.LOADING;let d=this;return f.load(),this._promise=f.promise.then(function(){if(d.isDestroyed())return;let p=f.components;return p.transform=d._transform,VXe(d,p),FXe(d,p),d._components=p,d._state=Ix.READY,d}).catch(function(p){if(!d.isDestroyed())return NXe(d,p)}),this._promise};function NXe(e,t){e.unload(),e._state=Ix.FAILED;let n="Failed to load i3dm";return t=e.getError(n,t),Promise.reject(t)}Xg.prototype.process=function(e){this._state===Ix.LOADING&&(this._state=Ix.PROCESSING),this._state===Ix.PROCESSING&&this._gltfLoader.process(e)};function FXe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let r;if(l(n.json))r=bd({count:i,batchTable:n.json,binaryBody:n.binary});else{let o=new Tl({name:$h.BATCH_TABLE_CLASS_NAME,count:i});r=new Ka({schema:{},propertyTables:[o]})}t.structuralMetadata=r}var y2=new h,CW=new Array(4);function VXe(e,t){let n,i=e._featureTable,r=e._instancesLength;if(r===0)return;let o=i.getGlobalProperty("RTC_CENTER",K.FLOAT,3),s=i.getGlobalProperty("EAST_NORTH_UP"),a=i.hasProperty("NORMAL_UP")||i.hasProperty("NORMAL_UP_OCT32P")||s,c=i.hasProperty("SCALE")||i.hasProperty("SCALE_NON_UNIFORM"),u=kXe(i,r),f;a&&(f=new Float32Array(4*r));let d;c&&(d=new Float32Array(3*r));let p=new Float32Array(r),g=h.unpackArray(u),m=new h,x=new h,C=new h,A=new h,b=new Q,T=new Re,S=new Array(4),w=new h,D=new Array(3),I=new N;if(!l(o)){let E=re.fromPoints(g);for(n=0;n<g.length;n++)h.subtract(g[n],E.center,y2),u[3*n+0]=y2.x,u[3*n+1]=y2.y,u[3*n+2]=y2.z;t.transform=N.fromTranslation(E.center)}for(n=0;n<r;n++){m=h.clone(g[n]),l(o)&&h.add(m,h.unpack(o),m),a&&(UXe(i,s,n,T,m,C,x,A,b,I),Re.pack(T,S,0),f[4*n+0]=S[0],f[4*n+1]=S[1],f[4*n+2]=S[2],f[4*n+3]=S[3]),c&&(zXe(i,n,w),h.pack(w,D,0),d[3*n+0]=D[0],d[3*n+1]=D[1],d[3*n+2]=D[2]);let E=i.getProperty("BATCH_ID",K.UNSIGNED_SHORT,1,n);l(E)||(E=n),p[n]=E}let O=new LXe;O.transformInWorldSpace=!0;let B=new g2;if(B.name="Instance Translation",B.semantic=Zo.TRANSLATION,B.componentDatatype=K.FLOAT,B.type=qt.VEC3,B.count=r,B.typedArray=u,O.attributes.push(B),a){let E=new g2;E.name="Instance Rotation",E.semantic=Zo.ROTATION,E.componentDatatype=K.FLOAT,E.type=qt.VEC4,E.count=r,E.typedArray=f,O.attributes.push(E)}if(c){let E=new g2;E.name="Instance Scale",E.semantic=Zo.SCALE,E.componentDatatype=K.FLOAT,E.type=qt.VEC3,E.count=r,E.typedArray=d,O.attributes.push(E)}let L=new g2;L.name="Instance Feature ID",L.setIndex=0,L.semantic=Zo.FEATURE_ID,L.componentDatatype=K.FLOAT,L.type=qt.SCALAR,L.count=r,L.typedArray=p,O.attributes.push(L);let _=new BXe;for(_.propertyTableId=0,_.setIndex=0,_.positionalLabel="instanceFeatureId_0",O.featureIds.push(_),n=0;n<t.nodes.length;n++){let E=t.nodes[n];E.primitives.length>0&&(E.instances=O)}}function kXe(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",K.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",K.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",K.FLOAT,3);if(!l(i))throw new fe("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let r=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",K.FLOAT,3);if(!l(r))throw new fe("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=new Float32Array(n.length);for(let s=0;s<n.length/3;s++)for(let a=0;a<3;a++){let c=3*s+a;o[c]=n[c]/65535*r[a]+i[a]}return o}else throw new fe("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var Zle=new Array(4);function UXe(e,t,n,i,r,o,s,a,c,u){let f=e.getProperty("NORMAL_UP",K.FLOAT,3,n,CW),d=e.getProperty("NORMAL_RIGHT",K.FLOAT,3,n,Zle),p=!1;if(l(f)){if(!l(d))throw new fe("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");h.unpack(f,0,o),h.unpack(d,0,s),p=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",K.UNSIGNED_SHORT,2,n,CW),m=e.getProperty("NORMAL_RIGHT_OCT32P",K.UNSIGNED_SHORT,2,n,Zle);if(l(g)){if(!l(m))throw new fe("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");In.octDecodeInRange(g[0],g[1],65535,o),In.octDecodeInRange(m[0],m[1],65535,s),p=!0}else t?(yt.eastNorthUpToFixedFrame(r,oe.WGS84,u),N.getMatrix3(u,c)):Q.clone(Q.IDENTITY,c)}p&&(h.cross(s,o,a),h.normalize(a,a),Q.setColumn(c,0,s,c),Q.setColumn(c,1,o,c),Q.setColumn(c,2,a,c)),Re.fromRotationMatrix(c,i)}function zXe(e,t,n){n=h.fromElements(1,1,1,n);let i=e.getProperty("SCALE",K.FLOAT,1,t);l(i)&&h.multiplyByScalar(n,i,n);let r=e.getProperty("SCALE_NON_UNIFORM",K.FLOAT,3,t,CW);l(r)&&(n.x*=r[0],n.y*=r[1],n.z*=r[2])}Xg.prototype.unload=function(){l(this._gltfLoader)&&this._gltfLoader.unload(),this._components=void 0};var x2=Xg;var HXe=kt.Components,GXe=kt.Scene,WXe=kt.Node,jXe=kt.Primitive,qXe=kt.Attribute,Jle=kt.Quantization,YXe=kt.FeatureIdAttribute,XXe=kt.Material,KXe=kt.MetallicRoughness;function gf(e){e=y(e,y.EMPTY_OBJECT);let t=e.arrayBuffer,n=y(e.byteOffset,0);this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=y(e.loadAttributesFor2D,!1),this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._process=function(i){},this._state=Vt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=N.IDENTITY}l(Object.create)&&(gf.prototype=Object.create(hi.prototype),gf.prototype.constructor=gf);Object.defineProperties(gf.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});gf.prototype.load=function(){this._parsedContent=rb.parse(this._arrayBuffer,this._byteOffset),this._state=Vt.PROCESSING;let e=this;this._promise=new Promise(function(t,n){e._process=function(i){if(e._state===Vt.PROCESSING){if(l(e._decodePromise))return;let r=$Xe(e,i.context);l(r)&&r.then(t).catch(n)}}})};gf.prototype.process=function(e){this._process(e)};function $Xe(e,t){let i=e._parsedContent.draco,r;if(l(i)?r=_l.decodePointCloud(i,t):r=Promise.resolve(),!!l(r))return e._decodePromise=r,r.then(function(o){if(!e.isDestroyed())return l(o)&&ZXe(e,i,o),cKe(e,t),e._state=Vt.READY,e}).catch(function(o){e.unload(),e._state=Vt.FAILED;let s="Failed to load Draco pnts";return Promise.reject(e.getError(s,o))})}function ZXe(e,t,n){e._state=Vt.READY;let i=e._parsedContent,r;if(l(n.POSITION)){if(r={name:"POSITION",semantic:jt.POSITION,typedArray:n.POSITION.array,componentDatatype:K.FLOAT,type:qt.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,u=h.fromElements(c,c,c),f=h.unpack(a.minValues),d=(1<<a.quantizationBits)-1;r.isQuantized=!0,r.quantizedRange=d,r.quantizedVolumeOffset=f,r.quantizedVolumeScale=u,r.quantizedComponentDatatype=K.UNSIGNED_SHORT,r.quantizedType=qt.VEC3}i.positions=r}if(l(n.NORMAL)){if(r={name:"NORMAL",semantic:jt.NORMAL,typedArray:n.NORMAL.array,componentDatatype:K.FLOAT,type:qt.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;r.quantizedRange=a,r.octEncoded=!0,r.octEncodedZXY=!0,r.quantizedComponentDatatype=K.UNSIGNED_BYTE,r.quantizedType=qt.VEC2}i.normals=r}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:jt.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:K.UNSIGNED_BYTE,type:qt.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:jt.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:K.UNSIGNED_BYTE,type:qt.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:jt.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:K.fromTypedArray(a),type:qt.SCALAR}}let o=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(o)||(o={}),i.hasDracoBatchTable=!0;let u=c.data;o[a]={byteOffset:u.byteOffset,type:JXe(u.componentsPerAttribute),componentType:QXe(u.componentDatatype),typedArray:c.array}}i.batchTableJson=o}function JXe(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function QXe(e){switch(e){case Z.BYTE:return"BYTE";case Z.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case Z.SHORT:return"SHORT";case Z.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case Z.INT:return"INT";case Z.UNSIGNED_INT:return"UNSIGNED_INT";case Z.DOUBLE:return"DOUBLE";case Z.FLOAT:return"FLOAT"}}function Yv(e,t,n){let i=t.typedArray,r;if(t.octEncoded&&(r=new Jle,r.octEncoded=t.octEncoded,r.octEncodedZXY=t.octEncodedZXY,r.normalizationRange=t.quantizedRange,r.type=t.quantizedType,r.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){r=new Jle;let a=t.quantizedRange;r.normalizationRange=a,r.quantizedVolumeOffset=h.ZERO;let c=t.quantizedVolumeScale;r.quantizedVolumeDimensions=c,r.quantizedVolumeStepSize=h.divideByScalar(c,a,new h),r.componentDatatype=t.quantizedComponentDatatype,r.type=t.quantizedType}let o=new qXe;if(o.name=t.name,o.semantic=t.semantic,o.setIndex=t.setIndex,o.componentDatatype=t.componentDatatype,o.type=t.type,o.normalized=y(t.normalized,!1),o.min=t.min,o.max=t.max,o.quantization=r,t.isRGB565&&(i=In.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);o.constant=z.pack(t.constantColor,a)}else{let a=at.createVertexBuffer({typedArray:i,context:n,usage:Ne.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),o.buffer=a}let s=e._loadAttributesFor2D;return o.semantic===jt.POSITION&&s&&(o.typedArray=i),o}var Qle,C2;function eKe(e){if(!l(C2)){Qle=new ah.default(0),C2=new Array(e);for(let t=0;t<e;++t)C2[t]=Qle.random()}return C2}var tKe=new h,nKe=new h,iKe=new h;function rKe(e){let t=e.typedArray,n=20,i=t.length/3,r=Math.min(i,n),o=eKe(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,tKe),u=h.fromElements(a,a,a,nKe),f,d,p;if(e.isQuantized)c=h.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<r;++f)d=Math.floor(o[f]*i),p=h.unpack(t,d*3,iKe),h.minimumByComponent(c,p,c),h.maximumByComponent(u,p,u);e.min=h.clone(c),e.max=h.clone(u)}var oKe={name:jt.COLOR,semantic:jt.COLOR,setIndex:0,constantColor:z.DARKGRAY,componentDatatype:K.FLOAT,type:qt.VEC4,isQuantized:!1,isTranslucent:!1};function sKe(e,t,n){let i=[],r,o=t.positions;return l(o)&&(rKe(o),r=Yv(e,o,n),r.count=t.pointsLength,i.push(r)),l(t.normals)&&(r=Yv(e,t.normals,n),i.push(r)),l(t.colors)?(r=Yv(e,t.colors,n),i.push(r)):(r=Yv(e,oKe,n),i.push(r)),l(t.batchIds)&&(r=Yv(e,t.batchIds,n),i.push(r)),i}function aKe(e,t){let n=e.batchLength,i=e.pointsLength,r=e.batchTableBinary,o=!l(e.batchIds);if(l(r)||e.hasDracoBatchTable){let s=y(n,i);return bd({count:s,batchTable:e.batchTableJson,binaryBody:r,parseAsPropertyAttributes:o,customAttributeOutput:t})}return new Ka({schema:{},propertyTables:[]})}function cKe(e,t){let n=e._parsedContent,i=new KXe;i.metallicFactor=0,i.roughnessFactor=.9;let r=new XXe;r.metallicRoughness=i;let o=n.colors;l(o)&&o.isTranslucent&&(r.alphaMode=vp.BLEND);let s=!l(n.normals);r.unlit=s;let a=new jXe;if(a.attributes=sKe(e,n,t),a.primitiveType=Me.POINTS,a.material=r,l(n.batchIds)){let g=new YXe;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new WXe;c.index=0,c.primitives=[a];let u=new GXe;u.nodes=[c],u.upAxis=On.Z,u.forwardAxis=On.X;let f=new HXe;f.scene=u,f.nodes=[c];let d=[];f.structuralMetadata=aKe(n,d),d.length>0&&lKe(e,a,d,t),l(n.rtcCenter)&&(f.transform=N.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=N.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0}function lKe(e,t,n,i){let r=t.attributes,o=n.length;for(let s=0;s<o;s++){let a=n[s],c=at.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Ne.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,r.push(a)}t.propertyAttributeIds=[0]}gf.prototype.unload=function(){let e=this._buffers;for(let t=0;t<e.length;t++)e[t].destroy();e.length=0,this._components=void 0,this._parsedContent=void 0};function wi(e){e=y(e,y.EMPTY_OBJECT),this._loader=e.loader,this._resource=e.resource,this.type=y(e.type,Os.GLTF),this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this._modelMatrix=N.clone(this.modelMatrix),this._scale=y(e.scale,1),this._minimumPixelSize=y(e.minimumPixelSize,0),this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=Q.clone(Q.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new mF(this),this._clampAnimations=y(e.clampAnimations,!0),this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1;let t=e.color;this._color=l(t)?z.clone(t):void 0,this._colorBlendMode=y(e.colorBlendMode,Ds.HIGHLIGHT),this._colorBlendAmount=y(e.colorBlendAmount,.5);let n=y(e.silhouetteColor,z.RED);this._silhouetteColor=z.clone(n),this._silhouetteSize=y(e.silhouetteSize,0),this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=y(e.cull,!0),this._opaquePass=y(e.opaquePass,Ce.OPAQUE),this._allowPicking=y(e.allowPicking,!0),this._show=y(e.show,!0),this._style=void 0;let i=y(e.featureIdLabel,"featureId_0");typeof i=="number"&&(i=`featureId_${i}`),this._featureIdLabel=i;let r=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof r=="number"&&(r=`instanceFeatureId_${r}`),this._instanceFeatureIdLabel=r,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new re,this._initialRadius=void 0,this._heightReference=y(e.heightReference,ze.NONE),this._heightDirty=this._heightReference!==ze.NONE,this._removeUpdateHeightCallback=void 0,this._clampedModelMatrix=void 0;let o=e.scene;l(o)&&l(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(function(){this._heightDirty=!0},this)),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let s=new _d(e.pointCloudShading);this._pointCloudShading=s,this._attenuation=s.attenuation;let a=e.clippingPlanes;l(a)&&a.owner===void 0?vs.setOwner(a,this,"_clippingPlanes"):this._clippingPlanes=a,this._clippingPlanesState=0,this._clippingPlanesMatrix=N.clone(N.IDENTITY),this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new Pc,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._backFaceCulling=y(e.backFaceCulling,!0),this._backFaceCullingDirty=!1,this._shadows=y(e.shadows,Zt.ENABLED),this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this._enableShowOutline=y(e.enableShowOutline,!0),this._debugWireframe=y(e.debugWireframe,!1);let c=e.credit;typeof c=="string"&&(c=new Gt(c)),this._credit=c,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._showCreditsOnScreenDirty=!0,this._splitDirection=y(e.splitDirection,as.NONE),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,z.BLACK),this._statistics=new am,this._sceneMode=void 0,this._projectTo2D=y(e.projectTo2D,!1),this._completeLoad=function(u,f){},this._texturesLoadedPromise=void 0,this._readyPromise=dKe(this),this._sceneGraph=void 0,this._nodesByName={}}function uKe(e,t){let n=e._featureTables,i=t.propertyTables,r=i.length;for(let o=0;o<r;o++){let s=i[o],a=new Gr({model:e,propertyTable:s});n.push(a)}return n}function fKe(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,r,o,s,a;for(r=0;r<e.nodes.length;r++)if(a=e.nodes[r],l(a.instances)&&(s=Ut.getFeatureIdsByLabel(a.instances.featureIds,i),l(s)&&l(s.propertyTableId)))return s.propertyTableId;for(r=0;r<e.nodes.length;r++)for(a=e.nodes[r],o=0;o<a.primitives.length;o++){let c=a.primitives[o],u=Ut.getFeatureIdsByLabel(c.featureIds,n);if(l(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function eue(e,t){if(!l(e)&&!l(t))return!1;if(l(e)!==l(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}function dKe(e){let t=e._loader,n=e._resource;t.load();let i=t.promise.then(function(s){if(!l(s))return;let a=s.components;if(!l(a)){if(s.isUnloaded())return;throw new fe("Failed to load model.")}let c=a.structuralMetadata;l(c)&&c.propertyTableCount>0&&uKe(e,c);let u=new Aa({model:e,modelComponents:a});e._sceneGraph=u,e._gltfCredits=u.components.asset.credits;let f=e._resource.credits;if(l(f)){let d=f.length;for(let p=0;p<d;p++)e._resourceCredits.push(f[p])}e._resourcesLoaded=!0}),r=y(t.texturesLoadedPromise,Promise.resolve());e._texturesLoadedPromise=r.then(function(){!l(e)||e.isDestroyed()||(e._texturesLoaded=!0,t._incrementallyLoadTextures&&e.resetDrawCommands())}).catch(Ut.getFailedLoadFunction(e,"model",n));let o=new Promise(function(s,a){e._completeLoad=function(c,u){u.afterRender.push(function(){c._ready=!0,s(c)})}});return i.then(function(){return o}).catch(Ut.getFailedLoadFunction(e,"model",n))}Object.defineProperties(wi.prototype,{ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},texturesLoadedPromise:{get:function(){return this._texturesLoadedPromise}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Tt.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this.applyStyle(e),this._style=e}},color:{get:function(){return this._color},set:function(e){eue(e,this._color)&&this.resetDrawCommands(),this._color=z.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!z.equals(e,this._silhouetteColor)){let t=eue(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=z.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){return this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(vs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=h.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},pickIds:{get:function(){return this._pickIds}}});wi.prototype.getNode=function(e){return this._nodesByName[e]};wi.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};wi.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};wi.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var hKe=new N,mKe=new Q,pKe=new N;wi.prototype.update=function(e){if(_Ke(this,e),gKe(this,e),yKe(this,e),!this._resourcesLoaded||e.mode===te.MORPHING)return;xKe(this),CKe(this,e),AKe(this,e),TKe(this,e),EKe(this),bKe(this,e),this._defaultTexture=e.context.defaultTexture,SKe(this,e),wKe(this,e),vKe(this),DKe(this,e),IKe(this,e);let t=this;if(!t._ready){t._completeLoad(t,e);return}PKe(this),OKe(this,e),RKe(this),MKe(this,e)};function _Ke(e,t){(!e._resourcesLoaded||!e._texturesLoaded)&&e._loader.process(t)}function gKe(e,t){l(e._customShader)&&e._customShader.update(t)}function yKe(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function xKe(e){e.pointCloudShading.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=e.pointCloudShading.attenuation)}function CKe(e,t){e._silhouetteDirty&&(nue(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function AKe(e,t){if(e.isClippingEnabled()){e._clippingPlanes.owner===e&&e._clippingPlanes.update(t);let n=e._clippingPlanes.clippingPlanesState;n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}}function TKe(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function bKe(e,t){let n=e._featureTables,i=n.length;for(let r=0;r<i;r++)n[r].update(t),n[r].styleCommandsNeededDirty&&e.resetDrawCommands()}function EKe(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=fKe(t,e),e.applyStyle(e._style))}function SKe(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function wKe(e,t){N.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=N.clone(e.modelMatrix,e._modelMatrix))}var yf=new h,A2=new me;function vKe(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!l(t)||!l(t.globe)||e.heightReference===ze.NONE){e._clampedModelMatrix=void 0;return}let n=t.globe,i=n.ellipsoid,r=e.modelMatrix;yf.x=r[12],yf.y=r[13],yf.z=r[14];let o=i.cartesianToCartographic(yf);l(e._clampedModelMatrix)||(e._clampedModelMatrix=N.clone(r,new N));let s=n._surface;e._removeUpdateHeightCallback=s.updateHeight(o,tue(e,i,o));let a=n.getHeight(o);if(l(a)){let c=tue(e,i,o);me.clone(o,A2),A2.height=a,i.cartographicToCartesian(A2,yf),c(yf)}e._heightDirty=!1,e._updateModelMatrix=!0}function DKe(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere=re.transform(e._sceneGraph.boundingSphere,n,e._boundingSphere),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._computedScale=LKe(e,n,t)}function PKe(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let r=0;r<i;++r)n[r].object.id=t}function IKe(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=y(e.referenceMatrix,n),r=t.context,o=e._imageBasedLighting;if(o.useSphericalHarmonicCoefficients||o.useSpecularEnvironmentMaps){let s=mKe,a=hKe;a=N.multiply(r.uniformState.view3D,i,a),s=N.getMatrix3(a,s),s=Q.getRotation(s,s),e._iblReferenceFrameMatrix=Q.transpose(s,e._iblReferenceFrameMatrix)}if(e.isClippingEnabled()){let s=pKe;s=N.multiply(r.uniformState.view3D,i,s),s=N.multiply(s,e._clippingPlanes.modelMatrix,s),e._clippingPlanesMatrix=N.inverseTranspose(s,e._clippingPlanesMatrix)}}function OKe(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let r=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(r,t),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=e._userAnimationDirty||e._activeAnimations.update(t);n.update(t,i),e._userAnimationDirty=!1}function RKe(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1;let t=e._showCreditsOnScreen;l(e._credit)&&(e._credit.showOnScreen=t);let n=e._resourceCredits,i=n.length;for(let s=0;s<i;s++)n[s].showOnScreen=t;let r=e._gltfCredits,o=r.length;for(let s=0;s<o;s++)r[s].showOnScreen=t}function MKe(e,t){let n=FKe(e,t),i=e.isInvisible(),r=e.hasSilhouette(t);if(e._show&&e._computedScale!==0&&n&&(!i||r)){VKe(e,t);let s=e._sceneGraph.getDrawCommands(t);t.commandList.push.apply(t.commandList,s)}}var AW=new re;function BKe(e,t,n){return AW.center=e,AW.radius=t,n.camera.getPixelSize(AW,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}function LKe(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let r=n.context,o=Math.max(r.drawingBufferWidth,r.drawingBufferHeight);yf.x=t[12],yf.y=t[13],yf.z=t[14],e._sceneMode!==te.SCENE3D&&rr.computeActualWgs84Position(n,yf,yf);let s=e._boundingSphere.radius,a=BKe(yf,s,n),c=1/a;Math.min(c*(2*s),o)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}return l(e.maximumScale)?Math.min(e.maximumScale,i):i}function tue(e,t,n){return function(i){if(e.heightReference===ze.RELATIVE_TO_GROUND){let o=t.cartesianToCartographic(i,A2);o.height+=n.height,t.cartographicToCartesian(o,i)}let r=e._clampedModelMatrix;N.clone(e.modelMatrix,r),r[12]=i.x,r[13]=i.y,r[14]=i.z,e._heightDirty=!0}}var NKe=new h;function FKe(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,r=n.far*n.far,o;if(t.mode===te.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;o=a*a}else{let s=N.getTranslation(e.modelMatrix,NKe);rr.computeActualWgs84Position(t,s,s),o=h.distanceSquared(s,t.camera.positionWC)}return o>=i&&o<=r}function VKe(e,t){let n=t.creditDisplay,i=e._credit;l(i)&&n.addCredit(i);let r=e._resourceCredits,o=r.length;for(let c=0;c<o;c++)n.addCredit(r[c]);let s=e._gltfCredits,a=s.length;for(let c=0;c<a;c++)n.addCredit(s[c])}wi.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};wi.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function nue(e){return e.context.stencilBuffer}wi.prototype.hasSilhouette=function(e){return nue(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0};wi.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};wi.prototype.isDestroyed=function(){return!1};wi.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let i=t.length;for(let r=0;r<i;r++)t[r].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,ue(this)};wi.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0};wi.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};wi.fromGltf=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.url,e.gltf),n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},i=y(e.basePath,""),r=De.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=r,n.gltfResource=r):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=r,n.gltfResource=r):n.gltfResource=De.createIfNeeded(t);let o=new Ca(n),a=l(e.content)?Os.TILE_GLTF:Os.GLTF,c=Xv(o,a,e);return c.resource=n.gltfResource,new wi(c)};wi.fromB3dm=function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new _2(t),i=Xv(n,Os.TILE_B3DM,e);return new wi(i)};wi.fromPnts=function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new gf(t),i=Xv(n,Os.TILE_PNTS,e);return new wi(i)};wi.fromI3dm=function(e){let t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new x2(t),i=Xv(n,Os.TILE_I3DM,e);return new wi(i)};wi.fromGeoJson=function(e){let t={geoJson:e.geoJson},n=new _f(t),i=Xv(n,Os.TILE_GEOJSON,e);return new wi(i)};wi.prototype.applyColorAndShow=function(e){let t=l(e)&&l(e.color),n=l(e)&&l(e.show);this._color=t?e.color.evaluateColor(void 0,this._color):z.clone(z.WHITE,this._color),this._show=n?e.show.evaluate(void 0):!0};wi.prototype.applyStyle=function(e){this.resetDrawCommands();let t=this.type===Os.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,r=l(i)&&l(i[0]);t&&(!n||r)||(n?this.featureTables[this.featureTableId].applyStyle(e):this.applyColorAndShow(e))};function Xv(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading}}function Rr(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this._model=void 0,this._metadata=void 0,this._group=void 0}Object.defineProperties(Rr.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return l(t)&&l(t[n])?t[n].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){let e=this._model.statistics;return e.propertyTablesByteLength+e.batchTexturesByteLength}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._model.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;if(l(t)&&l(t[n]))return t[n]}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Rr.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return l(n)?t.featureTables[n].getFeature(e):void 0};Rr.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};Rr.prototype.applyDebugSettings=function(e,t){t=e?t:z.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};Rr.prototype.applyStyle=function(e){this._model.style=e};Rr.prototype.update=function(e,t){let n=this._model,i=this._tile;n.colorBlendAmount=e.colorBlendAmount,n.colorBlendMode=e.colorBlendMode,n.modelMatrix=i.computedTransform,n.customShader=e.customShader,n.featureIdLabel=e.featureIdLabel,n.instanceFeatureIdLabel=e.instanceFeatureIdLabel,n.lightColor=e.lightColor,n.imageBasedLighting=e.imageBasedLighting,n.backFaceCulling=e.backFaceCulling,n.shadows=e.shadows,n.showCreditsOnScreen=e.showCreditsOnScreen,n.splitDirection=e.splitDirection,n.debugWireframe=e.debugWireframe,n.showOutline=e.showOutline,n.outlineColor=e.outlineColor,n.pointCloudShading=e.pointCloudShading;let r=e.clippingPlanes;n.referenceMatrix=e.clippingPlanesOriginMatrix,l(r)&&i.clippingPlanesDirty&&(n._clippingPlanes=r.enabled&&i._isClipped?r:void 0),l(r)&&l(n._clippingPlanes)&&n._clippingPlanes!==r&&(n._clippingPlanes=r),n.update(t)};Rr.prototype.isDestroyed=function(){return!1};Rr.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),ue(this)};Rr.fromGltf=function(e,t,n,i){let r=new Rr(e,t,n),s=Kv(e,t,r,{gltf:i,basePath:n}),a=wi.fromGltf(s);return a.readyPromise.then(function(c){c.activeAnimations.addAll({loop:Xr.REPEAT})}),r._model=a,r};Rr.fromB3dm=function(e,t,n,i,r){let o=new Rr(e,t,n),a=Kv(e,t,o,{arrayBuffer:i,byteOffset:r,resource:n}),c=wi.fromB3dm(a);return c.readyPromise.then(function(u){u.activeAnimations.addAll({loop:Xr.REPEAT})}),o._model=c,o};Rr.fromI3dm=function(e,t,n,i,r){let o=new Rr(e,t,n),a=Kv(e,t,o,{arrayBuffer:i,byteOffset:r,resource:n}),c=wi.fromI3dm(a);return c.readyPromise.then(function(u){u.activeAnimations.addAll({loop:Xr.REPEAT})}),o._model=c,o};Rr.fromPnts=function(e,t,n,i,r){let o=new Rr(e,t,n),a=Kv(e,t,o,{arrayBuffer:i,byteOffset:r,resource:n});return o._model=wi.fromPnts(a),o};Rr.fromGeoJson=function(e,t,n,i){let r=new Rr(e,t,n),s=Kv(e,t,r,{geoJson:i,resource:n});return r._model=wi.fromGeoJson(s),r};function Kv(e,t,n,i){let r={cull:!1,releaseGltfJson:!0,opaquePass:Ce.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return rt(i,r)}var iue={b3dm:function(e,t,n,i,r){return e.enableModelExperimental?Rr.fromB3dm(e,t,n,i,r):new gN(e,t,n,i,r)},pnts:function(e,t,n,i,r){return e.enableModelExperimental?Rr.fromPnts(e,t,n,i,r):new GN(e,t,n,i,r)},i3dm:function(e,t,n,i,r){return e.enableModelExperimental?Rr.fromI3dm(e,t,n,i,r):new FN(e,t,n,i,r)},cmpt:function(e,t,n,i,r){return new yN(e,t,n,i,r,iue)},externalTileset:function(e,t,n,i){return new WN(e,t,n,i)},geom:function(e,t,n,i,r){return new xN(e,t,n,i,r)},vctr:function(e,t,n,i,r){return new aF(e,t,n,i,r)},subt:function(e,t,n,i,r){return new ga(e,t,n,void 0,i,r)},subtreeJson:function(e,t,n,i){return new ga(e,t,n,i)},glb:function(e,t,n,i,r){if(i.byteLength<12)throw new fe("Invalid glb content");let a=new DataView(i,r).getUint32(8,!0),c=new Uint8Array(i,r,a);return Rr.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return Rr.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Rr.fromGeoJson(e,t,n,i)}},Ab=iue;var kKe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},Mr=Object.freeze(kKe);var cm={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson"};cm.isBinaryFormat=function(e){switch(e){case cm.BATCHED_3D_MODEL:case cm.INSTANCED_3D_MODEL:case cm.COMPOSITE:case cm.POINT_CLOUD:case cm.VECTOR:case cm.GEOMETRY:case cm.IMPLICIT_SUBTREE:case cm.GLTF_BINARY:return!0;default:return!1}};var Ks=Object.freeze(cm);var UKe={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},Ed=Object.freeze(UKe);function rue(){}var $v={stack:new qu,stackMaximumLength:0};rue.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e._hasMixedContent=!1;let n=!0,i=e.root;if(i.updateVisibility(t),!oue(i))return n;let r=$v.stack;for(r.push(e.root);r.length>0;){$v.stackMaximumLength=Math.max($v.stackMaximumLength,r.length);let o=r.pop(),s=o.refine===Eo.ADD,a=o.refine===Eo.REPLACE,c=HKe(e,o);c&&GKe(e,o,r,t),(s||a&&!c)&&(WKe(e,o),jKe(e,o,t),YKe(e,o,t),!sue(o)&&!o.contentAvailable&&(n=!1)),qKe(e)}return $v.stack.trim($v.stackMaximumLength),n};function oue(e){return e._visible&&e._inRequestVolume}function sue(e){return e.hasEmptyContent||e.hasTilesetContent||e.hasImplicitContent}function zKe(e){return!sue(e)&&e.contentUnloaded}function HKe(e,t){return t.children.length===0?!1:t.hasTilesetContent||t.hasImplicitContent?!t.contentExpired:(t.hasEmptyContent,!0)}function GKe(e,t,n,i){let r=t.children,o=r.length;for(let s=0;s<o;++s){let a=r[s];a.updateVisibility(i),oue(a)&&n.push(a)}}function WKe(e,t){(zKe(t)||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function jKe(e,t,n){t._touchedFrame!==n.frameNumber&&(e._cache.touch(t),t._touchedFrame=n.frameNumber)}function qKe(e){++e.statistics.visited}function YKe(e,t,n){t.contentAvailable&&t.contentVisibility(n)!==Jt.OUTSIDE&&e._selectedTiles.push(t)}var Zv=rue;function aue(){}function Rx(e){return e._visible&&e._inRequestVolume}var Jv={stack:new qu,stackMaximumLength:0},Qv={stack:new qu,stackMaximumLength:0},eD={stack:new qu,stackMaximumLength:0},lm={stack:new qu,stackMaximumLength:0,ancestorStack:new qu,ancestorStackMaximumLength:0},XKe=2;aue.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e._hasMixedContent=!1;let n=e.root;if(E2(e,n,t),!Rx(n)||n.getScreenSpaceError(t,!0)<=e._maximumScreenSpaceError)return;nD(e)?e.immediatelyLoadDesiredLevelOfDetail?$Ke(e,n,t):ZKe(e,n,t):KKe(e,n,t),Jv.stack.trim(Jv.stackMaximumLength),Qv.stack.trim(Qv.stackMaximumLength),eD.stack.trim(eD.stackMaximumLength),lm.stack.trim(lm.stackMaximumLength),lm.ancestorStack.trim(lm.ancestorStackMaximumLength);let i=e._requestedTiles,r=i.length;for(let o=0;o<r;++o)i[o].updatePriority()};function KKe(e,t,n){let i=e._maximumScreenSpaceError,r=e._maximumScreenSpaceError;bW(e,t,i,r,n)}function $Ke(e,t,n){let i=Number.MAX_VALUE,r=e._maximumScreenSpaceError;bW(e,t,i,r,n),fue(e,t,n)}function ZKe(e,t,n){let i=Math.max(e.baseScreenSpaceError,e.maximumScreenSpaceError),r=e.maximumScreenSpaceError;bW(e,t,i,r,n),fue(e,t,n)}function nD(e){return e._skipLevelOfDetail}function JKe(e,t){e._emptyTiles.push(t)}function tD(e,t,n){if(t.contentVisibility(n)!==Jt.OUTSIDE){let i=t.content;i.featurePropertiesDirty?(i.featurePropertiesDirty=!1,t.lastStyleTime=0,e._selectedTilesToStyle.push(t)):t._selectedFrame<n.frameNumber-1&&e._selectedTilesToStyle.push(t),t._selectedFrame=n.frameNumber,e._selectedTiles.push(t)}}function QKe(e,t,n){let i=eD.stack;for(i.push(t);i.length>0;){eD.stackMaximumLength=Math.max(eD.stackMaximumLength,i.length);let o=i.pop().children,s=o.length;for(let a=0;a<s;++a){let c=o[a];Rx(c)&&(c.contentAvailable?(E2(e,c,n),b2(e,c,n),tD(e,c,n)):c._depth-t._depth<XKe&&i.push(c))}}}function T2(e,t,n){if(!nD(e)){t.contentAvailable&&tD(e,t,n);return}let i=t.contentAvailable?t:t._ancestorWithContentAvailable;l(i)?i._shouldSelect=!0:QKe(e,t,n)}function e$e(e,t,n){++e._statistics.visited,t._visitedFrame=n.frameNumber}function b2(e,t,n){t._touchedFrame!==n.frameNumber&&(e._cache.touch(t),t._touchedFrame=n.frameNumber)}function t$e(e,t){e._maximumPriority.distance=Math.max(t._priorityHolder._distanceToCamera,e._maximumPriority.distance),e._minimumPriority.distance=Math.min(t._priorityHolder._distanceToCamera,e._minimumPriority.distance),e._maximumPriority.depth=Math.max(t._depth,e._maximumPriority.depth),e._minimumPriority.depth=Math.min(t._depth,e._minimumPriority.depth),e._maximumPriority.foveatedFactor=Math.max(t._priorityHolder._foveatedFactor,e._maximumPriority.foveatedFactor),e._minimumPriority.foveatedFactor=Math.min(t._priorityHolder._foveatedFactor,e._minimumPriority.foveatedFactor),e._maximumPriority.reverseScreenSpaceError=Math.max(t._priorityReverseScreenSpaceError,e._maximumPriority.reverseScreenSpaceError),e._minimumPriority.reverseScreenSpaceError=Math.min(t._priorityReverseScreenSpaceError,e._minimumPriority.reverseScreenSpaceError)}function n$e(e,t,n){if(!e._cullRequestsWhileMoving)return!0;let i=t.boundingSphere,r=Math.max(i.radius*2,1),o=n.camera,s=o.positionWCDeltaMagnitude!==0?o.positionWCDeltaMagnitude:o.positionWCDeltaMagnitudeLastFrame;return e.cullRequestsWhileMovingMultiplier*s/r<1}function Ox(e,t,n){if(t._requestedFrame===n.frameNumber||!uue(t)&&!t.contentExpired||!n$e(e,t,n))return;let i=n.camera.timeSinceMoved<e.foveatedTimeDelay;t.priorityDeferred&&i||(t._requestedFrame=n.frameNumber,e._requestedTiles.push(t))}function cue(e,t,n){t._updatedVisibilityFrame!==e._updatedVisibilityFrame&&(t.updateVisibility(n),t._updatedVisibilityFrame=e._updatedVisibilityFrame)}function i$e(e,t,n){let i=!1,r=t.children,o=r.length;for(let s=0;s<o;++s){let a=r[s];cue(e,a,n),i=i||Rx(a)}return i}function r$e(e,t,n){let i=t.parent;return!l(i)||i.hasTilesetContent||i.hasImplicitContent||i.refine!==Eo.ADD?!1:t.getScreenSpaceError(n,!0)<=e._maximumScreenSpaceError}function lue(e,t,n){if(cue(e,t,n),!Rx(t))return;let i=t.children.length>0;if((t.hasTilesetContent||t.hasImplicitContent)&&i){let s=t.children[0];lue(e,s,n),t._visible=s._visible;return}if(r$e(e,t,n)){t._visible=!1;return}let r=t.refine===Eo.REPLACE,o=t._optimChildrenWithinParent===Ed.USE_OPTIMIZATION;if(r&&o&&i&&!i$e(e,t,n)){++e._statistics.numberOfTilesCulledWithChildrenUnion,t._visible=!1;return}}function E2(e,t,n){lue(e,t,n),t.updateExpiration(),t._wasMinPriorityChild=!1,t._priorityHolder=t,t$e(e,t),t._shouldSelect=!1,t._finalResolution=!0}function o$e(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let n=e.parent;if(l(n)){let i=!uue(n)||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}}function iD(e){return e.hasEmptyContent||e.hasTilesetContent||e.hasImplicitContent}function uue(e){return!iD(e)&&e.contentUnloaded}function s$e(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||l(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function a$e(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera}function c$e(e,t,n,i){let r,o=t.refine===Eo.REPLACE,s=t.children,a=s.length;for(r=0;r<a;++r)E2(e,s[r],i);s.sort(a$e);let c=!nD(e)&&o&&!iD(t),u=!0,f=!1,d=-1,p=Number.MAX_VALUE,g;for(r=0;r<a;++r)if(g=s[r],Rx(g)?(n.push(g),g._foveatedFactor<p&&(d=r,p=g._foveatedFactor),f=!0):(c||e.loadSiblings)&&(g._foveatedFactor<p&&(d=r,p=g._foveatedFactor),Ox(e,g,i),b2(e,g,i)),c){let m;g._inRequestVolume?iD(g)?m=u$e(e,g,i):m=g.contentAvailable:m=!1,u=u&&m}if(f||(u=!1),d!==-1&&!nD(e)&&o){let m=s[d];m._wasMinPriorityChild=!0;let x=(t._wasMinPriorityChild||t===e.root)&&p<=t._priorityHolder._foveatedFactor?t._priorityHolder:t;for(x._foveatedFactor=Math.min(m._foveatedFactor,x._foveatedFactor),x._distanceToCamera=Math.min(m._distanceToCamera,x._distanceToCamera),r=0;r<a;++r)g=s[r],g._priorityHolder=x}return u}function l$e(e,t,n){return nD(e)?e.immediatelyLoadDesiredLevelOfDetail?!1:l(t._ancestorWithContent)?t._screenSpaceError===0?t.parent._screenSpaceError>n:t._screenSpaceError>n:!0:!0}function TW(e,t){return t.children.length===0?!1:t.hasTilesetContent||t.hasImplicitContent?!t.contentExpired:t._screenSpaceError>e._maximumScreenSpaceError}function bW(e,t,n,i,r){let o=Jv.stack;for(o.push(t);o.length>0;){Jv.stackMaximumLength=Math.max(Jv.stackMaximumLength,o.length);let s=o.pop();o$e(s,r);let a=l$e(e,s,n),c=s.refine===Eo.ADD,u=s.refine===Eo.REPLACE,f=s.parent,d=!l(f)||f._refines,p=!1;TW(e,s)&&(p=c$e(e,s,o,r)&&d);let g=!p&&d;iD(s)?(JKe(e,s,r),Ox(e,s,r),g&&T2(e,s,r)):c?(T2(e,s,r),Ox(e,s,r)):u&&(a?(Ox(e,s,r),g&&T2(e,s,r)):g?(T2(e,s,r),Ox(e,s,r)):s$e(e,s)&&Ox(e,s,r)),e$e(e,s,r),b2(e,s,r),s._refines=p}}function u$e(e,t,n){let i=!0,r=Qv.stack;for(r.push(t);r.length>0;){Qv.stackMaximumLength=Math.max(Qv.stackMaximumLength,r.length);let o=r.pop(),s=o.children,a=s.length,c=iD(o),u=c&&TW(e,o),f=c&&o.children.length===0;if(!u&&!o.contentAvailable&&!f&&(i=!1),E2(e,o,n),Rx(o)||(Ox(e,o,n),b2(e,o,n)),u)for(let d=0;d<a;++d){let p=s[d];r.push(p)}}return i}function fue(e,t,n){let i=lm.stack,r=lm.ancestorStack,o;for(i.push(t);i.length>0||r.length>0;){if(lm.stackMaximumLength=Math.max(lm.stackMaximumLength,i.length),lm.ancestorStackMaximumLength=Math.max(lm.ancestorStackMaximumLength,r.length),r.length>0){let p=r.peek();if(p._stackLength===i.length){r.pop(),p!==o&&(p._finalResolution=!1),tD(e,p,n);continue}}let s=i.pop();if(!l(s))continue;let a=s.refine===Eo.ADD,c=s._shouldSelect,u=s.children,f=u.length,d=TW(e,s);if(c)if(a)tD(e,s,n);else{if(s._selectionDepth=r.length,s._selectionDepth>0&&(e._hasMixedContent=!0),o=s,!d){tD(e,s,n);continue}r.push(s),s._stackLength=i.length}if(d)for(let p=0;p<f;++p){let g=u[p];Rx(g)&&i.push(g)}}}var jp=aue;var Sd={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},qp=new Array(Sd.NUMBER_OF_PASSES);qp[Sd.RENDER]=Object.freeze({traversal:jp,isRender:!0,requestTiles:!0,ignoreCommands:!1});qp[Sd.PICK]=Object.freeze({traversal:jp,isRender:!1,requestTiles:!1,ignoreCommands:!1});qp[Sd.SHADOW]=Object.freeze({traversal:jp,isRender:!1,requestTiles:!0,ignoreCommands:!1});qp[Sd.PRELOAD]=Object.freeze({traversal:jp,isRender:!1,requestTiles:!0,ignoreCommands:!0});qp[Sd.PRELOAD_FLIGHT]=Object.freeze({traversal:jp,isRender:!1,requestTiles:!0,ignoreCommands:!0});qp[Sd.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({traversal:jp,isRender:!1,requestTiles:!0,ignoreCommands:!0});qp[Sd.MOST_DETAILED_PRELOAD]=Object.freeze({traversal:Zv,isRender:!1,requestTiles:!0,ignoreCommands:!0});qp[Sd.MOST_DETAILED_PICK]=Object.freeze({traversal:Zv,isRender:!1,requestTiles:!1,ignoreCommands:!1});Sd.getPassOptions=function(e){return qp[e]};var mo=Object.freeze(Sd);function Yp(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(Yp.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},readyPromise:{get:function(){}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(e){}},batchTable:{get:function(){}},group:{get:function(){},set:function(e){}}});Yp.prototype.hasProperty=function(e,t){return!1};Yp.prototype.getFeature=function(e){};Yp.prototype.applyDebugSettings=function(e,t){};Yp.prototype.applyStyle=function(e){};Yp.prototype.update=function(e,t){};Yp.prototype.isDestroyed=function(){return!1};Yp.prototype.destroy=function(){return ue(this)};var rD=Yp;function au(e){e=y(e,y.EMPTY_OBJECT);let t=e.content,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(au.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});au.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};au.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};au.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};au.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};au.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};au.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};au.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};function EW(e,t){let n=ir(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){EW._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let r=i[n.class];return new au({content:n,class:r})}}EW._oneTimeWarning=Lt;var Tb=EW;function Mx(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,r=ir(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof r=="number")return i[r];let o=n.groupIds.findIndex(function(s){return s===r});return o>=0?i[o]:void 0}function cu(e){e=y(e,y.EMPTY_OBJECT);let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(cu.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});cu.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};cu.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};cu.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};cu.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};cu.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};cu.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};cu.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};function SW(e,t){let n=ir(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){SW._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let r=i[n.class];return new cu({tile:n,class:r})}}SW._oneTimeWarning=Lt;var S2=SW;function Bx(e){let t=new Uint8Array(e),n=Gu(t);if(n==="glTF"&&(n="glb"),Ks.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=f$e(t);if(l(i.root))return{contentType:Ks.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Ks.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Ks.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Ks.GEOJSON,jsonPayload:i};throw new fe("Invalid tile content.")}function f$e(e){let t;try{t=Vr(e)}catch{throw new fe("Invalid tile content.")}return t}function Bc(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let r=l(i.contents)?i.contents:i.content;this._innerContentHeaders=r,this._requestsInFlight=0,this._cancelCount=0;let o=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(o),this._requests=new Array(o),this._innerContentResources=new Array(o),this._serverKeys=new Array(o);for(let s=0;s<o;s++){let a=n.getDerivedResource({url:r[s].uri}),c=uc.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=c}this._contentsFetchedPromise=void 0}Object.defineProperties(Bc.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},readyPromise:{get:function(){if(!this._contentsCreated)return;let e=this._contents.map(function(n){return n.readyPromise}),t=this;return Promise.all(e).then(function(){return t})}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){},set:function(){}},innerContentUrls:{get:function(){return this._innerContentHeaders.map(function(e){return e.uri})}},contentsFetchedPromise:{get:function(){return this._contentsFetchedPromise}}});function wW(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function d$e(e,t){e._cancelCount++,e._tile._contentState=t;let n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}Bc.prototype.requestInnerContents=function(){if(!h$e(this._serverKeys))return this._serverKeys.length;let e=this._innerContentHeaders;wW(this,e.length);for(let t=0;t<e.length;t++)this._arrayFetchPromises[t]=m$e(this,t,this._cancelCount,this._tile._contentState);return this._contentsFetchedPromise=p$e(this),0};function h$e(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];l(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!uc.serverHasOpenSlots(n,t[n]))return!1;return uc.heapHasOpenSlots(e.length)}function m$e(e,t,n,i){let r=e._innerContentResources[t].clone(),o=e.tile,s=function(){return o._priority},a=e._serverKeys[t],c=new oo({throttle:!0,throttleByServer:!0,type:ro.TILES3D,priorityFunction:s,serverKey:a});r.request=c,e._requests[t]=c;let u=r.fetchArrayBuffer();return l(u)?u.then(function(f){if(!(n<e._cancelCount))return wW(e,-1),f}).catch(function(f){if(!(n<e._cancelCount)){if(r.request.state===mi.CANCELLED){d$e(e,i);return}wW(e,-1),due(e,t,f)}}):Promise.resolve(void 0)}function p$e(e){let t=e._cancelCount;return Promise.all(e._arrayFetchPromises).then(function(n){if(t<e._cancelCount)return;let i=n.map(function(r,o){if(!!l(r))return _$e(e,r,o)});e._contentsCreated=!0,e._contents=i.filter(l)})}function _$e(e,t,n){let i=Bx(t);if(i.contentType===Ks.EXTERNAL_TILESET){let d=new fe("External tilesets are disallowed inside multiple contents");return due(e,n,d)}e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Ks.GEOMETRY||i.contentType===Ks.VECTOR;let r=e._tileset,o=e._innerContentResources[n],s=e._tile,a,c=Ab[i.contentType];l(i.binaryPayload)?a=c(r,s,o,i.binaryPayload.buffer,0):a=c(r,s,o,i.jsonPayload);let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let d=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=d.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=Tb(r,u));let f=Mx(r,u);return l(f)&&(a.group=new yg({metadata:f})),a}function due(e,t,n){let i=e._tileset,r=e._innerContentResources[t].url,o=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:r,message:o}):(console.log(`A content failed to load: ${r}`),console.log(`Error: ${o}`))}Bc.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];l(t)&&t.cancel()}};Bc.prototype.hasProperty=function(e,t){return!1};Bc.prototype.getFeature=function(e){};Bc.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyDebugSettings(e,t)};Bc.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Bc.prototype.update=function(e,t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].update(e,t)};Bc.prototype.isDestroyed=function(){return!1};Bc.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};function Eb(e){this.rectangle=he.clone(e.rectangle),this.minimumHeight=y(e.minimumHeight,0),this.maximumHeight=y(e.maximumHeight,0),this.southwestCornerCartesian=new h,this.northeastCornerCartesian=new h,this.westNormal=new h,this.southNormal=new h,this.eastNormal=new h,this.northNormal=new h;let t=y(e.ellipsoid,oe.WGS84);A$e(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,y(e.computeBoundingVolumes,!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(Eb.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});Eb.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=Ai.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=re.fromOrientedBoundingBox(this._orientedBoundingBox)};var hue=new h,w2=new h,mue=new h,g$e=new h,y$e=new h,x$e=new h,C$e=new h,xf=new me,pue=new an(h.UNIT_X,0),bb=new En;function A$e(e,t,n){n.cartographicToCartesian(he.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(he.northeast(t),e.northeastCornerCartesian),xf.longitude=t.west,xf.latitude=(t.south+t.north)*.5,xf.height=0;let i=n.cartographicToCartesian(xf,x$e),r=h.cross(i,h.UNIT_Z,g$e);h.normalize(r,e.westNormal),xf.longitude=t.east;let o=n.cartographicToCartesian(xf,C$e),s=h.cross(h.UNIT_Z,o,hue);h.normalize(s,e.eastNormal);let a=h.subtract(i,o,hue);h.magnitude(a)===0&&(a=h.clone(r,a));let c=h.normalize(a,y$e),u=t.south,f;if(u>0){xf.longitude=(t.west+t.east)*.5,xf.latitude=u;let x=n.cartographicToCartesian(xf,bb.origin);h.clone(c,bb.direction);let C=an.fromPointNormal(e.southwestCornerCartesian,e.westNormal,pue);er.rayPlane(bb,C,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(x,w2)}else f=n.geodeticSurfaceNormalCartographic(he.southeast(t),w2);let d=h.cross(f,a,mue);h.normalize(d,e.southNormal);let p=t.north,g;if(p<0){xf.longitude=(t.west+t.east)*.5,xf.latitude=p;let x=n.cartographicToCartesian(xf,bb.origin);h.negate(c,bb.direction);let C=an.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,pue);er.rayPlane(bb,C,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(x,w2)}else g=n.geodeticSurfaceNormalCartographic(he.northwest(t),w2);let m=h.cross(a,g,mue);h.normalize(m,e.northNormal)}var T$e=new h,b$e=new h,E$e=new h(0,-1,0),S$e=new h(0,0,-1),_ue=new h;function w$e(e,t){let n=t.camera,i=n.positionWC,r=n.positionCartographic,o=0;if(!he.contains(e.rectangle,r)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,d=e.westNormal,p=e.southNormal,g=e.eastNormal,m=e.northNormal;t.mode!==te.SCENE3D&&(u=t.mapProjection.project(he.southwest(e.rectangle),T$e),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(he.northeast(e.rectangle),b$e),f.z=f.y,f.y=f.x,f.x=0,d=E$e,g=h.UNIT_Y,p=S$e,m=h.UNIT_Z);let x=h.subtract(i,u,_ue),C=h.dot(x,d),A=h.dot(x,p),b=h.subtract(i,f,_ue),T=h.dot(b,g),S=h.dot(b,m);C>0?o+=C*C:T>0&&(o+=T*T),A>0?o+=A*A:S>0&&(o+=S*S)}let s,a,c;if(t.mode===te.SCENE3D?(s=r.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let u=s-c;o+=u*u}else if(s<a){let u=a-s;o+=u*u}return Math.sqrt(o)}Eb.prototype.distanceToCamera=function(e){let t=w$e(this,e);if(e.mode===te.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};Eb.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};Eb.prototype.createDebugVolume=function(e){let t=new N.clone(N.IDENTITY),n=new uT({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new pt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Ot.fromColor(e)}});return new Tn({geometryInstances:i,appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})};var wd=Eb;var v2=new me;function oD(e){let t=ng.fromToken(e.token),n=y(e.minimumHeight,0),i=y(e.maximumHeight,0),r=y(e.ellipsoid,oe.WGS84);this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=r;let o=L$e(t,n,i,r);this._boundingPlanes=o;let s=k$e(o);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=BW(o[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=h.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=BW(o[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=BW(o[2+a],[s[a%4],s[(a+1)%4],s[4+(a+1)%4],s[4+a]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],a=0;a<4;a++)this._planeVertices.push([this._vertices[a%4],this._vertices[(a+1)%4],this._vertices[4+(a+1)%4],this._vertices[4+a]]);let c=t.getCenter();v2=r.cartesianToCartographic(c,v2),v2.height=(i+n)/2,this.center=r.cartographicToCartesian(v2,c),this._boundingSphere=re.fromPoints(s)}var v$e=new h,D$e=new me,P$e=new h,I$e=new me,O$e=new h,R$e=new h,M$e=new h,B$e=new h;function L$e(e,t,n,i){let r=new Array(6),o=e.getCenter(),s=i.geodeticSurfaceNormal(o,v$e),a=i.cartesianToCartographic(o,D$e);a.height=n;let c=i.cartographicToCartesian(a,P$e),u=an.fromPointNormal(c,s);r[0]=u;let f=0,d,p=[],g,m;for(d=0;d<4;d++){g=e.getVertex(d),p[d]=g,m=i.cartesianToCartographic(g,I$e),m.height=t;let C=an.getPointDistance(u,i.cartographicToCartesian(m,O$e));C<f&&(f=C)}let x=an.clone(u);for(x.normal=h.negate(x.normal,x.normal),x.distance=x.distance*-1+f,r[1]=x,d=0;d<4;d++){g=p[d];let C=p[(d+1)%4],A=i.geodeticSurfaceNormal(g,R$e),b=h.subtract(C,g,B$e),T=h.cross(b,A,M$e);T=h.normalize(T,T),r[2+d]=an.fromPointNormal(g,T)}return r}var Lx=new h,Nx=new h,Fx=new h,vW=new h,DW=new h,PW=new h,N$e=new h,F$e=new h,V$e=new h,IW=new h,OW=new h,RW=new h,Kg=new h,um=new Q;function gue(e,t,n){Lx=e.normal,Nx=t.normal,Fx=n.normal,vW=h.multiplyByScalar(e.normal,-e.distance,vW),DW=h.multiplyByScalar(t.normal,-t.distance,DW),PW=h.multiplyByScalar(n.normal,-n.distance,PW),IW=h.multiplyByScalar(h.cross(Nx,Fx,N$e),h.dot(vW,Lx),IW),OW=h.multiplyByScalar(h.cross(Fx,Lx,F$e),h.dot(DW,Nx),OW),RW=h.multiplyByScalar(h.cross(Lx,Nx,V$e),h.dot(PW,Fx),RW),um[0]=Lx.x,um[1]=Nx.x,um[2]=Fx.x,um[3]=Lx.y,um[4]=Nx.y,um[5]=Fx.y,um[6]=Lx.z,um[7]=Nx.z,um[8]=Fx.z;let i=Q.determinant(um);return Kg=h.add(IW,OW,Kg),Kg=h.add(Kg,RW,Kg),new h(Kg.x/i,Kg.y/i,Kg.z/i)}function k$e(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=gue(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=gue(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var MW=new h,Sb=new h;function BW(e,t){let n=[];for(let i=0;i<4;i++)MW=h.subtract(t[(i+1)%4],t[i],MW),Sb=h.cross(e.normal,MW,Sb),Sb=h.normalize(Sb,Sb),n[i]=h.clone(Sb);return n}Object.defineProperties(oD.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var LW=new h;oD.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],r;an.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),r=this._edgeNormals[0]):an.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),r=this._edgeNormals[1]);let o,s;for(o=0;o<4;o++)s=2+o,an.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),r=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=NW(an.projectPointOntoPlane(c,t,LW),i[0],c,r),h.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=yue(t,p[0],p[1]),h.distance(a,t)}let f=Number.MAX_VALUE,d;for(o=0;o<2;o++)c=this._boundingPlanes[n[o]],a=NW(an.projectPointOntoPlane(c,t,LW),i[o],c,this._edgeNormals[n[o]]),d=h.distanceSquared(a,t),d<f&&(f=d);return Math.sqrt(f)}else if(n.length>3)return a=NW(an.projectPointOntoPlane(this._boundingPlanes[1],t,LW),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),h.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?h.distance(t,this._vertices[(n[1]-2+u)%4]):h.distance(t,this._vertices[4+(n[1]-2+u)%4])};var U$e=new h,z$e=new h;function yue(e,t,n){let i=h.subtract(n,t,U$e),r=h.subtract(e,t,z$e),o=h.dot(i,r);if(o<=0)return t;let s=h.dot(i,i);return o>=s?n:(o=o/s,new h((1-o)*t.x+o*n.x,(1-o)*t.y+o*n.y,(1-o)*t.z+o*n.z))}var H$e=new an(h.UNIT_X,0);function NW(e,t,n,i){let r=Number.MAX_VALUE,o,s,a;for(let c=0;c<t.length;c++){let u=an.fromPointNormal(t[c],i[c],H$e);an.getPointDistance(u,e)<0||(a=yue(e,t[c],t[(c+1)%4]),o=h.distance(e,a),o<r&&(r=o,s=a))}return l(s)?s:e}oD.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)h.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?Jt.INSIDE:n===this._vertices.length?Jt.OUTSIDE:Jt.INTERSECTING};oD.prototype.createDebugVolume=function(e){let t=new N.clone(N.IDENTITY),n=new Qf({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Qf.createGeometry(n),r=new pt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Ot.fromColor(e)}}),o=new Qf({polygonHierarchy:{positions:this._planeVertices[1]}}),s=Qf.createGeometry(o),a=new pt({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Ot.fromColor(e)}}),c=[];for(let u=0;u<4;u++){let f=new Qf({polygonHierarchy:{positions:this._planeVertices[2+u]}}),d=Qf.createGeometry(f);c[u]=new pt({geometry:d,id:"outline",modelMatrix:t,attributes:{color:Ot.fromColor(e)}})}return new Tn({geometryInstances:[c[0],c[1],c[2],c[3],a,r],appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})};var D2=oD;function wb(e,t){t===0&&(t=M.EPSILON7),this._boundingSphere=new re(e,t)}Object.defineProperties(wb.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}});wb.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};wb.prototype.intersectPlane=function(e){return re.intersectPlane(this._boundingSphere,e)};wb.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};wb.prototype.createDebugVolume=function(e){let t=new og({radius:this.radius}),n=N.fromTranslation(this.center,new N.clone(N.IDENTITY)),i=new pt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Ot.fromColor(e)}});return new Tn({geometryInstances:i,appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})};var $g=wb;var G$e=new h,W$e=new h,j$e=new h,q$e=new h;function Vx(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,M.EPSILON7/i,n)}function FW(e,t){let n=h.normalize(e,q$e),i=h.equalsEpsilon(n,h.UNIT_X,M.EPSILON6)?h.UNIT_Y:h.UNIT_X;return Vx(e,i,t)}function xue(e){let t=Q.getColumn(e,0,G$e),n=Q.getColumn(e,1,W$e),i=Q.getColumn(e,2,j$e),r=h.equals(t,h.ZERO),o=h.equals(n,h.ZERO),s=h.equals(i,h.ZERO);return!r&&!o&&!s?e:r&&o&&s?(e[0]=M.EPSILON7,e[4]=M.EPSILON7,e[8]=M.EPSILON7,e):(r&&!o&&!s?t=Vx(n,i,t):!r&&o&&!s?n=Vx(t,i,n):!r&&!o&&s?i=Vx(n,t,i):r?o?s||(t=FW(i,t),n=Vx(i,t,n)):(t=FW(n,t),i=Vx(n,t,i)):(n=FW(t,n),i=Vx(n,t,i)),Q.setColumn(e,0,t,e),Q.setColumn(e,1,n,e),Q.setColumn(e,2,i,e),e)}function vb(e,t){t=xue(t),this._orientedBoundingBox=new Ai(e,t),this._boundingSphere=re.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(vb.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});vb.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};vb.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};vb.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=xue(t),Q.clone(t,this._orientedBoundingBox.halfAxes),re.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};vb.prototype.createDebugVolume=function(e){let t=new Ch({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=N.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new pt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Ot.fromColor(e)}});return new Tn({geometryInstances:i,appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})};var vd=vb;function Zr(e,t,n,i){this._tileset=e,this._header=n;let r=l(n.contents),o=r&&n.contents.length>1||ir(n,"3DTILES_multiple_contents"),s=r&&!o?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?N.unpack(n.transform):N.clone(N.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=N.multiply(a,this.transform,new N),u=l(i)?i._initialTransform:N.IDENTITY;this._initialTransform=N.multiply(u,this.transform,new N),this.computedTransform=c,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(s)&&l(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let d;l(n.viewerRequestVolume)&&(d=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=d,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i.geometricError:e._geometricError,Zr._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&Zr._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Eo.REPLACE:Eo.ADD):l(i)?p=i.refine:p=Eo.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,m=!1,x,C,A;if(t=De.createIfNeeded(t),o)x=Mr.UNLOADED,C=t.clone();else if(l(s)){let w=s.uri;l(s.url)&&(Zr._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),w=s.url),w===""?(Zr._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),g=new rD(e,this),m=!0,x=Mr.READY):(x=Mr.UNLOADED,C=t.getDerivedResource({url:w}),A=uc.getServerKey(C.getUrlComponent()))}else g=new rD(e,this),m=!0,x=Mr.READY;this._content=g,this._contentResource=C,this._contentState=x,this._contentReadyToProcessPromise=void 0,this._contentReadyPromise=void 0,this._expiredContent=void 0,this._serverKey=A,this.hasEmptyContent=m,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=o,this.metadata=S2(e,n),this.cacheNode=void 0;let b=n.expire,T,S;l(b)&&(T=b.duration,l(b.date)&&(S=ee.fromIso8601(b.date))),this.expireDuration=T,this.expireDate=S,this.lastStyleTime=0,this._optimChildrenWithinParent=Ed.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._clippingPlanesState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=z.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new ee,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}Zr._deprecationWarning=di;Object.defineProperties(Zr.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return y(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new z),z.clone(this._color)},set:function(e){this._color=z.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&!this.hasEmptyContent&&!this.hasTilesetContent&&!this.hasImplicitContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Mr.READY}},contentUnloaded:{get:function(){return this._contentState===Mr.UNLOADED}},contentExpired:{get:function(){return this._contentState===Mr.EXPIRED}},contentFailed:{get:function(){return this._contentState===Mr.FAILED}},contentReadyToProcessPromise:{get:function(){return this._contentReadyToProcessPromise}},contentReadyPromise:{get:function(){return this._contentReadyPromise}},commandsLength:{get:function(){return this._commandsLength}}});var Zg=new h;function Y$e(e,t){let n=e._tileset,i=t.camera,r=e.boundingSphere,o=r.radius,s=h.multiplyByScalar(i.directionWC,e._centerZDepth,Zg),a=h.add(i.positionWC,s,Zg),c=h.subtract(a,r.center,Zg);if(h.magnitude(c)>o){let T=h.normalize(c,Zg),S=h.multiplyByScalar(T,o,Zg),w=h.add(r.center,S,Zg),D=h.subtract(w,i.positionWC,Zg),I=h.normalize(D,Zg);e._foveatedFactor=1-Math.abs(h.dot(i.directionWC,I))}else e._foveatedFactor=0;let d=e.refine===Eo.REPLACE,p=n._skipLevelOfDetail;if(d&&!p||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&d&&p||n._pass===mo.PRELOAD_FLIGHT||n._pass===mo.PRELOAD)return!1;let g=1-Math.cos(i.frustum.fov*.5),m=n.foveatedConeSize*g;if(e._foveatedFactor<=m)return!1;let x=g-m,C=M.clamp((e._foveatedFactor-m)/x,0,1),A=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.maximumScreenSpaceError,C),b=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.maximumScreenSpaceError-A<=b}var Tue=new ee;Zr.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,r=y(n,1),o=l(this.parent)?this.parent.geometricError:i._geometricError,s=t?o:this.geometricError;if(s===0)return 0;let a=e.camera,c=a.frustum,u=e.context,f=u.drawingBufferWidth,d=u.drawingBufferHeight*r,p;if(e.mode===te.SCENE2D||c instanceof en){l(c._offCenterFrustum)&&(c=c._offCenterFrustum);let g=Math.max(c.top-c.bottom,c.right-c.left)/Math.max(f,d);p=s/g}else{let g=Math.max(this._distanceToCamera,M.EPSILON7),m=a.frustum.sseDenominator;if(p=s*d/(g*m),i.dynamicScreenSpaceError){let x=i._dynamicScreenSpaceErrorComputedDensity,C=i.dynamicScreenSpaceErrorFactor;p-=M.fog(g,x)*C}}return p/=e.pixelRatio,p};function X$e(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=t._screenSpaceErrorProgressiveResolution>e._maximumScreenSpaceError;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let i=t.parent,r=e._maximumScreenSpaceError,o=t._screenSpaceErrorProgressiveResolution<=r,s=l(i)&&i._screenSpaceErrorProgressiveResolution>r;return o&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,n=!0),n}function K$e(e,t){let n=t.parent,r=l(n)&&(!e._skipLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-r}Zr.prototype.updateVisibility=function(e){let t=this.parent,n=this._tileset,i=l(t)?t.computedTransform:n.modelMatrix,r=l(t)?t._visibilityPlaneMask:da.MASK_INDETERMINATE;this.updateTransform(i),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,r),this._visible=this._visibilityPlaneMask!==da.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=K$e(n,this),this._priorityProgressiveResolution=X$e(n,this),this.priorityDeferred=Y$e(this,e)};Zr.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=ee.now(Tue);ee.lessThan(this.expireDate,e)&&(this._contentState=Mr.EXPIRED,this._expiredContent=this._content)}};function $$e(e){if(l(e.expireDuration)){let t=ee.now(Tue);ee.addSeconds(t,e.expireDuration,t),l(e.expireDate)?ee.lessThan(e.expireDate,t)&&ee.clone(t,e.expireDate):e.expireDate=ee.clone(t)}}function Z$e(e){return function(){return e._priority}}Zr.prototype.requestContent=function(){return this.hasEmptyContent?0:this.hasMultipleContents?J$e(this):Q$e(this)};function J$e(e){let t=e._content,n=e._tileset;if(!l(t)){let o=ir(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new Bc(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(i>0)return i;e._contentState=Mr.LOADING;let r=t.contentsFetchedPromise.then(function(){if(!(e._contentState!==Mr.LOADING||!l(t.readyPromise))){if(e.isDestroyed()){VW(e,n,"Tile was unloaded while content was loading");return}return e._contentState=Mr.PROCESSING,t}});return e._contentReadyToProcessPromise=r,e._contentReadyPromise=r.then(function(o){if(!!l(o))return t.readyPromise}).then(function(o){if(!!l(o)){if(e.isDestroyed()){VW(e,n,"Tile was unloaded while content was processing");return}return e._selectedFrame=0,e.lastStyleTime=0,ee.now(e._loadTimestamp),e._contentState=Mr.READY,o}}).catch(function(o){VW(e,n,o)}),0}function VW(e,t,n){e._contentState===Mr.PROCESSING&&--t.statistics.numberOfTilesProcessing,e._contentState=Mr.FAILED}function Q$e(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new oo({throttle:!0,throttleByServer:!0,type:ro.TILES3D,priorityFunction:Z$e(e),serverKey:e._serverKey});e._request=i,t.request=i;let r=t.fetchArrayBuffer();if(!l(r))return 1;let o=e._contentState,s=e._tileset;e._contentState=Mr.LOADING,++s.statistics.numberOfPendingRequests;let a=r.then(function(c){if(e.isDestroyed()){kW(e,s);return}let u=eZe(e,c);return n&&(e.expireDate=void 0),e._content=u,e._contentState=Mr.PROCESSING,u});return e._contentReadyToProcessPromise=a,e._contentReadyPromise=a.then(function(c){if(!!l(c))return--s.statistics.numberOfPendingRequests,c.readyPromise}).then(function(c){if(!!l(c)){if(e.isDestroyed()){kW(e,s);return}return $$e(e),e._selectedFrame=0,e.lastStyleTime=0,ee.now(e._loadTimestamp),e._contentState=Mr.READY,c}}).catch(function(c){return i.state===mi.CANCELLED?(e._contentState=o,--s.statistics.numberOfPendingRequests,++s.statistics.numberOfAttemptedRequests,Promise.reject("Cancelled")):(kW(e,s),Promise.reject(c))}),0}function kW(e,t){e._contentState===Mr.PROCESSING?--t.statistics.numberOfTilesProcessing:--t.statistics.numberOfPendingRequests,e._contentState=Mr.FAILED}function eZe(e,t){let n=Bx(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===Ks.GEOMETRY||n.contentType===Ks.VECTOR,(n.contentType===Ks.IMPLICIT_SUBTREE||n.contentType===Ks.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0),n.contentType===Ks.EXTERNAL_TILESET&&(e.hasTilesetContent=!0);let r,o=Ab[n.contentType];l(n.binaryPayload)?r=o(i,e,e._contentResource,n.binaryPayload.buffer,0):r=o(i,e,e._contentResource,n.jsonPayload);let s=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,u=e.implicitCoordinates;r.metadata=c.getContentMetadataView(u,0)}else e.hasImplicitContent||(r.metadata=Tb(i,s));let a=Mx(i,s);return l(a)&&(r.group=new yg({metadata:a})),r}Zr.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};Zr.prototype.unloadContent=function(){this.hasEmptyContent||this.hasTilesetContent||this.hasImplicitContent||(this._content=this._content&&this._content.destroy(),this._contentState=Mr.UNLOADED,this._contentReadyToProcessPromise=void 0,this._contentReadyPromise=void 0,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var bue=new re;function zW(e,t){if(t.mode!==te.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=re.projectTo2D(n,t.mapProjection,bue);e._boundingVolume2D=new $g(i.center,i.radius)}return t.mode!==te.SCENE3D?e._boundingVolume2D:e._boundingVolume}function tZe(e,t){if(t.mode!==te.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=re.projectTo2D(n,t.mapProjection,bue);e._contentBoundingVolume2D=new $g(i.center,i.radius)}return t.mode!==te.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}Zr.prototype.visibility=function(e,t){let n=e.cullingVolume,i=zW(this,e),r=this._tileset,o=r.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(i,r.clippingPlanesOriginMatrix);if(this._isClipped=s!==Jt.INSIDE,s===Jt.OUTSIDE)return da.MASK_OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};Zr.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return Jt.INSIDE;if(this._visibilityPlaneMask===da.MASK_INSIDE)return Jt.INSIDE;let t=e.cullingVolume,n=tZe(this,e),i=this._tileset,r=i.clippingPlanes;if(l(r)&&r.enabled){let o=r.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=o!==Jt.INSIDE,o===Jt.OUTSIDE)return Jt.OUTSIDE}return t.computeVisibility(n)};Zr.prototype.distanceToTile=function(e){return zW(this,e).distanceToCamera(e)};var nZe=new h;Zr.prototype.distanceToTileCenter=function(e){let n=zW(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,nZe);return h.dot(e.camera.directionWC,i)};Zr.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var Eue=new Q,Sue=new h,iZe=new Q,wue=new h,vue=new he,rZe=new Ai,UW=new N;function oZe(e,t,n){let i=h.fromElements(e[0],e[1],e[2],wue),r=Q.fromArray(e,3,iZe);i=N.multiplyByPoint(t,i,i);let o=N.getMatrix3(t,Eue);return r=Q.multiply(o,r,r),l(n)?(n.update(i,r),n):new vd(i,r)}function sZe(e,t,n,i){let r=he.unpack(e,0,vue),o=e[4],s=e[5],a=Ai.fromRectangle(r,o,s,oe.WGS84,rZe),c=a.center,u=a.halfAxes;t=N.multiplyTransformation(t,N.inverseTransformation(n,UW),UW),c=N.multiplyByPoint(t,c,c);let f=N.getMatrix3(t,Eue);return u=Q.multiply(f,u,u),l(i)&&i instanceof vd?(i.update(c,u),i):new vd(c,u)}function aZe(e,t,n,i){if(!N.equalsEpsilon(t,n,M.EPSILON8))return sZe(e,t,n,i);if(l(i))return i;let r=he.unpack(e,0,vue);return new wd({rectangle:r,minimumHeight:e[4],maximumHeight:e[5]})}function cZe(e,t,n){let i=h.fromElements(e[0],e[1],e[2],wue),r=e[3];i=N.multiplyByPoint(t,i,i);let o=N.getScale(t,Sue);return r*=h.maximumComponent(o),l(n)?(n.update(i,r),n):new $g(i,r)}Zr.prototype.createBoundingVolume=function(e,t,n){if(!l(e))throw new fe("boundingVolume must be defined");if(ir(e,"3DTILES_bounding_volume_S2"))return new D2(e.extensions["3DTILES_bounding_volume_S2"]);if(l(e.box))return oZe(e.box,t,n);if(l(e.region))return aZe(e.region,t,this._initialTransform,n);if(l(e.sphere))return cZe(e.sphere,t,n);throw new fe("boundingVolume must contain a sphere, region, or box")};Zr.prototype.updateTransform=function(e){e=y(e,N.IDENTITY);let t=N.multiply(e,this.transform,UW);if(!!N.equals(t,this.computedTransform))return;N.clone(t,this.computedTransform);let i=this._header,r=this._contentHeader;this._boundingVolume=this.createBoundingVolume(i.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(i.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};Zr.prototype.updateGeometricErrorScale=function(){let e=N.getScale(this.computedTransform,Sue),t=h.maximumComponent(e);this.geometricError=this._geometricError*t};function lZe(e,t,n,i){if(!i.isRender)return;let r=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),o=e.hasEmptyContent||e.hasTilesetContent||e.hasImplicitContent,s=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!r;if(s){let u;e._finalResolution?o?u=z.DARKGRAY:u=z.WHITE:u=z.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(u)),e._debugBoundingVolume.update(n);let f=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");f.color=Ot.toValue(u,f.color)}else!s&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&r?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(z.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(z.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let a=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),c=!t.debugColorizeTiles&&e._debugColorizeTiles;a?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):c&&(e._debugColorizeTiles=!1,e.color=z.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),c&&t.makeStyleDirty()}function uZe(e,t,n){let i=e._content,r=e._expiredContent;if(!e.hasMultipleContents&&l(r)){if(!e.contentReady){r.update(t,n);return}e._expiredContent.destroy(),e._expiredContent=void 0}i.update(t,n)}function fZe(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}Zr.prototype.update=function(e,t,n){let i=t.commandList.length;fZe(this,e),lZe(this,e,t,n),uZe(this,e,t);let o=t.commandList.length-i;this._commandsLength=o;for(let s=0;s<o;++s){let a=t.commandList[i+s],c=a.pass===Ce.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1};var Cue=[];Zr.prototype.process=function(e,t){let n=t.commandList;t.commandList=Cue,this._content.update(e,t),Cue.length=0,t.commandList=n};function Aue(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function P2(e,t,n){return Math.max(M.normalize(e,t,n)-M.EPSILON7,0)}Zr.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,r=4,o=1,s=0,a=r,c=s+a,u=r,f=c+u,d=o,p=Math.pow(10,f),g=f+d,m=o,x=Math.pow(10,g),C=g+m,A=Math.pow(10,C),b=P2(this._depth,n.depth,i.depth);b=t?1-b:b;let S=!e._skipLevelOfDetail&&this.refine===Eo.REPLACE?P2(this._priorityHolder._distanceToCamera,n.distance,i.distance):P2(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),w=Aue(S,a,s),D=this._priorityProgressiveResolution?0:p,I=P2(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),O=Aue(I,u,c),B=this.priorityDeferred?x:0,L=e._pass===mo.PRELOAD_FLIGHT?0:A;this._priority=b+w+D+O+B+L};Zr.prototype.isDestroyed=function(){return!1};Zr.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),ue(this)};var sD=Zr;function Xp(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.group,i=e.class,r=l(n.properties)?n.properties:{};this._class=i,this._properties=r,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(Xp.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Xp.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};Xp.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};Xp.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};Xp.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};Xp.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};Xp.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};Xp.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};var aD=Xp;function Kp(e){e=y(e,y.EMPTY_OBJECT);let t=e.tileset,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Kp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Kp.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};Kp.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};Kp.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};Kp.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};Kp.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};Kp.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};Kp.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};var I2=Kp;function Due(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataJson,n=e.schema,i=y(t.metadata,t.tileset),r;l(i)&&(r=new I2({tileset:i,class:n.classes[i.class]}));let o=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let u=0;u<c;u++){let f=a[u];s.push(new aD({group:f,class:n.classes[f.class]}))}}else if(l(a)){o=Object.keys(a).sort();let c=o.length;for(let u=0;u<c;u++){let f=o[u];if(a.hasOwnProperty(f)){let d=a[f];s.push(new aD({id:f,group:a[f],class:n.classes[d.class]}))}}}this._schema=n,this._groups=s,this._groupIds=o,this._tileset=r,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Due.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var O2=Due;var Pue={},dZe=new h;Pue.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof vd||i instanceof wd){let r=i._orientedBoundingBox;e._optimChildrenWithinParent=Ed.USE_OPTIMIZATION;for(let o=0;o<n;++o){let a=t[o].boundingVolume;if(!(a instanceof vd||a instanceof wd)){e._optimChildrenWithinParent=Ed.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,u=h.subtract(c.center,r.center,dZe),f=h.magnitude(u);h.divideByScalar(u,f,u);let d=Math.abs(r.halfAxes[0]*u.x)+Math.abs(r.halfAxes[1]*u.y)+Math.abs(r.halfAxes[2]*u.z)+Math.abs(r.halfAxes[3]*u.x)+Math.abs(r.halfAxes[4]*u.y)+Math.abs(r.halfAxes[5]*u.z)+Math.abs(r.halfAxes[6]*u.x)+Math.abs(r.halfAxes[7]*u.y)+Math.abs(r.halfAxes[8]*u.z),p=Math.abs(c.halfAxes[0]*u.x)+Math.abs(c.halfAxes[1]*u.y)+Math.abs(c.halfAxes[2]*u.z)+Math.abs(c.halfAxes[3]*u.x)+Math.abs(c.halfAxes[4]*u.y)+Math.abs(c.halfAxes[5]*u.z)+Math.abs(c.halfAxes[6]*u.x)+Math.abs(c.halfAxes[7]*u.y)+Math.abs(c.halfAxes[8]*u.z);if(d<=p+f){e._optimChildrenWithinParent=Ed.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===Ed.USE_OPTIMIZATION};var R2=Pue;function kx(){this._list=new tO,this._sentinel=this._list.add(),this._trimTiles=!1}kx.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};kx.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};kx.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};kx.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;!l(i)||(this._list.remove(i),t.cacheNode=void 0,n(e,t))};kx.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,r=e.maximumMemoryUsage*1024*1024,o=this._sentinel,s=i.head;for(;s!==o&&(e.totalMemoryUsageInBytes>r||n);){let a=s.item;s=s.next,this.unloadTile(e,a,t)}};kx.prototype.trim=function(){this._trimTiles=!0};var M2=kx;function B2(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function GW(e,t){let n;return t==="_loadTimestamp"?n=ee.toDate(e).getTime():n=e,n}B2.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=GW(e,n),this._referenceMaximum[n]=GW(t,n)};function hZe(e,t){let n=e.tilePropertyName;if(l(n)){let i=GW(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var HW=[new z(.1,.1,.1,1),new z(.153,.278,.878,1),new z(.827,.231,.49,1),new z(.827,.188,.22,1),new z(1,.592,.259,1),new z(1,.843,0,1)];B2.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=hZe(this,e),r=this._previousMinimum,o=this._previousMaximum;if(r===Number.MAX_VALUE||o===-Number.MAX_VALUE)return;let s=o-r+M.EPSILON7,c=M.clamp(i-r,0,s)/s,u=HW.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),g=f-d,m=HW[d],x=HW[p],C=z.clone(z.WHITE);C.red=M.lerp(m.red,x.red,g),C.green=M.lerp(m.green,x.green,g),C.blue=M.lerp(m.blue,x.blue,g),e._debugColor=C};B2.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var L2=B2;function Db(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.batchTableByteLength=0}Db.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};function N2(e,t,n,i){let r=t.innerContents,o=t.pointsLength,s=t.trianglesLength,a=t.featuresLength,c=t.geometryByteLength,u=t.texturesByteLength,f=t.batchTableByteLength;if(i?(e.numberOfFeaturesLoaded+=n?-a:a,e.numberOfPointsLoaded+=n?-o:o,e.geometryByteLength+=n?-c:c,e.texturesByteLength+=n?-u:u,e.batchTableByteLength+=n?-f:f):(e.numberOfFeaturesSelected+=n?-a:a,e.numberOfPointsSelected+=n?-o:o,e.numberOfTrianglesSelected+=n?-s:s),l(r)){let d=r.length;for(let p=0;p<d;++p)N2(e,r[p],n,i)}}Db.prototype.incrementSelectionCounts=function(e){N2(this,e,!1,!1)};Db.prototype.incrementLoadCounts=function(e){N2(this,e,!1,!0)};Db.prototype.decrementLoadCounts=function(e){N2(this,e,!0,!0)};Db.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.selected=e.selected,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.batchTableByteLength=e.batchTableByteLength};var Jg=Db;function cD(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(cD.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});cD.prototype.makeDirty=function(){this._styleDirty=!0};cD.prototype.resetDirty=function(){this._styleDirty=!1};cD.prototype.applyStyle=function(e){if(!e.ready||l(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,r=t?e._selectedTiles:e._selectedTilesToStyle,o=r.length;for(let s=0;s<o;++s){let a=r[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var F2=cD;function lD(e,t,n){let i=ir(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let r=t.boundingVolume;if(!l(r.box)&&!l(r.region)&&!ir(r,"3DTILES_bounding_volume_S2"))throw new fe("Only box, region and 3DTILES_bounding_volume_S2 are supported for implicit tiling");this.boundingVolume=r,this.refine=t.refine,this.subtreeUriTemplate=new De({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let o=mZe(t);for(let s=0;s<o.length;s++){let a=o[s];this.contentHeaders.push($e(a,!0));let c=new De({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=pZe(t),this.subdivisionScheme=cs[i.subdivisionScheme],this.branchingFactor=cs.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function mZe(e){if(ir(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return l(t.contents)?t.contents:t.content}return l(e.contents)?e.contents:l(e.content)?[e.content]:[]}function pZe(e){let t=$e(e,!0);return l(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}function hr(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===cs.OCTREE&&(this.z=e.z)}Object.defineProperties(hr.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===cs.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===cs.OCTREE?Ly.encode3D(this.x,this.y,this.z):Ly.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===cs.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});hr.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===cs.OCTREE){let r=(this.z<<e.level)+e.z;return new hr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new hr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};hr.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),r=Math.floor(this.y/t);if(this.subdivisionScheme===cs.OCTREE){let o=Math.floor(this.z/t);return new hr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r,z:o})}return new hr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r})};hr.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,r=e.y%n;if(this.subdivisionScheme===cs.OCTREE){let o=e.z%n;return new hr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r,z:o})}return new hr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r})};hr.prototype.getChildCoordinates=function(e){let t=this.level+1,n=2*this.x+e%2,i=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===cs.OCTREE){let r=2*this.z+Math.floor(e/4)%2;return new hr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new hr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};hr.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};hr.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};hr.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,r=this.x===n,o=this.y===i;if(this.subdivisionScheme===cs.OCTREE){let s=e.z>>t,a=this.z===s;return r&&o&&a}return r&&o};hr.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===cs.OCTREE?this.z===e.z:!0)};hr.prototype.isImplicitTilesetRoot=function(){return this.level===0};hr.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};hr.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};hr.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===cs.OCTREE&&(e.z=this.z),e};var Iue=[0,0,0];hr.fromMortonIndex=function(e,t,n,i){let r;return e===cs.OCTREE?(r=Ly.decode3D(i,Iue),new hr({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1],z:r[2]})):(r=Ly.decode2D(i,Iue),new hr({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1]}))};hr.fromTileIndex=function(e,t,n){let i,r,o;return e===cs.OCTREE?(i=Math.floor(M.log2(7*n+1)/3),r=((1<<3*i)-1)/7,o=n-r):(i=Math.floor(M.log2(3*n+1)/2),r=((1<<2*i)-1)/3,o=n-r),hr.fromMortonIndex(e,t,i,o)};function $s(e){e=y(e,y.EMPTY_OBJECT),this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new M2,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._cullWithChildrenBounds=y(e.cullWithChildrenBounds,!0),this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new qu,this._maximumScreenSpaceError=y(e.maximumScreenSpaceError,16),this._maximumMemoryUsage=y(e.maximumMemoryUsage,512),this._styleEngine=new F2,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?N.clone(e.modelMatrix):N.clone(N.IDENTITY),this._statistics=new Jg,this._statisticsLast=new Jg,this._statisticsPerPass=new Array(mo.NUMBER_OF_PASSES);for(let o=0;o<mo.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new Jg;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new L2(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=y(e.cullRequestsWhileMoving,!0),this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=y(e.cullRequestsWhileMovingMultiplier,60),this.progressiveResolutionHeightFraction=M.clamp(y(e.progressiveResolutionHeightFraction,.3),0,.5),this.preferLeaves=y(e.preferLeaves,!1),this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._ellipsoid=y(e.ellipsoid,oe.WGS84),this._initialClippingPlanesOriginMatrix=N.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=y(e.vectorClassificationOnly,!1),this._vectorKeepDecodedPositions=y(e.vectorKeepDecodedPositions,!1),this._marsOptions=y(e.marsOptions,{}),this.preloadWhenHidden=y(e.preloadWhenHidden,!1),this.preloadFlightDestinations=y(e.preloadFlightDestinations,!0),this._pass=void 0,this.dynamicScreenSpaceError=y(e.dynamicScreenSpaceError,!1),this.foveatedScreenSpaceError=y(e.foveatedScreenSpaceError,!0),this._foveatedConeSize=y(e.foveatedConeSize,.1),this._foveatedMinimumScreenSpaceErrorRelaxation=y(e.foveatedMinimumScreenSpaceErrorRelaxation,0),this.foveatedInterpolationCallback=y(e.foveatedInterpolationCallback,M.lerp),this.foveatedTimeDelay=y(e.foveatedTimeDelay,.2),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorFactor=4,this.dynamicScreenSpaceErrorHeightFalloff=.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=y(e.shadows,Zt.ENABLED),this.show=y(e.show,!0),this.colorBlendMode=Kl.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new _d(e.pointCloudShading),this._pointCloudEyeDomeLighting=new Lg,this.loadProgress=new ge,this.allTilesLoaded=new ge,this.initialTilesLoaded=new ge,this.tileLoad=new ge,this.tileUnload=new ge,this.tileFailed=new ge,this.tileVisible=new ge,this.skipLevelOfDetail=y(e.skipLevelOfDetail,!1),this._skipLevelOfDetail=this.skipLevelOfDetail,this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=y(e.baseScreenSpaceError,1024),this.skipScreenSpaceErrorFactor=y(e.skipScreenSpaceErrorFactor,16),this.skipLevels=y(e.skipLevels,1),this.immediatelyLoadDesiredLevelOfDetail=y(e.immediatelyLoadDesiredLevelOfDetail,!1),this.loadSiblings=y(e.loadSiblings,!1),this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new Pc,this._shouldDestroyImageBasedLighting=!0),this.lightColor=e.lightColor,this.backFaceCulling=y(e.backFaceCulling,!0),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,z.BLACK),this.splitDirection=y(e.splitDirection,as.NONE),this._projectTo2D=y(e.projectTo2D,!1),this.debugFreezeFrame=y(e.debugFreezeFrame,!1),this.debugColorizeTiles=y(e.debugColorizeTiles,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this.debugWireframe=y(e.debugWireframe,!1),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowContentBoundingVolume=y(e.debugShowContentBoundingVolume,!1),this.debugShowViewerRequestVolume=y(e.debugShowViewerRequestVolume,!1),this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=y(e.debugShowGeometricError,!1),this.debugShowRenderingStatistics=y(e.debugShowRenderingStatistics,!1),this.debugShowMemoryUsage=y(e.debugShowMemoryUsage,!1),this.debugShowUrl=y(e.debugShowUrl,!1),this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader,this.enableModelExperimental=y(e.enableModelExperimental,zA.enableModelExperimental);let t=y(e.featureIdLabel,"featureId_0");typeof t=="number"&&(t=`featureId_${t}`),this._featureIdLabel=t;let n=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof n=="number"&&(n=`instanceFeatureId_${n}`),this._instanceFeatureIdLabel=n,this._schemaLoader=void 0;let i=this,r;this._readyPromise=Promise.resolve(e.url).then(function(o){let s;return r=De.createIfNeeded(o),i._resource=r,i._credits=r.credits,r.extension==="json"?s=r.getBaseUri(!0):r.isDataUri&&(s=""),i._url=r.url,i._basePath=s,$s.loadJson(r)}).then(function(o){if(!i.isDestroyed())return _Ze(i,o)}).then(function(o){if(i.isDestroyed())return;i._root=i.loadTileset(r,o);let s=l(o.asset.gltfUpAxis)?On.fromName(o.asset.gltfUpAxis):On.Y,a=y(e.modelUpAxis,s),c=y(e.modelForwardAxis,On.X),u=o.asset;i._asset=u,i._properties=o.properties,i._geometricError=o.geometricError,i._extensionsUsed=o.extensionsUsed,i._extensions=o.extensions,i._modelUpAxis=a,i._modelForwardAxis=c,i._extras=o.extras;let f=u.extras;if(l(f)&&l(f.cesium)&&l(f.cesium.credits)){let m=f.cesium.credits,x=i._credits;l(x)||(x=[],i._credits=x);for(let C=0;C<m.length;++C){let A=m[C];x.push(new Gt(A.html,i._showCreditsOnScreen))}}let p=i._root.createBoundingVolume(o.root.boundingVolume,N.IDENTITY).boundingSphere.center,g=i._ellipsoid.cartesianToCartographic(p);return l(g)&&g.height>fi._defaultMinTerrainHeight&&(i._initialClippingPlanesOriginMatrix=yt.eastNorthUpToFixedFrame(p)),i._clippingPlanesOriginMatrix=N.clone(i._initialClippingPlanesOriginMatrix),i})}Object.defineProperties($s.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){vs.setOwner(e,this,"_clippingPlanes")}},properties:{get:function(){return this._properties}},ready:{get:function(){return l(this._root)}},readyPromise:{get:function(){return this._readyPromise}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return di("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e}},maximumMemoryUsage:{get:function(){return this._maximumMemoryUsage},set:function(e){this._maximumMemoryUsage=e}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=N.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(N.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):N.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});$s.loadJson=function(e){return De.createIfNeeded(e).fetchJson()};$s.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};$s.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new fe("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new fe("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&$s.checkSupportedExtensions(t.extensionsRequired);let r=this._statistics,o=i.tilesetVersion;l(o)&&(this._basePath+=`?v=${o}`,e=e.clone(),e.setQueryParameters({v:o}));let s=Oue(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++r.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===Eo.ADD;let u=c._header.children;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let p=u[d],g=Oue(this,e,p,c);c.children.push(g),g._depth=c._depth+1,a.push(g)}}this._cullWithChildrenBounds&&R2.checkChildrenWithinParent(c)}return s};function Oue(e,t,n,i){if(l(n.implicitTiling)||ir(n,"3DTILES_implicit_tiling")){let o=e.schema,s=new lD(t,n,o),a=new hr({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,f=$e(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let d=new sD(e,t,f,i);return d.implicitTileset=s,d.implicitCoordinates=a,d}return new sD(e,t,n,i)}function _Ze(e,t){let n=ir(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri)){let r=e._resource.getDerivedResource({url:n.schemaUri});i=Ar.loadSchema({resource:r})}else if(l(n.schema))i=Ar.loadSchema({schema:n.schema});else return Promise.resolve(t);return e._schemaLoader=i,i.promise.then(function(r){return e._metadataExtension=new O2({schema:r.schema,metadataJson:n}),t})}var Rue=new h,gZe=new me,yZe=new N,xZe=new h,CZe=new h,AZe=new h;function TZe(e,t){let n,i,r,o,s,a=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof wd)n=h.normalize(a.positionWC,Rue),i=a.directionWC,r=a.positionCartographic.height,o=u.minimumHeight,s=u.maximumHeight;else{let A=N.inverseTransformation(c.computedTransform,yZe),b=t.mapProjection.ellipsoid,T=u.boundingVolume,S=N.multiplyByPoint(A,T.center,xZe);if(h.magnitude(S)>b.minimumRadius){let w=me.fromCartesian(S,b,gZe);n=h.normalize(a.positionWC,Rue),i=a.directionWC,r=a.positionCartographic.height,o=0,s=w.height*2}else{let w=N.multiplyByPoint(A,a.positionWC,CZe);if(n=h.UNIT_Z,i=N.multiplyByPointAsVector(A,a.directionWC,AZe),i=h.normalize(i,i),r=w.z,u instanceof vd){let D=c._header.boundingVolume.box[11];o=S.z-D,s=S.z+D}else if(u instanceof $g){let D=T.radius;o=S.z-D,s=S.z+D}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,d=o+(s-o)*f,p=s,g=M.clamp((r-d)/(p-d),0,1),m=Math.abs(h.dot(i,n)),x=1-m;x=x*(1-g);let C=e.dynamicScreenSpaceErrorDensity;C*=x,e._dynamicScreenSpaceErrorComputedDensity=C}function bZe(e,t){if(t.hasEmptyContent)return;let n=e._statistics,i=t.contentExpired,r=t.requestContent();if(r>0){n.numberOfAttemptedRequests+=r;return}i&&(t.hasTilesetContent||t.hasImplicitContent?LZe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t),t.contentReadyToProcessPromise.then(vZe(e,t)).catch(function(o){}),t.contentReadyPromise.then(PZe(e,t)).catch(DZe(e,t))}function EZe(e,t){return e._priority-t._priority}$s.prototype.postPassesUpdate=function(e){!this.ready||(SZe(this,e),FZe(this,e),this._cache.unloadTiles(this,Lue),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};$s.prototype.prePassesUpdate=function(e){if(!this.ready)return;OZe(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e),l(this._loadTimestamp)||(this._loadTimestamp=ee.clone(e.time)),this._timeSinceLoad=Math.max(ee.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this._skipLevelOfDetail=this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive,this.dynamicScreenSpaceError&&TZe(this,e),e.newFrame&&this._cache.reset()};function SZe(e,t){let n=e._requestedTilesInFlight,i=0,r=n.length;for(let o=0;o<r;++o){let s=n[o],a=t.frameNumber-s._touchedFrame>=1;if(s._contentState!==Mr.LOADING){++i;continue}else if(a){s.cancelRequests(),++i;continue}i>0&&(n[o-i]=s)}n.length-=i}function wZe(e,t){let n=e._requestedTiles,i=n.length;n.sort(EZe);for(let r=0;r<i;++r)bZe(e,n[r])}function vZe(e,t){return function(){e._processingQueue.push(t),++e._statistics.numberOfTilesProcessing}}function DZe(e,t){return function(n){if(t._contentState!==Mr.FAILED)return;let i=t._contentResource.url,r=l(n.message)?n.message:n.toString();e.tileFailed.numberOfListeners>0?e.tileFailed.raiseEvent({url:i,message:r}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${r}`))}}function PZe(e,t){return function(n){--e._statistics.numberOfTilesProcessing,l(n)&&(!t.hasTilesetContent&&!t.hasImplicitContent&&(e._statistics.incrementLoadCounts(t.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(t)),e.tileLoad.raiseEvent(t))}}function IZe(e){let t=e._processingQueue,n=t.length,i=0;for(let r=0;r<n;++r){let o=t[r];if(o._contentState!==Mr.PROCESSING){++i;continue}i>0&&(t[r-i]=o)}t.length-=i}function OZe(e,t){IZe(e);let n=e._processingQueue,i=n.length;for(let r=0;r<i;++r)n[r].process(e,t)}var V2=new h,RZe={maximumFractionDigits:3};function Mue(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,RZe):Math.round(t).toLocaleString()}function WW(e){let t=e.boundingVolume.boundingVolume,n=t.halfAxes,i=t.radius,r=h.clone(t.center,V2);if(l(n))r.x+=.75*(n[0]+n[3]+n[6]),r.y+=.75*(n[1]+n[4]+n[7]),r.z+=.75*(n[2]+n[5]+n[8]);else if(l(i)){let o=h.normalize(t.center,V2);o=h.multiplyByScalar(o,.75*i,V2),r=h.add(o,t.center,V2)}return r}function jW(e,t,n){let i="",r=0;if(t.debugShowGeometricError&&(i+=`
- Geometric error: ${e.geometricError}`,r++),t.debugShowRenderingStatistics&&(i+=`
- Commands: ${e.commandsLength}`,r++,e.content.pointsLength>0&&(i+=`
- Points: ${e.content.pointsLength}`,r++),e.content.trianglesLength>0&&(i+=`
- Triangles: ${e.content.trianglesLength}`,r++),i+=`
- Features: ${e.content.featuresLength}`,r++),t.debugShowMemoryUsage&&(i+=`
- Texture Memory: ${Mue(e.content.texturesByteLength)}`,i+=`
- Geometry Memory: ${Mue(e.content.geometryByteLength)}`,r+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=`
- Urls:`;let s=e.content.innerContentUrls;for(let a=0;a<s.length;a++)i+=`
- - ${s[a]}`;r+=s.length}else i+=`
- Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${19-r}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(o)}function MZe(e,t){let n,i,r=e._selectedTiles,o=r.length,s=e._emptyTiles,a=s.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let c=l(e.debugPickPosition)?e.debugPickPosition:WW(e.debugPickedTile),u=jW(e.debugPickedTile,e,c);u.pixelOffset=new W(15,-15)}}else{for(n=0;n<o;++n)i=r[n],jW(i,e,WW(i));for(n=0;n<a;++n)i=s[n],(i.hasTilesetContent||i.hasImplicitContent)&&jW(i,e,WW(i))}e._tileDebugLabels.update(t)}function BZe(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let i=n.isRender,r=e._statistics,o=t.commandList,s=o.length,a=e._selectedTiles,c=a.length,u=e._emptyTiles,f=u.length,d=e.tileVisible,p,g,m=e._skipLevelOfDetail&&e._hasMixedContent&&t.context.stencilBuffer&&c>0;e._backfaceCommands.length=0,m&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new li({stencil:0,pass:Ce.CESIUM_3D_TILE,renderState:Ve.fromCache({stencilMask:tn.SKIP_LOD_MASK})})),o.push(e._stencilClearCommand));let x=o.length;for(p=0;p<c;++p)g=a[p],i&&d.raiseEvent(g),g.update(e,t,n),r.incrementSelectionCounts(g.content),++r.selected;for(p=0;p<f;++p)g=u[p],g.update(e,t,n);let C=o.length-x;if(e._backfaceCommands.trim(),m){let A=e._backfaceCommands.values,b=A.length;for(o.length+=b,p=C-1;p>=0;--p)o[x+b+p]=o[x+p];for(p=0;p<b;++p)o[x+p]=A[p]}C=o.length-s,r.numberOfCommands=C,i&&e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&C>0&&e._pointCloudEyeDomeLighting.update(t,s,e.pointCloudShading,e.boundingSphere),i&&(e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new Bp),MZe(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var Bue=[];function LZe(e,t){let n=t,i=Bue;for(i.push(t);i.length>0;){t=i.pop();let r=t.children,o=r.length;for(let s=0;s<o;++s)i.push(r[s]);t!==n&&(NZe(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function Lue(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function NZe(e,t){e._cache.unloadTile(e,t,Lue),t.destroy()}$s.prototype.trimLoadedTiles=function(){this._cache.trim()};function FZe(e,t){let n=e._statistics,i=e._statisticsLast,r=n.numberOfPendingRequests,o=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;Jg.clone(n,i);let c=r!==s||o!==a;c&&t.afterRender.push(function(){e.loadProgress.raiseEvent(r,o)}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){e.allTilesLoaded.raiseEvent()}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){e.initialTilesLoaded.raiseEvent()})))}function VZe(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function kZe(e,t){(t.frameNumber!==e._updatedModelMatrixFrame||!l(e._previousModelMatrix))&&(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!N.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=N.clone(e.modelMatrix,e._previousModelMatrix)))}function UZe(e,t,n,i){if(t.mode===te.MORPHING||!e.ready)return!1;let r=e._statistics;r.clear();let o=i.isRender;++e._updatedVisibilityFrame,VZe(e),kZe(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let s=i.traversal.selectTiles(e,t);if(i.requestTiles&&wZe(e),BZe(e,t,i),Jg.clone(r,n),o){let a=e._credits;if(l(a)&&r.selected!==0){let c=a.length;for(let u=0;u<c;++u){let f=a[u];f.showOnScreen=e._showCreditsOnScreen,t.creditDisplay.addCredit(f)}}}return s}$s.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};$s.prototype.updateForPass=function(e,t){let n=t.pass;if(n===mo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===mo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===mo.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,r=e.camera,o=e.cullingVolume;t.ready=!1;let s=mo.getPassOptions(n),a=s.ignoreCommands,c=y(t.commandList,i),u=c.length;e.commandList=c,e.camera=y(t.camera,r),e.cullingVolume=y(t.cullingVolume,o);let f=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=UZe(this,e,f,s)),a&&(c.length=u),e.commandList=i,e.camera=r,e.cullingVolume=o};$s.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};$s.prototype.isDestroyed=function(){return!1};$s.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),l(this._schemaLoader)&&Ar.unload(this._schemaLoader),l(this._root)){let e=Bue;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children,i=n.length;for(let r=0;r<i;++r)e.push(n[r])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,ue(this)};$s.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};$s.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!$s.supportedExtensions[e[t]])throw new fe(`Unsupported 3D Tiles Extension: ${e[t]}`)};var Cf=$s;var zZe=new N;function Qg(e,t){t.collectionChanged.addEventListener(Qg.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new xt,this._onCollectionChanged(t,t.values,[],[])}Qg.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){let s=t[r],a=s._tileset,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),d;if(f&&(d=s.computeModelMatrix(e,zZe),c=De.createIfNeeded(Y.getValueOrUndefined(a._uri,e))),!f){l(u)&&(u.tilesetPrimitive.show=!1);continue}let p=l(u)?u.tilesetPrimitive:void 0;(!l(p)||c.url!==u.url)&&(l(p)&&(i.removeAndDestroy(p),delete n[s.id]),p=new Cf({url:c}),p.id=s,i.add(p),u={tilesetPrimitive:p,url:c.url,loadFail:!1},n[s.id]=u,HZe(p,s,n)),p.show=!0,l(d)&&(p.modelMatrix=d),p.maximumScreenSpaceError=Y.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError)}return!0};Qg.prototype.isDestroyed=function(){return!1};Qg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Qg.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)qW(this,e[i],t,n);return ue(this)};Qg.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return st.FAILED;let i=n.tilesetPrimitive;return!l(i)||!i.show?st.FAILED:i.ready?(re.clone(i.boundingSphere,t),st.DONE):st.PENDING};Qg.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],l(o._tileset)&&s.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],l(o._tileset)?s.set(o.id,o):(qW(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],qW(this,o,a,c),s.remove(o.id)};function qW(e,t,n,i){let r=n[t.id];l(r)&&(i.removeAndDestroy(r.tilesetPrimitive),delete n[t.id])}function HZe(e,t,n){e.readyPromise.catch(function(i){console.error(i),n[t.id].loadFail=!0})}var k2=Qg;var GZe=z.WHITE,WZe=z.BLACK,jZe=new W(2,2);function Pb(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new ge,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(Pb.prototype,{isConstant:{get:function(){return Y.isConstant(this._evenColor)&&Y.isConstant(this._oddColor)&&Y.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:le("evenColor"),oddColor:le("oddColor"),repeat:le("repeat")});Pb.prototype.getType=function(e){return"Checkerboard"};Pb.prototype.getValue=function(e,t){return l(t)||(t={}),t.lightColor=Y.getValueOrClonedDefault(this._evenColor,e,GZe,t.lightColor),t.darkColor=Y.getValueOrClonedDefault(this._oddColor,e,WZe,t.darkColor),t.repeat=Y.getValueOrDefault(this._repeat,e,jZe),t};Pb.prototype.equals=function(e){return this===e||e instanceof Pb&&Y.equals(this._evenColor,e._evenColor)&&Y.equals(this._oddColor,e._oddColor)&&Y.equals(this._repeat,e._repeat)};var uD=Pb;var Nue={id:void 0};function fD(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let r=t.values.slice(0),o=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,r,o,s)}while(e._refire);e._firing=!1}}}function $a(e){this._owner=e,this._entities=new xt,this._addedEntities=new xt,this._removedEntities=new xt,this._changedEntities=new xt,this._suspendCount=0,this._collectionChanged=new ge,this._id=Ln(),this._show=!0,this._firing=!1,this._refire=!1}$a.prototype.suspendEvents=function(){this._suspendCount++};$a.prototype.resumeEvents=function(){this._suspendCount--,fD(this)};Object.defineProperties($a.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,r=i.length;for(t=0;t<r;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<r;t++){let o=n[t],s=i[t];o!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,o)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});$a.prototype.computeAvailability=function(){let e=ke.MAXIMUM_VALUE,t=ke.MINIMUM_VALUE,n=this._entities.values;for(let i=0,r=n.length;i<r;i++){let s=n[i].availability;if(l(s)){let a=s.start,c=s.stop;ee.lessThan(a,e)&&!a.equals(ke.MINIMUM_VALUE)&&(e=a),ee.greaterThan(c,t)&&!c.equals(ke.MAXIMUM_VALUE)&&(t=c)}}return ke.MAXIMUM_VALUE.equals(e)&&(e=ke.MINIMUM_VALUE),ke.MINIMUM_VALUE.equals(t)&&(t=ke.MAXIMUM_VALUE),new Cn({start:e,stop:t})};$a.prototype.add=function(e){e instanceof uo||(e=new uo(e));let t=e.id,n=this._entities;if(n.contains(t))throw new fe(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener($a.prototype._onEntityDefinitionChanged,this),fD(this),e};$a.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};$a.prototype.contains=function(e){return this._entities.get(e.id)===e};$a.prototype.removeById=function(e){if(!l(e))return!1;let n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener($a.prototype._onEntityDefinitionChanged,this),fD(this),!0):!1};$a.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,r=this._removedEntities;for(let o=0;o<t;o++){let s=n[o],a=s.id,c=i.get(a);l(c)||(s.definitionChanged.removeEventListener($a.prototype._onEntityDefinitionChanged,this),r.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),fD(this)};$a.prototype.getById=function(e){return this._entities.get(e)};$a.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(Nue.id=e,t=new uo(Nue),this.add(t)),t};$a.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),fD(this)};var Zs=$a;var U2={id:void 0},Ib=new Array(2);function YW(e){let t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function Fue(e,t,n,i){Ib[0]=n,Ib[1]=i.id,t[JSON.stringify(Ib)]=i.definitionChanged.addEventListener(No.prototype._onDefinitionChanged,e)}function Vue(e,t,n,i){Ib[0]=n,Ib[1]=i.id;let r=JSON.stringify(Ib);t[r](),t[r]=void 0}function e0(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,r=i.length,o,s,a,c,u,f=e._composite,d=new Zs(e),p=e._eventHash,g;for(o=0;o<r;o++)for(u=i[o],u.collectionChanged.removeEventListener(No.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--)s=a[c],Vue(e,p,g,s);for(o=n-1;o>=0;o--)for(u=t[o],u.collectionChanged.addEventListener(No.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--){s=a[c],Fue(e,p,g,s);let x=d.getById(s.id);l(x)||(x=f.getById(s.id),l(x)?YW(x):(U2.id=s.id,x=new uo(U2)),d.add(x)),x.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let m=d.values;for(o=0;o<m.length;o++)f.add(m[o]);f.resumeEvents()}function No(e,t){this._owner=t,this._composite=new Zs(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Ln(),this._eventHash={},e0(this),this._shouldRecomposite=!1}Object.defineProperties(No.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}});No.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),e0(this)};No.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),e0(this),!0):!1};No.prototype.removeAllCollections=function(){this._collections.length=0,e0(this)};No.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};No.prototype.contains=function(e){return this._composite.contains(e)};No.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};No.prototype.getCollection=function(e){return this._collections[e]};No.prototype.getCollectionsLength=function(){return this._collections.length};function z2(e,t){return e.indexOf(t)}function kue(e,t,n){let i=e._collections;if(t=M.clamp(t,0,i.length-1),n=M.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e0(e)}No.prototype.raiseCollection=function(e){let t=z2(this._collections,e);kue(this,t,t+1)};No.prototype.lowerCollection=function(e){let t=z2(this._collections,e);kue(this,t,t-1)};No.prototype.raiseCollectionToTop=function(e){let t=z2(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),e0(this))};No.prototype.lowerCollectionToBottom=function(e){let t=z2(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),e0(this))};No.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};No.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(e0(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};No.prototype.computeAvailability=function(){return this._composite.computeAvailability()};No.prototype.getById=function(e){return this._composite.getById(e)};No.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,r=i.length,o=this._composite;o.suspendEvents();let s,a,c,u,f=n.length,d=this._eventHash,p=e.id;for(s=0;s<f;s++){let m=n[s];Vue(this,d,p,m);let x=m.id;for(a=r-1;a>=0;a--)c=i[a].getById(x),l(c)&&(l(u)||(u=o.getById(x),YW(u)),u.merge(c));l(u)||o.removeById(x),u=void 0}let g=t.length;for(s=0;s<g;s++){let m=t[s];Fue(this,d,p,m);let x=m.id;for(a=r-1;a>=0;a--)c=i[a].getById(x),l(c)&&(l(u)||(u=o.getById(x),l(u)?YW(u):(U2.id=x,u=new uo(U2),o.add(u))),u.merge(c));u=void 0}o.resumeEvents()};No.prototype._onDefinitionChanged=function(e,t,n,i){let r=this._collections,o=this._composite,s=r.length,a=e.id,c=o.getById(a),u=c[t],f=!l(u),d=!0;for(let p=s-1;p>=0;p--){let g=r[p].getById(e.id);if(l(g)){let m=g[t];if(l(m)){if(d)if(d=!1,l(m.merge)&&l(m.clone))u=m.clone(u);else{u=m;break}u.merge(m)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var Uue=No;function qZe(e,t,n,i){function r(){n.raiseEvent(e)}let o=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);l(c.data)&&o.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,r)}}function Ux(){this._eventHelper=new Yo,this._definitionChanged=new ge,this._intervals=new $o,this._intervals.changedEvent.addEventListener(Ux.prototype._intervalsChanged,this)}Object.defineProperties(Ux.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});Ux.prototype.getValue=function(e,t){let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};Ux.prototype.equals=function(e){return this===e||e instanceof Ux&&this._intervals.equals(e._intervals,Y.equals)};Ux.prototype._intervalsChanged=function(){qZe(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Lc=Ux;function t0(){this._definitionChanged=new ge,this._composite=new Lc,this._composite.definitionChanged.addEventListener(t0.prototype._raiseDefinitionChanged,this)}Object.defineProperties(t0.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});t0.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};t0.prototype.getValue=function(e,t){let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};t0.prototype.equals=function(e){return this===e||e instanceof t0&&this._composite.equals(e._composite,Y.equals)};t0.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var dD=t0;function n0(e){this._referenceFrame=y(e,sr.FIXED),this._definitionChanged=new ge,this._composite=new Lc,this._composite.definitionChanged.addEventListener(n0.prototype._raiseDefinitionChanged,this)}Object.defineProperties(n0.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}});n0.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,sr.FIXED,t)};n0.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};n0.prototype.equals=function(e){return this===e||e instanceof n0&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,Y.equals)};n0.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Ta=n0;var YZe=new Jn(0);function Nc(e){ci.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(Nc.prototype=Object.create(ci.prototype),Nc.prototype.constructor=Nc);Object.defineProperties(Nc.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Nc.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&dl.isSupported(this._scene)};Nc.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};Nc.prototype._computeCenter=ye.throwInstantiationError;Nc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(ci.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r))return;l(r.zIndex)&&(l(r.height)||l(r.extrudedHeight))&&Lt(Lt.geometryZIndex),this._zIndex=y(r.zIndex,YZe),l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference,s=r.extrudedHeightReference;if(l(o)||l(s)){let a=new qh(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new zT(this._scene,a,o,s)}};Nc.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),ci.prototype.destroy.call(this)};Nc.getGeometryHeight=function(e,t){if(!l(e)){t!==ze.NONE&&Lt(Lt.geometryHeightReference);return}return t!==ze.CLAMP_TO_GROUND?e:0};Nc.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==ze.NONE&&Lt(Lt.geometryExtrudedHeightReference);return}return t!==ze.CLAMP_TO_GROUND?e:Nc.CLAMP_TO_GROUND};Nc.CLAMP_TO_GROUND="clamp";Nc.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=ze.NONE),(!l(n)||!l(i))&&(i=ze.NONE);let r=0;if(t!==ze.NONE&&r++,i===ze.RELATIVE_TO_GROUND&&r++,r===2)return nn.ALL;if(r===1)return nn.TOP};var Gn=Nc;var zue=new z,Hue=h.ZERO,Gue=new h,Wue=new he;function XZe(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function Dd(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new XZe(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(Dd.prototype=Object.create(Gn.prototype),Dd.prototype.constructor=Dd);Dd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Dt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,zue)),l(r)||(r=z.WHITE),i.color=Ot.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=nr.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Hue,Gue))),new pt({id:t,geometry:new BA(this._options),attributes:i})};Dd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,zue),r={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ot.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=nr.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Hue,Gue))),new pt({id:t,geometry:new YI(this._options),attributes:r})};Dd.prototype._computeCenter=function(e,t){let n=Y.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return h.clone(n[Math.floor(n.length/2)],t)};Dd.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||ci.prototype._isHidden.call(this,e,t)};Dd.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!Y.isConstant(t.height)||!Y.isConstant(t.extrudedHeight)||!Y.isConstant(t.granularity)||!Y.isConstant(t.width)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.cornerType)||!Y.isConstant(t.zIndex)||this._onTerrain&&!Y.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Dt)};Dd.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrUndefined(t.height,ke.MINIMUM_VALUE),i=Y.getValueOrDefault(t.heightReference,ke.MINIMUM_VALUE,ze.NONE),r=Y.getValueOrUndefined(t.extrudedHeight,ke.MINIMUM_VALUE),o=Y.getValueOrDefault(t.extrudedHeightReference,ke.MINIMUM_VALUE,ze.NONE);l(r)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Dt?rn.VERTEX_FORMAT:lr.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(ke.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(ke.MINIMUM_VALUE),s.granularity=Y.getValueOrUndefined(t.granularity,ke.MINIMUM_VALUE),s.cornerType=Y.getValueOrUndefined(t.cornerType,ke.MINIMUM_VALUE),s.offsetAttribute=Gn.computeGeometryOffsetAttribute(n,i,r,o),s.height=Gn.getGeometryHeight(n,i),r=Gn.getGeometryExtrudedHeight(r,o),r===Gn.CLAMP_TO_GROUND&&(r=fi.getMinimumMaximumHeights(BA.computeRectangle(s,Wue)).minimumTerrainHeight),s.extrudedHeight=r};Dd.DynamicGeometryUpdater=Ob;function Ob(e,t,n){ai.call(this,e,t,n)}l(Object.create)&&(Ob.prototype=Object.create(ai.prototype),Ob.prototype.constructor=Ob);Ob.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||ai.prototype._isHidden.call(this,e,t,n)};Ob.prototype._setOptions=function(e,t,n){let i=this._options,r=Y.getValueOrUndefined(t.height,n),o=Y.getValueOrDefault(t.heightReference,n,ze.NONE),s=Y.getValueOrUndefined(t.extrudedHeight,n),a=Y.getValueOrDefault(t.extrudedHeightReference,n,ze.NONE);l(s)&&!l(r)&&(r=0),i.positions=Y.getValueOrUndefined(t.positions,n),i.width=Y.getValueOrUndefined(t.width,n),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.cornerType=Y.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=Gn.computeGeometryOffsetAttribute(r,o,s,a),i.height=Gn.getGeometryHeight(r,o),s=Gn.getGeometryExtrudedHeight(s,a),s===Gn.CLAMP_TO_GROUND&&(s=fi.getMinimumMaximumHeights(BA.computeRectangle(i,Wue)).minimumTerrainHeight),i.extrudedHeight=s};var H2=Dd;function G2(){ye.throwInstantiationError()}Object.defineProperties(G2.prototype,{name:{get:ye.throwInstantiationError},clock:{get:ye.throwInstantiationError},entities:{get:ye.throwInstantiationError},isLoading:{get:ye.throwInstantiationError},changedEvent:{get:ye.throwInstantiationError},errorEvent:{get:ye.throwInstantiationError},loadingEvent:{get:ye.throwInstantiationError},show:{get:ye.throwInstantiationError},clustering:{get:ye.throwInstantiationError}});G2.prototype.update=function(e){ye.throwInstantiationError()};G2.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Jo=G2;function Fo(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=St.clone(n)),l(i)&&(i=St.clone(i)),l(r)&&(r=Tt.clone(r)),this._show=y(e.show,!0),this._position=h.clone(y(e.position,h.ZERO)),this._actualPosition=h.clone(this._position),this._color=z.clone(y(e.color,z.WHITE)),this._outlineColor=z.clone(y(e.outlineColor,z.TRANSPARENT)),this._outlineWidth=y(e.outlineWidth,0),this._pixelSize=y(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=r,this._disableDepthTestDistance=y(e.disableDepthTestDistance,0),this._id=e.id,this._collection=y(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1}var jue=Fo.SHOW_INDEX=0,Xue=Fo.POSITION_INDEX=1,KZe=Fo.COLOR_INDEX=2,$Ze=Fo.OUTLINE_COLOR_INDEX=3,ZZe=Fo.OUTLINE_WIDTH_INDEX=4,JZe=Fo.PIXEL_SIZE_INDEX=5,QZe=Fo.SCALE_BY_DISTANCE_INDEX=6,eJe=Fo.TRANSLUCENCY_BY_DISTANCE_INDEX=7,tJe=Fo.DISTANCE_DISPLAY_CONDITION_INDEX=8,nJe=Fo.DISABLE_DEPTH_DISTANCE_INDEX=9;Fo.NUMBER_OF_PROPERTIES=10;function Af(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Fo.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Af(this,jue))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),Af(this,Xue))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;St.equals(t,e)||(this._scaleByDistance=St.clone(e,t),Af(this,QZe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;St.equals(t,e)||(this._translucencyByDistance=St.clone(e,t),Af(this,eJe))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Af(this,JZe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Af(this,KZe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Af(this,$Ze))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Af(this,ZZe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Tt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Tt.clone(e,this._distanceDisplayCondition),Af(this,tJe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Af(this,nJe))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Af(this,jue))}}});Fo.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Fo.prototype._getActualPosition=function(){return this._actualPosition};Fo.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),Af(this,Xue)};var que=new se;Fo._computeActualPosition=function(e,t,n){return t.mode===te.SCENE3D?e:(N.multiplyByPoint(n,e,que),rr.computeActualWgs84Position(t,que))};var Yue=new se;Fo._computeScreenSpacePosition=function(e,t,n,i){let r=N.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,Yue),Yue);return rr.wgs84ToWindowCoordinates(n,r,i)};Fo.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new W);let i=n.modelMatrix,r=Fo._computeScreenSpacePosition(i,this._actualPosition,e,t);if(!!l(r))return r.y=e.canvas.clientHeight-r.y,r};Fo.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,r=i*.5,o=t.x-r,s=t.y-r,a=i,c=i;return l(n)||(n=new je),n.x=o,n.y=s,n.width=a,n.height=c,n};Fo.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&z.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&z.equals(this._outlineColor,e._outlineColor)&&St.equals(this._scaleByDistance,e._scaleByDistance)&&St.equals(this._translucencyByDistance,e._translucencyByDistance)&&Tt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance};Fo.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Js=Fo;var zx=`varying vec4 v_color;
- varying vec4 v_outlineColor;
- varying float v_innerPercent;
- varying float v_pixelDistance;
- varying vec4 v_pickColor;
- void main()
- {
- float distanceToCenter = length(gl_PointCoord - vec2(0.5));
- float maxDistance = max(0.0, 0.5 - v_pixelDistance);
- float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);
- float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);
- vec4 color = mix(v_outlineColor, v_color, innerAlpha);
- color.a *= wholeAlpha;
- #if !defined(OPAQUE) && !defined(TRANSLUCENT)
- if (color.a < 0.005)
- {
- discard;
- }
- #else
- #ifdef OPAQUE
- if (color.a < 0.995)
- {
- discard;
- }
- #else
- if (color.a >= 0.995)
- {
- discard;
- }
- #endif
- #endif
- gl_FragColor = czm_gammaCorrect(color);
- czm_writeLogDepth();
- }
- `;var W2=`uniform float u_maxTotalPointSize;
- attribute vec4 positionHighAndSize;
- attribute vec4 positionLowAndOutline;
- attribute vec4 compressedAttribute0;
- attribute vec4 compressedAttribute1;
- attribute vec4 scaleByDistance;
- attribute vec3 distanceDisplayConditionAndDisableDepth;
- varying vec4 v_color;
- varying vec4 v_outlineColor;
- varying float v_innerPercent;
- varying float v_pixelDistance;
- varying vec4 v_pickColor;
- const float SHIFT_LEFT8 = 256.0;
- const float SHIFT_RIGHT8 = 1.0 / 256.0;
- void main()
- {
- vec3 positionHigh = positionHighAndSize.xyz;
- vec3 positionLow = positionLowAndOutline.xyz;
- float outlineWidthBothSides = 2.0 * positionLowAndOutline.w;
- float totalSize = positionHighAndSize.w + outlineWidthBothSides;
- float outlinePercent = outlineWidthBothSides / totalSize;
- totalSize *= czm_pixelRatio;
- totalSize += 3.0;
- float temp = compressedAttribute1.x * SHIFT_RIGHT8;
- float show = floor(temp);
- #ifdef EYE_DISTANCE_TRANSLUCENCY
- vec4 translucencyByDistance;
- translucencyByDistance.x = compressedAttribute1.z;
- translucencyByDistance.z = compressedAttribute1.w;
- translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
- temp = compressedAttribute1.y * SHIFT_RIGHT8;
- translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
- #endif
- vec4 color;
- vec4 outlineColor;
- vec4 pickColor;
- temp = compressedAttribute0.z * SHIFT_RIGHT8;
- pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
- temp = floor(temp) * SHIFT_RIGHT8;
- pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
- pickColor.r = floor(temp);
- temp = compressedAttribute0.x * SHIFT_RIGHT8;
- color.b = (temp - floor(temp)) * SHIFT_LEFT8;
- temp = floor(temp) * SHIFT_RIGHT8;
- color.g = (temp - floor(temp)) * SHIFT_LEFT8;
- color.r = floor(temp);
- temp = compressedAttribute0.y * SHIFT_RIGHT8;
- outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
- temp = floor(temp) * SHIFT_RIGHT8;
- outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
- outlineColor.r = floor(temp);
- temp = compressedAttribute0.w * SHIFT_RIGHT8;
- pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
- pickColor = pickColor / 255.0;
- temp = floor(temp) * SHIFT_RIGHT8;
- outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
- outlineColor /= 255.0;
- color.a = floor(temp);
- color /= 255.0;
- vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
- vec4 positionEC = czm_modelViewRelativeToEye * p;
- #if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)
- float lengthSq;
- if (czm_sceneMode == czm_sceneMode2D)
- {
- lengthSq = czm_eyeHeight2D.y;
- }
- else
- {
- lengthSq = dot(positionEC.xyz, positionEC.xyz);
- }
- #endif
- #ifdef EYE_DISTANCE_SCALING
- totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);
- #endif
- totalSize = min(totalSize, u_maxTotalPointSize);
- if (totalSize < 1.0)
- {
- positionEC.xyz = vec3(0.0);
- totalSize = 1.0;
- }
- float translucency = 1.0;
- #ifdef EYE_DISTANCE_TRANSLUCENCY
- translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
- if (translucency < 0.004)
- {
- positionEC.xyz = vec3(0.0);
- }
- #endif
- #ifdef DISTANCE_DISPLAY_CONDITION
- float nearSq = distanceDisplayConditionAndDisableDepth.x;
- float farSq = distanceDisplayConditionAndDisableDepth.y;
- if (lengthSq < nearSq || lengthSq > farSq) {
- positionEC.xyz = vec3(0.0, 0.0, 1.0);
- }
- #endif
- gl_Position = czm_projection * positionEC;
- czm_vertexLogDepth();
- #ifdef DISABLE_DEPTH_DISTANCE
- float disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z;
- if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
- {
- disableDepthTestDistance = czm_minimumDisableDepthTestDistance;
- }
- if (disableDepthTestDistance != 0.0)
- {
- float zclip = gl_Position.z / gl_Position.w;
- bool clipped = (zclip < -1.0 || zclip > 1.0);
- if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))
- {
- gl_Position.z = -gl_Position.w;
- #ifdef LOG_DEPTH
- czm_vertexLogDepth(vec4(czm_currentFrustum.x));
- #endif
- }
- }
- #endif
- v_color = color;
- v_color.a *= translucency * show;
- v_outlineColor = outlineColor;
- v_outlineColor.a *= translucency * show;
- v_innerPercent = 1.0 - outlinePercent;
- v_pixelDistance = 2.0 / totalSize;
- gl_PointSize = totalSize * show;
- gl_Position *= show;
- v_pickColor = pickColor;
- }
- `;var iJe=Js.SHOW_INDEX,$W=Js.POSITION_INDEX,Kue=Js.COLOR_INDEX,rJe=Js.OUTLINE_COLOR_INDEX,oJe=Js.OUTLINE_WIDTH_INDEX,sJe=Js.PIXEL_SIZE_INDEX,$ue=Js.SCALE_BY_DISTANCE_INDEX,Zue=Js.TRANSLUCENCY_BY_DISTANCE_INDEX,Jue=Js.DISTANCE_DISPLAY_CONDITION_INDEX,aJe=Js.DISABLE_DEPTH_DISTANCE_INDEX,ZW=Js.NUMBER_OF_PROPERTIES,Za={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepth:5};function Tf(e){e=y(e,y.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(ZW),this._maxPixelSize=1,this._baseVolume=new re,this._baseVolumeWC=new re,this._baseVolume2D=new re,this._boundingVolume=new re,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this._modelMatrix=N.clone(N.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,Ir.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=te.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(Tf.prototype,{length:{get:function(){return JW(this),this._pointPrimitives.length}}});function Que(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Tf.prototype.add=function(e){let t=new Js(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};Tf.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Tf.prototype.removeAll=function(){Que(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function JW(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];s&&(s._index=o++,t.push(s))}e._pointPrimitives=t}}Tf.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};Tf.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};Tf.prototype.get=function(e){return JW(this),this._pointPrimitives[e]};Tf.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<ZW;++i){let r=n[i]===0?Ne.STATIC_DRAW:Ne.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function cJe(e,t,n){return new Ng(e,[{index:Za.positionHighAndSize,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[$W]},{index:Za.positionLowAndShow,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[$W]},{index:Za.compressedAttribute0,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[Kue]},{index:Za.compressedAttribute1,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[Zue]},{index:Za.scaleByDistance,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[$ue]},{index:Za.distanceDisplayConditionAndDisableDepth,componentsPerAttribute:3,componentDatatype:K.FLOAT,usage:n[Jue]}],t)}var XW=new zn;function efe(e,t,n,i){let r=i._index,o=i._getActualPosition();e._mode===te.SCENE3D&&(re.expand(e._baseVolume,o,e._baseVolume),e._boundingVolumeDirty=!0),zn.fromCartesian(o,XW);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[Za.positionHighAndSize],u=XW.high;c(r,u.x,u.y,u.z,s);let f=n[Za.positionLowAndOutline],d=XW.low;f(r,d.x,d.y,d.z,a)}var j2=65536,hD=256;function tfe(e,t,n,i){let r=i._index,o=i.color,s=i.getPickId(t).color,a=i.outlineColor,c=z.floatToByte(o.red),u=z.floatToByte(o.green),f=z.floatToByte(o.blue),d=c*j2+u*hD+f;c=z.floatToByte(a.red),u=z.floatToByte(a.green),f=z.floatToByte(a.blue);let p=c*j2+u*hD+f;c=z.floatToByte(s.red),u=z.floatToByte(s.green),f=z.floatToByte(s.blue);let g=c*j2+u*hD+f,m=z.floatToByte(o.alpha)*j2+z.floatToByte(a.alpha)*hD+z.floatToByte(s.alpha),x=n[Za.compressedAttribute0];x(r,d,p,g,m)}function nfe(e,t,n,i){let r=i._index,o=0,s=1,a=1,c=1,u=i.translucencyByDistance;l(u)&&(o=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),s=M.clamp(s,0,1),s=s===1?255:s*255|0;let d=(f?1:0)*hD+s;c=M.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[Za.compressedAttribute1];g(r,d,p,o,a)}function ife(e,t,n,i){let r=i._index,o=n[Za.scaleByDistance],s=0,a=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),o(r,s,a,c,u)}function rfe(e,t,n,i){let r=i._index,o=n[Za.distanceDisplayConditionAndDisableDepth],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1)),o(r,s,a,u)}function lJe(e,t,n,i){efe(e,t,n,i),tfe(e,t,n,i),nfe(e,t,n,i),ife(e,t,n,i),rfe(e,t,n,i)}function KW(e,t,n,i,r,o){let s;i.mode===te.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=Js._computeActualPosition(f,i,r);l(d)&&(u._setActualPosition(d),o?a.push(d):re.expand(s,d,s))}o&&re.fromPoints(a,s)}function uJe(e,t){let n=t.mode,i=e._pointPrimitives,r=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==te.SCENE3D&&!N.equals(o,e.modelMatrix)?(e._mode=n,N.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===te.SCENE3D||n===te.SCENE2D||n===te.COLUMBUS_VIEW)&&KW(e,i,i.length,t,o,!0)):n===te.MORPHING?KW(e,i,i.length,t,o,!0):(n===te.SCENE2D||n===te.COLUMBUS_VIEW)&&KW(e,r,e._pointPrimitivesToUpdateIndex,t,o,!1)}function fJe(e,t,n){let r=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=r}var dJe=[];Tf.prototype.update=function(e){if(JW(this),!this.show)return;this._maxTotalPointSize=Bt.maximumAliasedPointSize,uJe(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,r=this._pointPrimitivesToUpdateIndex,o=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,u=e.passes,f=u.pick;if(s||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let w=0;w<ZW;++w)o[w]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=cJe(c,n,this._buffersUsage),a=this._vaf.writers;for(let w=0;w<n;++w){let D=this._pointPrimitives[w];D._dirty=!1,lJe(this,c,a,D)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(r>0){let w=dJe;w.length=0,(o[$W]||o[oJe]||o[sJe])&&w.push(efe),(o[Kue]||o[rJe])&&w.push(tfe),(o[iJe]||o[Zue])&&w.push(nfe),o[$ue]&&w.push(ife),(o[Jue]||o[aJe])&&w.push(rfe);let D=w.length;if(a=this._vaf.writers,r/n>.1){for(let I=0;I<r;++I){let O=i[I];O._dirty=!1;for(let B=0;B<D;++B)w[B](this,c,a,O)}this._vaf.commit()}else{for(let I=0;I<r;++I){let O=i[I];O._dirty=!1;for(let B=0;B<D;++B)w[B](this,c,a,O);this._vaf.subCommit(O._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(r>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,re.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let d,p=N.IDENTITY;e.mode===te.SCENE3D?(p=this.modelMatrix,d=re.clone(this._baseVolumeWC,this._boundingVolume)):d=re.clone(this._baseVolume2D,this._boundingVolume),fJe(this,e,d);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Ir.OPAQUE||this._blendOption===Ir.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:Z.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Ir.TRANSLUCENT||this._blendOption===Ir.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:Z.LEQUAL},depthMask:!1,blending:hn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let m,x;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(m=new Fe({sources:[W2]}),this._shaderScaleByDistance&&m.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&m.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&m.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&m.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Ir.OPAQUE_AND_TRANSLUCENT&&(x=new Fe({defines:["OPAQUE"],sources:[zx]}),this._sp=Wt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:x,attributeLocations:Za}),x=new Fe({defines:["TRANSLUCENT"],sources:[zx]}),this._spTranslucent=Wt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:x,attributeLocations:Za})),this._blendOption===Ir.OPAQUE&&(x=new Fe({sources:[zx]}),this._sp=Wt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:x,attributeLocations:Za})),this._blendOption===Ir.TRANSLUCENT&&(x=new Fe({sources:[zx]}),this._spTranslucent=Wt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:x,attributeLocations:Za})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let C,A,b,T,S=e.commandList;if(u.render||f){let w=this._colorCommands,D=this._blendOption===Ir.OPAQUE,I=this._blendOption===Ir.OPAQUE_AND_TRANSLUCENT;C=this._vaf.va,A=C.length,w.length=A;let O=I?A*2:A;for(T=0;T<O;++T){let B=D||I&&T%2===0;b=w[T],l(b)||(b=w[T]=new Ze),b.primitiveType=Me.POINTS,b.pass=B||!I?Ce.OPAQUE:Ce.TRANSLUCENT,b.owner=this;let L=I?Math.floor(T/2):T;b.boundingVolume=d,b.modelMatrix=p,b.shaderProgram=B?this._sp:this._spTranslucent,b.uniformMap=this._uniforms,b.vertexArray=C[L].va,b.renderState=B?this._rsOpaque:this._rsTranslucent,b.debugShowBoundingVolume=this.debugShowBoundingVolume,b.pickId="v_pickColor",S.push(b)}}};Tf.prototype.isDestroyed=function(){return!1};Tf.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),Que(this._pointPrimitives),ue(this)};var mD=Tf;var pD=Ns(ofe(),1);function Pd(e){e=y(e,y.EMPTY_OBJECT),this._enabled=y(e.enabled,!1),this._pixelRange=y(e.pixelRange,80),this._minimumClusterSize=y(e.minimumClusterSize,2),this._clusterBillboards=y(e.clusterBillboards,!0),this._clusterLabels=y(e.clusterLabels,!0),this._clusterPoints=y(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new ge,this.show=y(e.show,!0)}function hJe(e){return e.coord.x}function mJe(e){return e.coord.y}function sfe(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var pJe=new je;function afe(e,t,n,i,r){if(l(e._labelCollection)&&i._clusterLabels?r=xx.getScreenSpaceBoundingBox(e,t,r):l(e._billboardCollection)&&i._clusterBillboards?r=Tr.getScreenSpaceBoundingBox(e,t,r):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(r=Js.getScreenSpaceBoundingBox(e,t,r)),sfe(r,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&lfe(i,e.id.id)&&l(e.id._label)){let o=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(o),a=xx.getScreenSpaceBoundingBox(s,t,pJe);sfe(a,n),r=je.union(r,a,r)}return r}function _Je(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&lfe(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function cfe(e,t,n,i){let r={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};r.billboard.show=!1,r.point.show=!1,r.label.show=!0,r.label.text=t.toLocaleString(),r.label.id=n,r.billboard.position=r.label.position=r.point.position=e,i._clusterEvent.raiseEvent(n,r)}function lfe(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function t7(e,t,n,i,r){if(!l(e))return;let o=e.length;for(let s=0;s<o;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||r._scene.mode===te.SCENE3D&&!i.isPointVisible(a.position))continue;let c=r._clusterLabels&&l(a._labelCollection),u=r._clusterBillboards&&l(a.id._billboard),f=r._clusterPoints&&l(a.id._point);if(c&&(f||u))continue;let d=a.computeScreenSpacePosition(n);!l(d)||t.push({index:s,collection:e,clustered:!1,coord:d})}}var gJe=new je,yJe=new je,xJe=new je;function CJe(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,r=e._billboardCollection,o=e._pointCollection;if(!l(i)&&!l(r)&&!l(o)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,c=e._clusterPointCollection;l(s)?s.removeAll():s=e._clusterLabelCollection=new Bp({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new uf({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new mD;let u=e._pixelRange,f=e._minimumClusterSize,d=e._previousClusters,p=[],g=e._previousHeight,m=n.camera.positionCartographic.height,x=n.mapProjection.ellipsoid,C=n.camera.positionWC,A=new g_(x,C),b=[];e._clusterLabels&&t7(i,b,n,A,e),e._clusterBillboards&&t7(r,b,n,A,e),e._clusterPoints&&t7(o,b,n,A,e);let T,S,w,D,I,O,B,L,_,E,v,P,R=new pD.default(b,hJe,mJe,64,Int32Array);if(m<g)for(w=d.length,T=0;T<w;++T){let F=d[T];if(!A.isPointVisible(F.position))continue;let U=Tr._computeScreenSpacePosition(N.IDENTITY,F.position,h.ZERO,W.ZERO,n);if(!l(U))continue;let k=1-m/g,H=F.width=F.width*k,V=F.height=F.height*k;H=Math.max(H,F.minimumWidth),V=Math.max(V,F.minimumHeight);let q=U.x-H*.5,j=U.y-V*.5,X=U.x+H,G=U.y+V;for(I=R.range(q,j,X,G),O=I.length,E=0,_=[],S=0;S<O;++S)B=I[S],L=b[B],L.clustered||(++E,v=L.collection,P=L.index,_.push(v.get(P).id));if(E>=f)for(cfe(F.position,E,_,e),p.push(F),S=0;S<O;++S)b[I[S]].clustered=!0}for(w=b.length,T=0;T<w;++T){let F=b[T];if(F.clustered)continue;F.clustered=!0,v=F.collection,P=F.index;let U=v.get(P);D=afe(U,F.coord,u,e,gJe);let k=je.clone(D,yJe);I=R.range(D.x,D.y,D.x+D.width,D.y+D.height),O=I.length;let H=h.clone(U.position);for(E=1,_=[U.id],S=0;S<O;++S)if(B=I[S],L=b[B],!L.clustered){let V=L.collection.get(L.index),q=afe(V,L.coord,u,e,xJe);h.add(V.position,H,H),je.union(k,q,k),++E,_.push(V.id)}if(E>=f){let V=h.multiplyByScalar(H,1/E,H);for(cfe(V,E,_,e),p.push({position:V,width:k.width,height:k.height,minimumWidth:D.width,minimumHeight:D.height}),S=0;S<O;++S)b[I[S]].clustered=!0}else _Je(U,e)}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=m}}Pd.prototype._initialize=function(e){this._scene=e;let t=CJe(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(Pd.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}});function i7(e,t,n,i){return function(r){let o=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[r.id];if(l(s)||(s=this._collectionIndicesByEntity[r.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(o)&&l(s[i]))return o.get(s[i]);l(o)||(o=this[e]=new t({scene:this._scene}));let a,c,u=this[n];u.length>0?(a=u.pop(),c=o.get(a)):(c=o.add(),a=o.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function r7(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Pd.prototype.getLabel=i7("_labelCollection",Bp,"_unusedLabelIndices","labelIndex");Pd.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,r7(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};Pd.prototype.getBillboard=i7("_billboardCollection",uf,"_unusedBillboardIndices","billboardIndex");Pd.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,r7(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};Pd.prototype.getPoint=i7("_pointCollection",mD,"_unusedPointIndices","pointIndex");Pd.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,r7(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function n7(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function AJe(e){e.enabled||(l(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),l(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),l(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,n7(e._labelCollection),n7(e._billboardCollection),n7(e._pointCollection))}Pd.prototype.update=function(e){if(!this.show)return;let t;l(this._labelCollection)&&this._labelCollection.length>0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),l(this._billboardCollection)&&this._billboardCollection.length>0&&!l(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,AJe(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(this._labelCollection)&&this._labelCollection.update(e),l(this._billboardCollection)&&this._billboardCollection.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};Pd.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var bf=Pd;function o7(e){this._name=e,this._clock=void 0,this._changed=new ge,this._error=new ge,this._isLoading=!1,this._loading=new ge,this._entityCollection=new Zs(this),this._entityCluster=new bf}Object.defineProperties(o7.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){Jo.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});o7.prototype.update=function(e){return!0};var q2=o7;var ufe=h.ZERO,ffe=new h,TJe=new h,dfe=new z;function bJe(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function lu(e,t){ci.call(this,{entity:e,scene:t,geometryOptions:new bJe(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(lu.prototype=Object.create(ci.prototype),lu.prototype.constructor=lu);Object.defineProperties(lu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});lu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=kn.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o,color:void 0,offset:void 0};if(this._materialProperty instanceof Dt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,dfe)),l(a)||(a=z.WHITE),s.color=Ot.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=nr.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,ufe,ffe))),new pt({id:t,geometry:new $I(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.mapProjection.ellipsoid),attributes:s})};lu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,dfe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ot.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=nr.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,ufe,ffe))),new pt({id:t,geometry:new ZI(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.mapProjection.ellipsoid),attributes:o})};lu.prototype._computeCenter=function(e,t){return Y.getValueOrUndefined(this._entity.position,e,t)};lu.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||ci.prototype._isHidden.call(this,e,t)};lu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!Y.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!Y.isConstant(t.slices)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.numberOfVerticalLines)};lu.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrDefault(t.heightReference,ke.MINIMUM_VALUE,ze.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Dt?rn.VERTEX_FORMAT:lr.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(ke.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(ke.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(ke.MINIMUM_VALUE),i.slices=Y.getValueOrUndefined(t.slices,ke.MINIMUM_VALUE),i.numberOfVerticalLines=Y.getValueOrUndefined(t.numberOfVerticalLines,ke.MINIMUM_VALUE),i.offsetAttribute=n!==ze.NONE?nn.ALL:void 0};lu.prototype._onEntityPropertyChanged=gg;lu.DynamicGeometryUpdater=Rb;function Rb(e,t,n){ai.call(this,e,t,n)}l(Object.create)&&(Rb.prototype=Object.create(ai.prototype),Rb.prototype.constructor=Rb);Rb.prototype._isHidden=function(e,t,n){let i=this._options,r=Y.getValueOrUndefined(e.position,n,TJe);return!l(r)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||ai.prototype._isHidden.call(this,e,t,n)};Rb.prototype._setOptions=function(e,t,n){let i=Y.getValueOrDefault(t.heightReference,n,ze.NONE),r=this._options;r.length=Y.getValueOrUndefined(t.length,n),r.topRadius=Y.getValueOrUndefined(t.topRadius,n),r.bottomRadius=Y.getValueOrUndefined(t.bottomRadius,n),r.slices=Y.getValueOrUndefined(t.slices,n),r.numberOfVerticalLines=Y.getValueOrUndefined(t.numberOfVerticalLines,n),r.offsetAttribute=i!==ze.NONE?nn.ALL:void 0};var Y2=lu;function Hx(){this._definitionChanged=new ge,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(Hx.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:jl("startTime"),stopTime:jl("stopTime"),currentTime:jl("currentTime"),clockRange:jl("clockRange"),clockStep:jl("clockStep"),multiplier:jl("multiplier")});Hx.prototype.clone=function(e){return l(e)||(e=new Hx),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e};Hx.prototype.equals=function(e){return this===e||l(e)&&ee.equals(this.startTime,e.startTime)&&ee.equals(this.stopTime,e.stopTime)&&ee.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};Hx.prototype.merge=function(e){this.startTime=y(this.startTime,e.startTime),this.stopTime=y(this.stopTime,e.stopTime),this.currentTime=y(this.currentTime,e.currentTime),this.clockRange=y(this.clockRange,e.clockRange),this.clockStep=y(this.clockStep,e.clockStep),this.multiplier=y(this.multiplier,e.multiplier)};Hx.prototype.getValue=function(e){return l(e)||(e=new Sh),e.startTime=y(this.startTime,e.startTime),e.stopTime=y(this.stopTime,e.stopTime),e.currentTime=y(this.currentTime,e.currentTime),e.clockRange=y(this.clockRange,e.clockRange),e.multiplier=y(this.multiplier,e.multiplier),e.clockStep=y(this.clockStep,e.clockStep),e};var fm=Hx;var EJe=z.WHITE,SJe=.1,wJe=new W(8,8),vJe=new W(0,0),DJe=new W(1,1);function Mb(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new ge,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}Object.defineProperties(Mb.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)&&Y.isConstant(this._cellAlpha)&&Y.isConstant(this._lineCount)&&Y.isConstant(this._lineThickness)&&Y.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),cellAlpha:le("cellAlpha"),lineCount:le("lineCount"),lineThickness:le("lineThickness"),lineOffset:le("lineOffset")});Mb.prototype.getType=function(e){return"Grid"};Mb.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,EJe,t.color),t.cellAlpha=Y.getValueOrDefault(this._cellAlpha,e,SJe),t.lineCount=Y.getValueOrClonedDefault(this._lineCount,e,wJe,t.lineCount),t.lineThickness=Y.getValueOrClonedDefault(this._lineThickness,e,DJe,t.lineThickness),t.lineOffset=Y.getValueOrClonedDefault(this._lineOffset,e,vJe,t.lineOffset),t};Mb.prototype.equals=function(e){return this===e||e instanceof Mb&&Y.equals(this._color,e._color)&&Y.equals(this._cellAlpha,e._cellAlpha)&&Y.equals(this._lineCount,e._lineCount)&&Y.equals(this._lineThickness,e._lineThickness)&&Y.equals(this._lineOffset,e._lineOffset)};var _D=Mb;function Bb(e){this._definitionChanged=new ge,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(Bb.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});Bb.prototype.getType=function(e){return"PolylineArrow"};Bb.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};Bb.prototype.equals=function(e){return this===e||e instanceof Bb&&Y.equals(this._color,e._color)};var gD=Bb;var PJe=z.WHITE,IJe=z.TRANSPARENT,OJe=16,RJe=255;function Lb(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new ge,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(Lb.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)&&Y.isConstant(this._gapColor)&&Y.isConstant(this._dashLength)&&Y.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),gapColor:le("gapColor"),dashLength:le("dashLength"),dashPattern:le("dashPattern")});Lb.prototype.getType=function(e){return"PolylineDash"};Lb.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,PJe,t.color),t.gapColor=Y.getValueOrClonedDefault(this._gapColor,e,IJe,t.gapColor),t.dashLength=Y.getValueOrDefault(this._dashLength,e,OJe,t.dashLength),t.dashPattern=Y.getValueOrDefault(this._dashPattern,e,RJe,t.dashPattern),t};Lb.prototype.equals=function(e){return this===e||e instanceof Lb&&Y.equals(this._color,e._color)&&Y.equals(this._gapColor,e._gapColor)&&Y.equals(this._dashLength,e._dashLength)&&Y.equals(this._dashPattern,e._dashPattern)};var yD=Lb;var MJe=z.WHITE,BJe=.25,LJe=1;function Nb(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new ge,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(Nb.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)&&Y.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),glowPower:le("glowPower"),taperPower:le("taperPower")});Nb.prototype.getType=function(e){return"PolylineGlow"};Nb.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,MJe,t.color),t.glowPower=Y.getValueOrDefault(this._glowPower,e,BJe,t.glowPower),t.taperPower=Y.getValueOrDefault(this._taperPower,e,LJe,t.taperPower),t};Nb.prototype.equals=function(e){return this===e||e instanceof Nb&&Y.equals(this._color,e._color)&&Y.equals(this._glowPower,e._glowPower)&&Y.equals(this._taperPower,e._taperPower)};var xD=Nb;var NJe=z.WHITE,FJe=z.BLACK,VJe=1;function Fb(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new ge,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties(Fb.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)&&Y.isConstant(this._outlineColor)&&Y.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth")});Fb.prototype.getType=function(e){return"PolylineOutline"};Fb.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,NJe,t.color),t.outlineColor=Y.getValueOrClonedDefault(this._outlineColor,e,FJe,t.outlineColor),t.outlineWidth=Y.getValueOrDefault(this._outlineWidth,e,VJe),t};Fb.prototype.equals=function(e){return this===e||e instanceof Fb&&Y.equals(this._color,e._color)&&Y.equals(this._outlineColor,e._outlineColor)&&Y.equals(this._outlineWidth,e._outlineWidth)};var Gx=Fb;function $p(e,t){this._value=void 0,this._definitionChanged=new ge,this._eventHelper=new Yo,this._referenceFrame=y(t,sr.FIXED),this.setValue(e)}Object.defineProperties($p.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!Y.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});$p.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,sr.FIXED,t)};$p.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let r=i.length;l(n)||(n=new Array(r));let o=0,s=0;for(;o<r;){let c=i[o].getValueInReferenceFrame(e,t,n[o]);l(c)&&(n[s]=c,s++),o++}return n.length=s,n};$p.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let r=e[i];l(r)&&t.add(r.definitionChanged,$p.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};$p.prototype.equals=function(e){return this===e||e instanceof $p&&this._referenceFrame===e._referenceFrame&&Y.arrayEquals(this._value,e._value)};$p.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var i0=$p;function r0(e){this._value=void 0,this._definitionChanged=new ge,this._eventHelper=new Yo,this.setValue(e)}Object.defineProperties(r0.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!Y.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});r0.prototype.getValue=function(e,t){let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let r=0,o=0;for(;r<i;){let a=this._value[r].getValue(e,t[r]);l(a)&&(t[o]=a,o++),r++}return t.length=o,t};r0.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let r=e[i];l(r)&&t.add(r.definitionChanged,r0.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};r0.prototype.equals=function(e){return this===e||e instanceof r0&&Y.arrayEquals(this._value,e._value)};r0.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var CD=r0;function Wx(e){let t=e._targetProperty;if(!l(t)){let n=e._targetEntity;if(!l(n)){if(n=e._targetCollection.getById(e._targetId),!l(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(uu.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let r=0,o=i.length;r<o&&l(t);++r)t=t[i[r]];e._targetProperty=t}return t}function uu(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new ge,e.collectionChanged.addEventListener(uu.prototype._onCollectionChanged,this)}Object.defineProperties(uu.prototype,{isConstant:{get:function(){return Y.isConstant(Wx(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=Wx(this);return l(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return Wx(this)}}});uu.fromString=function(e,t){let n,i=[],r=!0,o=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);o?(s+=c,o=!1):c==="\\"?o=!0:r&&c==="#"?(n=s,r=!1,s=""):!r&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new uu(e,n,i)};uu.prototype.getValue=function(e,t){let n=Wx(this);return l(n)?n.getValue(e,t):void 0};uu.prototype.getValueInReferenceFrame=function(e,t,n){let i=Wx(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};uu.prototype.getType=function(e){let t=Wx(this);return l(t)?t.getType(e):void 0};uu.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let r=0;r<i;r++)if(t[r]!==n[r])return!1;return!0};uu.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};uu.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(uu.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=Wx(this),l(i)&&this._definitionChanged.raiseEvent(this))};var o0=uu;var kJe={packedLength:1,pack:function(e,t,n){return n=y(n,0),t[n]=e,t},unpack:function(e,t,n){return t=y(t,0),e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=y(t,0),n=y(n,e.length);let r;for(let o=0,s=n-t+1;o<s;o++){let a=e[t+o];o===0||Math.abs(r-a)<Math.PI?i[o]=a:i[o]=a-M.TWO_PI,r=a}},unpackInterpolationResult:function(e,t,n,i,r){return r=e[0],r<0?r+M.TWO_PI:r}},Id=kJe;var hfe={packedLength:1,pack:function(e,t,n){n=y(n,0),t[n]=e},unpack:function(e,t,n){return t=y(t,0),e[t]}};function mfe(e,t,n){let i,r=e.length,o=n.length,s=r+o;if(e.length=s,r!==t){let a=r-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<o;i++)e[t++]=n[i]}function pfe(e,t){return e instanceof ee?e:typeof e=="string"?ee.fromIso8601(e):ee.addSeconds(t,e,new ee)}var s7=[],a7=[];function X2(e,t,n,i,r){let o=0,s,a,c,u,f,d;for(;o<i.length;){f=pfe(i[o],e),c=ao(t,f,ee.compare);let p=0,g=0;if(c<0){for(c=~c,u=c*r,a=void 0,d=t[c];o<i.length&&(f=pfe(i[o],e),!(l(a)&&ee.compare(a,f)>=0||l(d)&&ee.compare(f,d)>=0));){for(s7[p++]=f,o=o+1,s=0;s<r;s++)a7[g++]=i[o],o=o+1;a=f}p>0&&(a7.length=g,mfe(n,u,a7),s7.length=p,mfe(t,c,s7))}else{for(s=0;s<r;s++)o++,n[c*r+s]=i[o];o++}}}function Od(e,t){let n=e;n===Number&&(n=hfe);let i=n.packedLength,r=y(n.packedInterpolationLength,i),o=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let u=t[c];u===Number&&(u=hfe);let f=u.packedLength;i+=f,r+=y(u.packedInterpolationLength,f),s[c]=u}o=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=XA,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=r,this._updateTableLength=!0,this._interpolationResult=new Array(r),this._definitionChanged=new ge,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=o,this._forwardExtrapolationType=Hu.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=Hu.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(Od.prototype,{isConstant:{get:function(){return this._values.length===0}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}});Od.prototype.getValue=function(e,t){let n=this._times,i=n.length;if(i===0)return;let r,o=this._innerType,s=this._values,a=ao(n,e,ee.compare);if(a<0){if(a=~a,a===0){let S=n[a];if(r=this._backwardExtrapolationDuration,this._backwardExtrapolationType===Hu.NONE||r!==0&&ee.secondsDifference(S,e)>r)return;if(this._backwardExtrapolationType===Hu.HOLD)return o.unpack(s,0,t)}if(a>=i){a=i-1;let S=n[a];if(r=this._forwardExtrapolationDuration,this._forwardExtrapolationType===Hu.NONE||r!==0&&ee.secondsDifference(e,S)>r)return;if(this._forwardExtrapolationType===Hu.HOLD)return a=i-1,o.unpack(s,a*o.packedLength,t)}let c=this._xTable,u=this._yTable,f=this._interpolationAlgorithm,d=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let S=Math.min(f.getRequiredDataPoints(this._interpolationDegree,p),i);S!==this._numberOfPoints&&(this._numberOfPoints=S,c.length=S,u.length=S*d)}let g=this._numberOfPoints-1;if(g<1)return;let m=0,x=i-1;if(x-m+1>=g+1){let S=a-(g/2|0)-1;S<m&&(S=m);let w=S+g;w>x&&(w=x,S=w-g,S<m&&(S=m)),m=S,x=w}let A=x-m+1;for(let S=0;S<A;++S)c[S]=ee.secondsDifference(n[m+S],n[x]);if(l(o.convertPackedArrayForInterpolation))o.convertPackedArrayForInterpolation(s,m,x,u);else{let S=0,w=this._packedLength,D=m*w,I=(x+1)*w;for(;D<I;)u[S]=s[D],D++,S++}let b=ee.secondsDifference(e,n[x]),T;if(p===0||!l(f.interpolate))T=f.interpolateOrderZero(b,c,u,d,this._interpolationResult);else{let S=Math.floor(d/(p+1));T=f.interpolate(b,c,u,S,p,p,this._interpolationResult)}return l(o.unpackInterpolationResult)?o.unpackInterpolationResult(T,s,m,x,t):o.unpack(T,0,t)}return o.unpack(s,a*this._packedLength,t)};Od.prototype.setInterpolationOptions=function(e){if(!l(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;l(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),l(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};Od.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,r=l(i),o=this._innerType,s=[];if(s.push(e),o.pack(t,s,s.length),r){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}X2(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Od.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,r=l(i),o=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),o.pack(t[c],a,a.length),r){let u=n[c],f=i.length;for(let d=0;d<f;d++)i[d].pack(u[d],a,a.length)}X2(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Od.prototype.addSamplesPackedArray=function(e,t){X2(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Od.prototype.removeSample=function(e){let t=ao(this._times,e,ee.compare);return t<0?!1:(_fe(this,t,1),!0)};function _fe(e,t,n){let i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}Od.prototype.removeSamples=function(e){let t=this._times,n=ao(t,e.start,ee.compare);n<0?n=~n:e.isStartIncluded||++n;let i=ao(t,e.stop,ee.compare);i<0?i=~i:e.isStopIncluded&&++i,_fe(this,n,i-n)};Od.prototype.equals=function(e){if(this===e)return!0;if(!l(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=l(t),i=e._derivativeTypes,r=l(i);if(n!==r)return!1;let o,s;if(n){if(s=t.length,s!==i.length)return!1;for(o=0;o<s;o++)if(t[o]!==i[o])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(o=0;o<s;o++)if(!ee.equals(a[o],c[o]))return!1;let u=this._values,f=e._values;for(s=u.length,o=0;o<s;o++)if(u[o]!==f[o])return!1;return!0};Od._mergeNewSamples=X2;var Ef=Od;function Sf(e,t){t=y(t,0);let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=h}this._numberOfDerivatives=t,this._property=new Ef(h,n),this._definitionChanged=new ge,this._referenceFrame=y(e,sr.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(Sf.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}});Sf.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,sr.FIXED,t)};Sf.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return hg.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};Sf.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};Sf.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};Sf.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};Sf.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};Sf.prototype.removeSample=function(e){return this._property.removeSample(e)};Sf.prototype.removeSamples=function(e){this._property.removeSamples(e)};Sf.prototype.equals=function(e){return this===e||e instanceof Sf&&Y.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var ba=Sf;var UJe={HORIZONTAL:0,VERTICAL:1},dm=Object.freeze(UJe);var zJe=dm.HORIZONTAL,HJe=z.WHITE,GJe=z.BLACK,WJe=0,jJe=1;function Vb(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new ge,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}Object.defineProperties(Vb.prototype,{isConstant:{get:function(){return Y.isConstant(this._orientation)&&Y.isConstant(this._evenColor)&&Y.isConstant(this._oddColor)&&Y.isConstant(this._offset)&&Y.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:le("orientation"),evenColor:le("evenColor"),oddColor:le("oddColor"),offset:le("offset"),repeat:le("repeat")});Vb.prototype.getType=function(e){return"Stripe"};Vb.prototype.getValue=function(e,t){return l(t)||(t={}),t.horizontal=Y.getValueOrDefault(this._orientation,e,zJe)===dm.HORIZONTAL,t.evenColor=Y.getValueOrClonedDefault(this._evenColor,e,HJe,t.evenColor),t.oddColor=Y.getValueOrClonedDefault(this._oddColor,e,GJe,t.oddColor),t.offset=Y.getValueOrDefault(this._offset,e,WJe),t.repeat=Y.getValueOrDefault(this._repeat,e,jJe),t};Vb.prototype.equals=function(e){return this===e||e instanceof Vb&&Y.equals(this._orientation,e._orientation)&&Y.equals(this._evenColor,e._evenColor)&&Y.equals(this._oddColor,e._oddColor)&&Y.equals(this._offset,e._offset)&&Y.equals(this._repeat,e._repeat)};var AD=Vb;function s0(e){this._definitionChanged=new ge,this._intervals=new $o,this._intervals.changedEvent.addEventListener(s0.prototype._intervalsChanged,this),this._referenceFrame=y(e,sr.FIXED)}Object.defineProperties(s0.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}});s0.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,sr.FIXED,t)};s0.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return hg.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};s0.prototype.equals=function(e){return this===e||e instanceof s0&&this._intervals.equals(e._intervals,Y.equals)&&this._referenceFrame===e._referenceFrame};s0.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var a0=s0;function jx(){this._definitionChanged=new ge,this._intervals=new $o,this._intervals.changedEvent.addEventListener(jx.prototype._intervalsChanged,this)}Object.defineProperties(jx.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});jx.prototype.getValue=function(e,t){let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};jx.prototype.equals=function(e){return this===e||e instanceof jx&&this._intervals.equals(e._intervals,Y.equals)};jx.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var c0=jx;function kb(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new ge,this._normalize=y(t,!0),this.position=e}Object.defineProperties(kb.prototype,{isConstant:{get:function(){return Y.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(l(t)&&this._subscription(),this._position=e,l(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var qJe=new h,gfe=new h,yfe=new ee,c7=1/60;kb.prototype.getValue=function(e,t){return this._getValue(e,t)};kb.prototype._getValue=function(e,t,n){l(t)||(t=new h);let i=this._position;if(Y.isConstant(i))return this._normalize?void 0:h.clone(h.ZERO,t);let r=i.getValue(e,qJe),o=i.getValue(ee.addSeconds(e,c7,yfe),gfe);if(!l(r)||!l(o)&&(o=r,r=i.getValue(ee.addSeconds(e,-c7,yfe),gfe),!l(r)))return;if(h.equals(r,o))return this._normalize?void 0:h.clone(h.ZERO,t);l(n)&&r.clone(n);let s=h.subtract(o,r,t);return this._normalize?h.normalize(s,t):h.divideByScalar(s,c7,t)};kb.prototype.equals=function(e){return this===e||e instanceof kb&&Y.equals(this._position,e._position)};var Ub=kb;function TD(e,t){this._velocityVectorProperty=new Ub(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new ge,this.ellipsoid=y(t,oe.WGS84);let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(TD.prototype,{isConstant:{get:function(){return Y.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var xfe=new h,YJe=new h,Cfe=new Q;TD.prototype.getValue=function(e,t){let n=this._velocityVectorProperty._getValue(e,YJe,xfe);if(!!l(n))return yt.rotationMatrixFromPositionVelocity(xfe,n,this._ellipsoid,Cfe),Re.fromRotationMatrix(Cfe,t)};TD.prototype.equals=function(e){return this===e||e instanceof TD&&Y.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var K2=TD;function l0(){}l0.packedLength=h.packedLength;l0.unpack=h.unpack;l0.pack=h.pack;var l7;function bD(e,t){return t[0]==="#"&&(t=l7+t),o0.fromString(e,t)}function Afe(e,t,n){if(l(n.reference))return bD(t,n.reference);if(l(n.velocityReference)){let i=bD(t,n.velocityReference);switch(e){case h:case l0:return new Ub(i,e===l0);case Re:return new K2(i)}}throw new fe(`${JSON.stringify(n)} is not valid CZML.`)}function XJe(e,t){return new qh(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var Vi=new h,Fc=new $O,Ja=new me,qx=new Cn,$2=new Re;function KJe(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===z.packedLength)return[z.byteToFloat(n[0]),z.byteToFloat(n[1]),z.byteToFloat(n[2]),z.byteToFloat(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=z.byteToFloat(n[r+1]),t[r+2]=z.byteToFloat(n[r+2]),t[r+3]=z.byteToFloat(n[r+3]),t[r+4]=z.byteToFloat(n[r+4]);return t}function Tfe(e,t){let n=y(e.uri,e);return l(t)?t.getDerivedResource({url:n}):De.createIfNeeded(n)}function $Je(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===he.packedLength)return[M.toRadians(n[0]),M.toRadians(n[1]),M.toRadians(n[2]),M.toRadians(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=M.toRadians(n[r+1]),t[r+2]=M.toRadians(n[r+2]),t[r+3]=M.toRadians(n[r+3]),t[r+4]=M.toRadians(n[r+4]);return t}function ZJe(e){let t=e.length;if(Fc.magnitude=1,t===2)return Fc.clock=e[0],Fc.cone=e[1],h.fromSpherical(Fc,Vi),[Vi.x,Vi.y,Vi.z];let n=new Array(t/3*4);for(let i=0,r=0;i<t;i+=3,r+=4)n[r]=e[i],Fc.clock=e[i+1],Fc.cone=e[i+2],h.fromSpherical(Fc,Vi),n[r+1]=Vi.x,n[r+2]=Vi.y,n[r+3]=Vi.z;return n}function JJe(e){let t=e.length;if(t===3)return Fc.clock=e[0],Fc.cone=e[1],Fc.magnitude=e[2],h.fromSpherical(Fc,Vi),[Vi.x,Vi.y,Vi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Fc.clock=e[i+1],Fc.cone=e[i+2],Fc.magnitude=e[i+3],h.fromSpherical(Fc,Vi),n[i+1]=Vi.x,n[i+2]=Vi.y,n[i+3]=Vi.z;return n}function QJe(e){let t=e.length;if(t===3)return Ja.longitude=e[0],Ja.latitude=e[1],Ja.height=e[2],oe.WGS84.cartographicToCartesian(Ja,Vi),[Vi.x,Vi.y,Vi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Ja.longitude=e[i+1],Ja.latitude=e[i+2],Ja.height=e[i+3],oe.WGS84.cartographicToCartesian(Ja,Vi),n[i+1]=Vi.x,n[i+2]=Vi.y,n[i+3]=Vi.z;return n}function eQe(e){let t=e.length;if(t===3)return Ja.longitude=M.toRadians(e[0]),Ja.latitude=M.toRadians(e[1]),Ja.height=e[2],oe.WGS84.cartographicToCartesian(Ja,Vi),[Vi.x,Vi.y,Vi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Ja.longitude=M.toRadians(e[i+1]),Ja.latitude=M.toRadians(e[i+2]),Ja.height=e[i+3],oe.WGS84.cartographicToCartesian(Ja,Vi),n[i+1]=Vi.x,n[i+2]=Vi.y,n[i+3]=Vi.z;return n}function u7(e){let t=e.cartesian;if(l(t))return t;let n=e.cartesianVelocity;if(l(n))return n;let i=e.unitCartesian;if(l(i))return i;let r=e.unitSpherical;if(l(r))return ZJe(r);let o=e.spherical;if(l(o))return JJe(o);let s=e.cartographicRadians;if(l(s))return QJe(s);let a=e.cartographicDegrees;if(l(a))return eQe(a);throw new fe(`${JSON.stringify(e)} is not a valid CZML interval.`)}function bfe(e,t){h.unpack(e,t,Vi),h.normalize(Vi,Vi),h.pack(Vi,e,t)}function tQe(e){let t=u7(e);if(t.length===3)return bfe(t,0),t;for(let n=1;n<t.length;n+=4)bfe(t,n);return t}function Efe(e,t){Re.unpack(e,t,$2),Re.normalize($2,$2),Re.pack($2,e,t)}function nQe(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return Efe(t,0),t;for(let n=1;n<t.length;n+=5)Efe(t,n)}return t}function Sfe(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?je:e.hasOwnProperty("cartesian2")?W:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?h:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?l0:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?z:e.hasOwnProperty("arcType")?Kt:e.hasOwnProperty("classificationType")?qn:e.hasOwnProperty("colorBlendMode")?Ds:e.hasOwnProperty("cornerType")?Li:e.hasOwnProperty("heightReference")?ze:e.hasOwnProperty("horizontalOrigin")?gi:e.hasOwnProperty("date")?ee:e.hasOwnProperty("labelStyle")?$r:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?St:e.hasOwnProperty("distanceDisplayCondition")?Tt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Re:e.hasOwnProperty("shadowMode")?Zt:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?dm:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?he:e.hasOwnProperty("uri")?oi.default:e.hasOwnProperty("verticalOrigin")?vn:Object}function iQe(e,t,n){switch(e){case Kt:return Kt[y(t.arcType,t)];case Array:return t.array;case Boolean:return y(t.boolean,t);case je:return t.boundingRectangle;case W:return t.cartesian2;case h:return u7(t);case l0:return tQe(t);case z:return KJe(t);case qn:return qn[y(t.classificationType,t)];case Ds:return Ds[y(t.colorBlendMode,t)];case Li:return Li[y(t.cornerType,t)];case ze:return ze[y(t.heightReference,t)];case gi:return gi[y(t.horizontalOrigin,t)];case Image:return Tfe(t,n);case ee:return ee.fromIso8601(y(t.date,t));case $r:return $r[y(t.labelStyle,t)];case Number:return y(t.number,t);case St:return t.nearFarScalar;case Tt:return t.distanceDisplayCondition;case Object:return y(y(t.object,t.value),t);case Re:return nQe(t);case Id:return y(t.number,t);case Zt:return Zt[y(y(t.shadowMode,t.shadows),t)];case String:return y(t.string,t);case dm:return dm[y(t.stripeOrientation,t)];case he:return $Je(t);case oi.default:return Tfe(t,n);case vn:return vn[y(t.verticalOrigin,t)];default:throw new fe(e)}}var rQe={HERMITE:pO,LAGRANGE:TO,LINEAR:XA};function Z2(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:rQe[n],interpolationDegree:i});let r=e.forwardExtrapolationType;l(r)&&(t.forwardExtrapolationType=Hu[r]);let o=e.forwardExtrapolationDuration;l(o)&&(t.forwardExtrapolationDuration=o);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=Hu[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var wfe={iso8601:void 0};function po(e){if(!!l(e))return wfe.iso8601=e,Cn.fromIso8601(wfe)}function f7(e){let t=ke.MAXIMUM_INTERVAL.clone();return t.data=e,t}function vfe(e){let t=new Lc;return t.intervals.addInterval(f7(e)),t}function Dfe(e){let t=new Ta(e.referenceFrame);return t.intervals.addInterval(f7(e)),t}function J2(e,t,n,i,r,o,s){let a=po(i.interval);l(r)&&(l(a)?a=Cn.intersect(a,r,qx):a=r);let c,u,f,d=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(ke.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return kfe(t[n],a)}let g=!1;if(d){if(u=iQe(e,i,o),!l(u))return;c=y(e.packedLength,1),f=y(u.length,1),g=!l(i.array)&&typeof u!="string"&&f>c&&e!==Object}let m=typeof e.unpack=="function"&&e!==Id;if(!g&&!p){d?t[n]=new Jn(m?e.unpack(u,0):u):t[n]=Afe(e,s,i);return}let x=t[n],C,A=i.epoch;if(l(A)&&(C=ee.fromIso8601(A)),g&&!p){x instanceof Ef||(t[n]=x=new Ef(e)),x.addSamplesPackedArray(u,C),Z2(i,x);return}let b;if(!g&&p){a=a.clone(),d?a.data=m?e.unpack(u,0):u:a.data=Afe(e,s,i),l(x)||(t[n]=x=d?new c0:new Lc),d&&x instanceof c0?x.intervals.addInterval(a):x instanceof Lc?(d&&(a.data=new Jn(a.data)),x.intervals.addInterval(a)):(t[n]=x=vfe(x),d&&(a.data=new Jn(a.data)),x.intervals.addInterval(a));return}l(x)||(t[n]=x=new Lc),x instanceof Lc||(t[n]=x=vfe(x));let T=x.intervals;b=T.findInterval(a),(!l(b)||!(b.data instanceof Ef))&&(b=a.clone(),b.data=new Ef(e),T.addInterval(b)),b.data.addSamplesPackedArray(u,C),Z2(i,b.data)}function kfe(e,t){if(e instanceof Ef){e.removeSamples(t);return}else if(e instanceof c0){e.intervals.removeInterval(t);return}else if(e instanceof Lc){let n=e.intervals;for(let i=0;i<n.length;++i){let r=Cn.intersect(n.get(i),t,qx);r.isEmpty||kfe(r.data,t)}n.removeInterval(t);return}}function pe(e,t,n,i,r,o,s){if(!!l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)J2(e,t,n,i[a],r,o,s);else J2(e,t,n,i,r,o,s)}function Pfe(e,t,n,i,r,o){let s=po(n.interval);l(i)&&(l(s)?s=Cn.intersect(s,i,qx):s=i);let a=l(n.cartesianVelocity)?1:0,c=h.packedLength*(a+1),u,f,d=!l(n.reference),p=l(s)&&!s.equals(ke.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return Ufe(e[t],s)}let g,m=!1;if(d&&(l(n.referenceFrame)&&(g=sr[n.referenceFrame]),g=y(g,sr.FIXED),u=u7(n),f=y(u.length,1),m=f>c),!m&&!p){d?e[t]=new hl(h.unpack(u),g):e[t]=bD(o,n.reference);return}let x=e[t],C,A=n.epoch;if(l(A)&&(C=ee.fromIso8601(A)),m&&!p){(!(x instanceof ba)||l(g)&&x.referenceFrame!==g)&&(e[t]=x=new ba(g,a)),x.addSamplesPackedArray(u,C),Z2(n,x);return}let b;if(!m&&p){s=s.clone(),d?s.data=h.unpack(u):s.data=bD(o,n.reference),l(x)||(d?x=new a0(g):x=new Ta(g),e[t]=x),d&&x instanceof a0&&l(g)&&x.referenceFrame===g?x.intervals.addInterval(s):x instanceof Ta?(d&&(s.data=new hl(s.data,g)),x.intervals.addInterval(s)):(e[t]=x=Dfe(x),d&&(s.data=new hl(s.data,g)),x.intervals.addInterval(s));return}l(x)?x instanceof Ta||(e[t]=x=Dfe(x)):e[t]=x=new Ta(g);let T=x.intervals;b=T.findInterval(s),(!l(b)||!(b.data instanceof ba)||l(g)&&b.data.referenceFrame!==g)&&(b=s.clone(),b.data=new ba(g,a),T.addInterval(b)),b.data.addSamplesPackedArray(u,C),Z2(n,b.data)}function Ufe(e,t){if(e instanceof ba){e.removeSamples(t);return}else if(e instanceof a0){e.intervals.removeInterval(t);return}else if(e instanceof Ta){let n=e.intervals;for(let i=0;i<n.length;++i){let r=Cn.intersect(n.get(i),t,qx);r.isEmpty||Ufe(r.data,t)}n.removeInterval(t);return}}function zfe(e,t,n,i,r,o){if(!!l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Pfe(e,t,n[s],i,r,o);else Pfe(e,t,n,i,r,o)}function Ife(e,t,n,i){l(n.references)?Q2(e,t,n.references,n.interval,i,CD,Lc):(l(n.cartesian2)?n.array=W.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=W.unpackArray(n.cartesian)),l(n.array)&&pe(Array,e,t,n,void 0,void 0,i))}function Ofe(e,t,n,i,r,o){let s=po(n.interval);l(i)&&(l(s)?s=Cn.intersect(s,i,qx):s=i);let a=e[t],c,u;if(l(s)){a instanceof dD||(a=new dD,e[t]=a);let d=a.intervals;u=d.findInterval({start:s.start,stop:s.stop}),l(u)?c=u.data:(u=s.clone(),d.addInterval(u))}else c=a;let f;l(n.solidColor)?(c instanceof Dt||(c=new Dt),f=n.solidColor,pe(z,c,"color",f.color,void 0,void 0,o)):l(n.grid)?(c instanceof _D||(c=new _D),f=n.grid,pe(z,c,"color",f.color,void 0,r,o),pe(Number,c,"cellAlpha",f.cellAlpha,void 0,r,o),pe(W,c,"lineCount",f.lineCount,void 0,r,o),pe(W,c,"lineThickness",f.lineThickness,void 0,r,o),pe(W,c,"lineOffset",f.lineOffset,void 0,r,o)):l(n.image)?(c instanceof nx||(c=new nx),f=n.image,pe(Image,c,"image",f.image,void 0,r,o),pe(W,c,"repeat",f.repeat,void 0,r,o),pe(z,c,"color",f.color,void 0,r,o),pe(Boolean,c,"transparent",f.transparent,void 0,r,o)):l(n.stripe)?(c instanceof AD||(c=new AD),f=n.stripe,pe(dm,c,"orientation",f.orientation,void 0,r,o),pe(z,c,"evenColor",f.evenColor,void 0,r,o),pe(z,c,"oddColor",f.oddColor,void 0,r,o),pe(Number,c,"offset",f.offset,void 0,r,o),pe(Number,c,"repeat",f.repeat,void 0,r,o)):l(n.polylineOutline)?(c instanceof Gx||(c=new Gx),f=n.polylineOutline,pe(z,c,"color",f.color,void 0,r,o),pe(z,c,"outlineColor",f.outlineColor,void 0,r,o),pe(Number,c,"outlineWidth",f.outlineWidth,void 0,r,o)):l(n.polylineGlow)?(c instanceof xD||(c=new xD),f=n.polylineGlow,pe(z,c,"color",f.color,void 0,r,o),pe(Number,c,"glowPower",f.glowPower,void 0,r,o),pe(Number,c,"taperPower",f.taperPower,void 0,r,o)):l(n.polylineArrow)?(c instanceof gD||(c=new gD),f=n.polylineArrow,pe(z,c,"color",f.color,void 0,void 0,o)):l(n.polylineDash)?(c instanceof yD||(c=new yD),f=n.polylineDash,pe(z,c,"color",f.color,void 0,void 0,o),pe(z,c,"gapColor",f.gapColor,void 0,void 0,o),pe(Number,c,"dashLength",f.dashLength,void 0,r,o),pe(Number,c,"dashPattern",f.dashPattern,void 0,r,o)):l(n.checkerboard)&&(c instanceof uD||(c=new uD),f=n.checkerboard,pe(z,c,"evenColor",f.evenColor,void 0,r,o),pe(z,c,"oddColor",f.oddColor,void 0,r,o),pe(W,c,"repeat",f.repeat,void 0,r,o)),l(u)?u.data=c:e[t]=c}function fu(e,t,n,i,r,o){if(!!l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Ofe(e,t,n[s],i,r,o);else Ofe(e,t,n,i,r,o)}function oQe(e,t,n,i){let r=t.name;l(r)&&(e.name=t.name)}function sQe(e,t,n,i){let r=t.description;l(r)&&pe(String,e,"description",r,void 0,i,n)}function aQe(e,t,n,i){let r=t.position;l(r)&&zfe(e,"position",r,void 0,i,n)}function cQe(e,t,n,i){let r=t.viewFrom;l(r)&&pe(h,e,"viewFrom",r,void 0,i,n)}function lQe(e,t,n,i){let r=t.orientation;l(r)&&pe(Re,e,"orientation",r,void 0,i,n)}function uQe(e,t,n,i){let r=t.properties;if(l(r)){l(e.properties)||(e.properties=new ql);for(let o in r)if(r.hasOwnProperty(o)){e.properties.hasProperty(o)||e.properties.addProperty(o);let s=r[o];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)J2(Sfe(s[a]),e.properties,o,s[a],void 0,i,n);else J2(Sfe(s),e.properties,o,s,void 0,i,n)}}}function Q2(e,t,n,i,r,o,s){let a=n.map(function(c){return bD(r,c)});if(l(i)){i=po(i);let c=e[t];if(!(c instanceof s)){let u=new s;u.intervals.addInterval(f7(c)),e[t]=c=u}i.data=new o(a),c.intervals.addInterval(i)}else e[t]=new o(a)}function Rfe(e,t,n,i){let r=n.references;l(r)?Q2(e,t,r,n.interval,i,CD,Lc):pe(Array,e,t,n,void 0,void 0,i)}function Mfe(e,t,n,i){if(!!l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)Rfe(e,t,n[r],i);else Rfe(e,t,n,i)}function Bfe(e,t,n,i){let r=n.references;l(r)?Q2(e,t,r,n.interval,i,i0,Ta):(l(n.cartesian)?n.array=h.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=h.fromRadiansArrayHeights(n.cartographicRadians):l(n.cartographicDegrees)&&(n.array=h.fromDegreesArrayHeights(n.cartographicDegrees)),l(n.array)&&pe(Array,e,t,n,void 0,void 0,i))}function SD(e,t,n,i){if(!!l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)Bfe(e,t,n[r],i);else Bfe(e,t,n,i)}function fQe(e){return h.unpackArray(e)}function dQe(e){return h.fromRadiansArrayHeights(e)}function hQe(e){return h.fromDegreesArrayHeights(e)}function Lfe(e,t,n,i){let r=n.references;if(l(r)){let o=r.map(function(s){let a={};return Q2(a,"positions",s,n.interval,i,i0,Ta),a.positions});e[t]=new i0(o)}else l(n.cartesian)?n.array=n.cartesian.map(fQe):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(dQe):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(hQe)),l(n.array)&&pe(Array,e,t,n,void 0,void 0,i)}function mQe(e,t,n,i){if(!!l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)Lfe(e,t,n[r],i);else Lfe(e,t,n,i)}function pQe(e,t,n,i){if(!!l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;r++)Ife(e,t,n[r],i);else Ife(e,t,n,i)}function _Qe(e,t,n,i){let r=t.availability;if(!l(r))return;let o;if(Array.isArray(r))for(let s=0,a=r.length;s<a;++s)l(o)||(o=new $o),o.addInterval(po(r[s]));else o=new $o,o.addInterval(po(r));e.availability=o}function gQe(e,t,n,i,r){!l(t)||pe(l0,e,"alignedAxis",t,n,i,r)}function yQe(e,t,n,i){let r=t.billboard;if(!l(r))return;let o=po(r.interval),s=e.billboard;l(s)||(e.billboard=s=new Ec),pe(Boolean,s,"show",r.show,o,i,n),pe(Image,s,"image",r.image,o,i,n),pe(Number,s,"scale",r.scale,o,i,n),pe(W,s,"pixelOffset",r.pixelOffset,o,i,n),pe(h,s,"eyeOffset",r.eyeOffset,o,i,n),pe(gi,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),pe(vn,s,"verticalOrigin",r.verticalOrigin,o,i,n),pe(ze,s,"heightReference",r.heightReference,o,i,n),pe(z,s,"color",r.color,o,i,n),pe(Id,s,"rotation",r.rotation,o,i,n),gQe(s,r.alignedAxis,o,i,n),pe(Boolean,s,"sizeInMeters",r.sizeInMeters,o,i,n),pe(Number,s,"width",r.width,o,i,n),pe(Number,s,"height",r.height,o,i,n),pe(St,s,"scaleByDistance",r.scaleByDistance,o,i,n),pe(St,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),pe(St,s,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),pe(je,s,"imageSubRegion",r.imageSubRegion,o,i,n),pe(Tt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),pe(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function xQe(e,t,n,i){let r=t.box;if(!l(r))return;let o=po(r.interval),s=e.box;l(s)||(e.box=s=new PT),pe(Boolean,s,"show",r.show,o,i,n),pe(h,s,"dimensions",r.dimensions,o,i,n),pe(ze,s,"heightReference",r.heightReference,o,i,n),pe(Boolean,s,"fill",r.fill,o,i,n),fu(s,"material",r.material,o,i,n),pe(Boolean,s,"outline",r.outline,o,i,n),pe(z,s,"outlineColor",r.outlineColor,o,i,n),pe(Number,s,"outlineWidth",r.outlineWidth,o,i,n),pe(Zt,s,"shadows",r.shadows,o,i,n),pe(Tt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function CQe(e,t,n,i){let r=t.corridor;if(!l(r))return;let o=po(r.interval),s=e.corridor;l(s)||(e.corridor=s=new OT),pe(Boolean,s,"show",r.show,o,i,n),SD(s,"positions",r.positions,n),pe(Number,s,"width",r.width,o,i,n),pe(Number,s,"height",r.height,o,i,n),pe(ze,s,"heightReference",r.heightReference,o,i,n),pe(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),pe(ze,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),pe(Li,s,"cornerType",r.cornerType,o,i,n),pe(Number,s,"granularity",r.granularity,o,i,n),pe(Boolean,s,"fill",r.fill,o,i,n),fu(s,"material",r.material,o,i,n),pe(Boolean,s,"outline",r.outline,o,i,n),pe(z,s,"outlineColor",r.outlineColor,o,i,n),pe(Number,s,"outlineWidth",r.outlineWidth,o,i,n),pe(Zt,s,"shadows",r.shadows,o,i,n),pe(Tt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),pe(qn,s,"classificationType",r.classificationType,o,i,n),pe(Number,s,"zIndex",r.zIndex,o,i,n)}function AQe(e,t,n,i){let r=t.cylinder;if(!l(r))return;let o=po(r.interval),s=e.cylinder;l(s)||(e.cylinder=s=new RT),pe(Boolean,s,"show",r.show,o,i,n),pe(Number,s,"length",r.length,o,i,n),pe(Number,s,"topRadius",r.topRadius,o,i,n),pe(Number,s,"bottomRadius",r.bottomRadius,o,i,n),pe(ze,s,"heightReference",r.heightReference,o,i,n),pe(Boolean,s,"fill",r.fill,o,i,n),fu(s,"material",r.material,o,i,n),pe(Boolean,s,"outline",r.outline,o,i,n),pe(z,s,"outlineColor",r.outlineColor,o,i,n),pe(Number,s,"outlineWidth",r.outlineWidth,o,i,n),pe(Number,s,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),pe(Number,s,"slices",r.slices,o,i,n),pe(Zt,s,"shadows",r.shadows,o,i,n),pe(Tt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function TQe(e,t){let n=e.version;if(l(n)&&typeof n=="string"){let o=n.split(".");if(o.length===2){if(o[0]!=="1")throw new fe("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new fe("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let r=e.clock;if(l(r)){let o=i.clock;l(o)?(o.interval=y(r.interval,o.interval),o.currentTime=y(r.currentTime,o.currentTime),o.range=y(r.range,o.range),o.step=y(r.step,o.step),o.multiplier=y(r.multiplier,o.multiplier)):i.clock={interval:r.interval,currentTime:r.currentTime,range:r.range,step:r.step,multiplier:r.multiplier}}}function bQe(e,t,n,i){let r=t.ellipse;if(!l(r))return;let o=po(r.interval),s=e.ellipse;l(s)||(e.ellipse=s=new MT),pe(Boolean,s,"show",r.show,o,i,n),pe(Number,s,"semiMajorAxis",r.semiMajorAxis,o,i,n),pe(Number,s,"semiMinorAxis",r.semiMinorAxis,o,i,n),pe(Number,s,"height",r.height,o,i,n),pe(ze,s,"heightReference",r.heightReference,o,i,n),pe(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),pe(ze,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),pe(Id,s,"rotation",r.rotation,o,i,n),pe(Id,s,"stRotation",r.stRotation,o,i,n),pe(Number,s,"granularity",r.granularity,o,i,n),pe(Boolean,s,"fill",r.fill,o,i,n),fu(s,"material",r.material,o,i,n),pe(Boolean,s,"outline",r.outline,o,i,n),pe(z,s,"outlineColor",r.outlineColor,o,i,n),pe(Number,s,"outlineWidth",r.outlineWidth,o,i,n),pe(Number,s,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),pe(Zt,s,"shadows",r.shadows,o,i,n),pe(Tt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),pe(qn,s,"classificationType",r.classificationType,o,i,n),pe(Number,s,"zIndex",r.zIndex,o,i,n)}function EQe(e,t,n,i){let r=t.ellipsoid;if(!l(r))return;let o=po(r.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new BT),pe(Boolean,s,"show",r.show,o,i,n),pe(h,s,"radii",r.radii,o,i,n),pe(h,s,"innerRadii",r.innerRadii,o,i,n),pe(Number,s,"minimumClock",r.minimumClock,o,i,n),pe(Number,s,"maximumClock",r.maximumClock,o,i,n),pe(Number,s,"minimumCone",r.minimumCone,o,i,n),pe(Number,s,"maximumCone",r.maximumCone,o,i,n),pe(ze,s,"heightReference",r.heightReference,o,i,n),pe(Boolean,s,"fill",r.fill,o,i,n),fu(s,"material",r.material,o,i,n),pe(Boolean,s,"outline",r.outline,o,i,n),pe(z,s,"outlineColor",r.outlineColor,o,i,n),pe(Number,s,"outlineWidth",r.outlineWidth,o,i,n),pe(Number,s,"stackPartitions",r.stackPartitions,o,i,n),pe(Number,s,"slicePartitions",r.slicePartitions,o,i,n),pe(Number,s,"subdivisions",r.subdivisions,o,i,n),pe(Zt,s,"shadows",r.shadows,o,i,n),pe(Tt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function SQe(e,t,n,i){let r=t.label;if(!l(r))return;let o=po(r.interval),s=e.label;l(s)||(e.label=s=new Hh),pe(Boolean,s,"show",r.show,o,i,n),pe(String,s,"text",r.text,o,i,n),pe(String,s,"font",r.font,o,i,n),pe($r,s,"style",r.style,o,i,n),pe(Number,s,"scale",r.scale,o,i,n),pe(Boolean,s,"showBackground",r.showBackground,o,i,n),pe(z,s,"backgroundColor",r.backgroundColor,o,i,n),pe(W,s,"backgroundPadding",r.backgroundPadding,o,i,n),pe(W,s,"pixelOffset",r.pixelOffset,o,i,n),pe(h,s,"eyeOffset",r.eyeOffset,o,i,n),pe(gi,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),pe(vn,s,"verticalOrigin",r.verticalOrigin,o,i,n),pe(ze,s,"heightReference",r.heightReference,o,i,n),pe(z,s,"fillColor",r.fillColor,o,i,n),pe(z,s,"outlineColor",r.outlineColor,o,i,n),pe(Number,s,"outlineWidth",r.outlineWidth,o,i,n),pe(St,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),pe(St,s,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),pe(St,s,"scaleByDistance",r.scaleByDistance,o,i,n),pe(Tt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),pe(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function wQe(e,t,n,i){let r=t.model;if(!l(r))return;let o=po(r.interval),s=e.model;l(s)||(e.model=s=new mg),pe(Boolean,s,"show",r.show,o,i,n),pe(oi.default,s,"uri",r.gltf,o,i,n),pe(Number,s,"scale",r.scale,o,i,n),pe(Number,s,"minimumPixelSize",r.minimumPixelSize,o,i,n),pe(Number,s,"maximumScale",r.maximumScale,o,i,n),pe(Boolean,s,"incrementallyLoadTextures",r.incrementallyLoadTextures,o,i,n),pe(Boolean,s,"runAnimations",r.runAnimations,o,i,n),pe(Boolean,s,"clampAnimations",r.clampAnimations,o,i,n),pe(Zt,s,"shadows",r.shadows,o,i,n),pe(ze,s,"heightReference",r.heightReference,o,i,n),pe(z,s,"silhouetteColor",r.silhouetteColor,o,i,n),pe(Number,s,"silhouetteSize",r.silhouetteSize,o,i,n),pe(z,s,"color",r.color,o,i,n),pe(Ds,s,"colorBlendMode",r.colorBlendMode,o,i,n),pe(Number,s,"colorBlendAmount",r.colorBlendAmount,o,i,n),pe(Tt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n);let a,c,u=r.nodeTransformations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)Nfe(s,u[a],o,i,n);else Nfe(s,u,o,i,n);let f=r.articulations;if(l(f))if(Array.isArray(f))for(a=0,c=f.length;a<c;++a)Ffe(s,f[a],o,i,n);else Ffe(s,f,o,i,n)}function Nfe(e,t,n,i,r){let o=po(t.interval);l(n)&&(l(o)?o=Cn.intersect(o,n,qx):o=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];if(!l(d))continue;l(s)||(e.nodeTransformations=s=new ql),s.hasProperty(f)||s.addProperty(f);let p=s[f];l(p)||(s[f]=p=new LT),pe(h,p,"translation",d.translation,o,i,r),pe(Re,p,"rotation",d.rotation,o,i,r),pe(h,p,"scale",d.scale,o,i,r)}}function Ffe(e,t,n,i,r){let o=po(t.interval);l(n)&&(l(o)?o=Cn.intersect(o,n,qx):o=n);let s=e.articulations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];!l(d)||(l(s)||(e.articulations=s=new ql),s.hasProperty(f)||s.addProperty(f),pe(Number,s,f,d,o,i,r))}}function vQe(e,t,n,i){let r=t.path;if(!l(r))return;let o=po(r.interval),s=e.path;l(s)||(e.path=s=new pg),pe(Boolean,s,"show",r.show,o,i,n),pe(Number,s,"leadTime",r.leadTime,o,i,n),pe(Number,s,"trailTime",r.trailTime,o,i,n),pe(Number,s,"width",r.width,o,i,n),pe(Number,s,"resolution",r.resolution,o,i,n),fu(s,"material",r.material,o,i,n),pe(Tt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function DQe(e,t,n,i){let r=t.point;if(!l(r))return;let o=po(r.interval),s=e.point;l(s)||(e.point=s=new FT),pe(Boolean,s,"show",r.show,o,i,n),pe(Number,s,"pixelSize",r.pixelSize,o,i,n),pe(ze,s,"heightReference",r.heightReference,o,i,n),pe(z,s,"color",r.color,o,i,n),pe(z,s,"outlineColor",r.outlineColor,o,i,n),pe(Number,s,"outlineWidth",r.outlineWidth,o,i,n),pe(St,s,"scaleByDistance",r.scaleByDistance,o,i,n),pe(St,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),pe(Tt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),pe(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function ED(e){this.polygon=e,this._definitionChanged=new ge}Object.defineProperties(ED.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!l(e)||e.isConstant)&&(!l(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});ED.prototype.getValue=function(e,t){let n;l(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return l(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),l(i)&&(i=i.map(function(r){return new ul(r)}))),l(t)?(t.positions=n,t.holes=i,t):new ul(n,i)};ED.prototype.equals=function(e){return this===e||e instanceof ED&&Y.equals(this.polygon._positions,e.polygon._positions)&&Y.equals(this.polygon._holes,e.polygon._holes)};function PQe(e,t,n,i){let r=t.polygon;if(!l(r))return;let o=po(r.interval),s=e.polygon;l(s)||(e.polygon=s=new Gh),pe(Boolean,s,"show",r.show,o,i,n),SD(s,"_positions",r.positions,n),mQe(s,"_holes",r.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new ED(s)),pe(Number,s,"height",r.height,o,i,n),pe(ze,s,"heightReference",r.heightReference,o,i,n),pe(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),pe(ze,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),pe(Id,s,"stRotation",r.stRotation,o,i,n),pe(Number,s,"granularity",r.granularity,o,i,n),pe(Boolean,s,"fill",r.fill,o,i,n),fu(s,"material",r.material,o,i,n),pe(Boolean,s,"outline",r.outline,o,i,n),pe(z,s,"outlineColor",r.outlineColor,o,i,n),pe(Number,s,"outlineWidth",r.outlineWidth,o,i,n),pe(Boolean,s,"perPositionHeight",r.perPositionHeight,o,i,n),pe(Boolean,s,"closeTop",r.closeTop,o,i,n),pe(Boolean,s,"closeBottom",r.closeBottom,o,i,n),pe(Kt,s,"arcType",r.arcType,o,i,n),pe(Zt,s,"shadows",r.shadows,o,i,n),pe(Tt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),pe(qn,s,"classificationType",r.classificationType,o,i,n),pe(Number,s,"zIndex",r.zIndex,o,i,n)}function IQe(e){return e?Kt.GEODESIC:Kt.NONE}function OQe(e,t,n,i){let r=t.polyline;if(!l(r))return;let o=po(r.interval),s=e.polyline;if(l(s)||(e.polyline=s=new vc),pe(Boolean,s,"show",r.show,o,i,n),SD(s,"positions",r.positions,n),pe(Number,s,"width",r.width,o,i,n),pe(Number,s,"granularity",r.granularity,o,i,n),fu(s,"material",r.material,o,i,n),fu(s,"depthFailMaterial",r.depthFailMaterial,o,i,n),pe(Kt,s,"arcType",r.arcType,o,i,n),pe(Boolean,s,"clampToGround",r.clampToGround,o,i,n),pe(Zt,s,"shadows",r.shadows,o,i,n),pe(Tt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),pe(qn,s,"classificationType",r.classificationType,o,i,n),pe(Number,s,"zIndex",r.zIndex,o,i,n),l(r.followSurface)&&!l(r.arcType)){let a={};pe(Boolean,a,"followSurface",r.followSurface,o,i,n),s.arcType=XJe(a.followSurface,IQe)}}function RQe(e,t,n,i){let r=t.polylineVolume;if(!l(r))return;let o=po(r.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new VT),SD(s,"positions",r.positions,n),pQe(s,"shape",r.shape,n),pe(Boolean,s,"show",r.show,o,i,n),pe(Li,s,"cornerType",r.cornerType,o,i,n),pe(Boolean,s,"fill",r.fill,o,i,n),fu(s,"material",r.material,o,i,n),pe(Boolean,s,"outline",r.outline,o,i,n),pe(z,s,"outlineColor",r.outlineColor,o,i,n),pe(Number,s,"outlineWidth",r.outlineWidth,o,i,n),pe(Number,s,"granularity",r.granularity,o,i,n),pe(Zt,s,"shadows",r.shadows,o,i,n),pe(Tt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function MQe(e,t,n,i){let r=t.rectangle;if(!l(r))return;let o=po(r.interval),s=e.rectangle;l(s)||(e.rectangle=s=new Wh),pe(Boolean,s,"show",r.show,o,i,n),pe(he,s,"coordinates",r.coordinates,o,i,n),pe(Number,s,"height",r.height,o,i,n),pe(ze,s,"heightReference",r.heightReference,o,i,n),pe(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),pe(ze,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),pe(Id,s,"rotation",r.rotation,o,i,n),pe(Id,s,"stRotation",r.stRotation,o,i,n),pe(Number,s,"granularity",r.granularity,o,i,n),pe(Boolean,s,"fill",r.fill,o,i,n),fu(s,"material",r.material,o,i,n),pe(Boolean,s,"outline",r.outline,o,i,n),pe(z,s,"outlineColor",r.outlineColor,o,i,n),pe(Number,s,"outlineWidth",r.outlineWidth,o,i,n),pe(Zt,s,"shadows",r.shadows,o,i,n),pe(Tt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),pe(qn,s,"classificationType",r.classificationType,o,i,n),pe(Number,s,"zIndex",r.zIndex,o,i,n)}function BQe(e,t,n,i){let r=t.tileset;if(!l(r))return;let o=po(r.interval),s=e.tileset;l(s)||(e.tileset=s=new NT),pe(Boolean,s,"show",r.show,o,i,n),pe(oi.default,s,"uri",r.uri,o,i,n),pe(Number,s,"maximumScreenSpaceError",r.maximumScreenSpaceError,o,i,n)}function LQe(e,t,n,i){let r=t.wall;if(!l(r))return;let o=po(r.interval),s=e.wall;l(s)||(e.wall=s=new _g),pe(Boolean,s,"show",r.show,o,i,n),SD(s,"positions",r.positions,n),Mfe(s,"minimumHeights",r.minimumHeights,n),Mfe(s,"maximumHeights",r.maximumHeights,n),pe(Number,s,"granularity",r.granularity,o,i,n),pe(Boolean,s,"fill",r.fill,o,i,n),fu(s,"material",r.material,o,i,n),pe(Boolean,s,"outline",r.outline,o,i,n),pe(z,s,"outlineColor",r.outlineColor,o,i,n),pe(Number,s,"outlineWidth",r.outlineWidth,o,i,n),pe(Zt,s,"shadows",r.shadows,o,i,n),pe(Tt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function Vfe(e,t,n,i,r){let o=e.id;if(l(o)||(o=Ln()),l7=o,!l(r._version)&&o!=="document")throw new fe("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(o);else if(o==="document")TQe(e,r);else{let s=t.getOrCreateEntity(o),a=e.parent;l(a)&&(s.parent=t.getOrCreateEntity(a));for(let c=n.length-1;c>-1;c--)n[c](s,e,t,i)}l7=void 0}function NQe(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let r=e._entityCollection.computeAvailability();if(!r.start.equals(ke.MINIMUM_VALUE)){let o=r.start,s=r.stop,a=ee.secondsDifference(s,o),c=Math.round(a/120);return t=new fm,t.startTime=ee.clone(o),t.stopTime=ee.clone(s),t.clockRange=jo.LOOP_STOP,t.multiplier=c,t.currentTime=ee.clone(o),t.clockStep=xr.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new fm,t.startTime=ke.MINIMUM_VALUE.clone(),t.stopTime=ke.MAXIMUM_VALUE.clone(),t.currentTime=ke.MINIMUM_VALUE.clone(),t.clockRange=jo.LOOP_STOP,t.clockStep=xr.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=po(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=ee.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=y(jo[n.range],jo.LOOP_STOP)),l(n.step)&&(t.clockStep=y(xr[n.step],xr.SYSTEM_CLOCK_MULTIPLIER)),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function Hfe(e,t,n,i){n=y(n,y.EMPTY_OBJECT);let r=t,o=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new Gt(s)),e._credit=s,typeof t=="string"||t instanceof De){t=De.createIfNeeded(t),r=t.fetchJson(),o=y(o,t.clone());let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return o=De.createIfNeeded(o),Jo.setLoading(e,!0),Promise.resolve(r).then(function(a){return FQe(e,a,o,i)}).catch(function(a){return Jo.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function FQe(e,t,n,i){Jo.setLoading(e,!0);let r=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new Gfe,r.removeAll()),bl._processCzml(t,r,n,void 0,e);let o=NQe(e),s=e._documentPacket;return l(s.name)&&e._name!==s.name?(e._name=s.name,o=!0):!l(e._name)&&l(n)&&(e._name=W_(n.getUrlComponent()),o=!0),Jo.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function Gfe(){this.name=void 0,this.clock=void 0}function bl(e){this._name=e,this._changed=new ge,this._error=new ge,this._isLoading=!1,this._loading=new ge,this._clock=void 0,this._documentPacket=new Gfe,this._version=void 0,this._entityCollection=new Zs(this),this._entityCluster=new bf,this._credit=void 0,this._resourceCredits=[]}bl.load=function(e,t){return new bl().load(e,t)};Object.defineProperties(bl.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});bl.updaters=[yQe,xQe,CQe,AQe,bQe,EQe,SQe,wQe,oQe,sQe,vQe,DQe,PQe,OQe,RQe,uQe,MQe,aQe,BQe,cQe,LQe,lQe,_Qe];bl.prototype.process=function(e,t){return Hfe(this,e,t,!1)};bl.prototype.load=function(e,t){return Hfe(this,e,t,!0)};bl.prototype.update=function(e){return!0};bl.processPacketData=pe;bl.processPositionPacketData=zfe;bl.processMaterialPacketData=fu;bl._processCzml=function(e,t,n,i,r){if(i=y(i,bl.updaters),Array.isArray(e))for(let o=0,s=e.length;o<s;++o)Vfe(e[o],t,i,n,r);else Vfe(e,t,i,n,r)};var e3=bl;function Vc(){this._dataSources=[],this._dataSourceAdded=new ge,this._dataSourceRemoved=new ge,this._dataSourceMoved=new ge}Object.defineProperties(Vc.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}});Vc.prototype.add=function(e){let t=this,n=this._dataSources;return Promise.resolve(e).then(function(i){return n===t._dataSources&&(t._dataSources.push(i),t._dataSourceAdded.raiseEvent(t,i)),i})};Vc.prototype.remove=function(e,t){t=y(t,!1);let n=this._dataSources.indexOf(e);return n!==-1?(this._dataSources.splice(n,1),this._dataSourceRemoved.raiseEvent(this,e),t&&typeof e.destroy=="function"&&e.destroy(),!0):!1};Vc.prototype.removeAll=function(e){e=y(e,!1);let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let r=t[n];this._dataSourceRemoved.raiseEvent(this,r),e&&typeof r.destroy=="function"&&r.destroy()}this._dataSources=[]};Vc.prototype.contains=function(e){return this.indexOf(e)!==-1};Vc.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};Vc.prototype.get=function(e){return this._dataSources[e]};Vc.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function t3(e,t){return e.indexOf(t)}function Wfe(e,t,n){let i=e._dataSources,r=i.length-1;if(t=M.clamp(t,0,r),n=M.clamp(n,0,r),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e.dataSourceMoved.raiseEvent(o,n,t)}Vc.prototype.raise=function(e){let t=t3(this._dataSources,e);Wfe(this,t,t+1)};Vc.prototype.lower=function(e){let t=t3(this._dataSources,e);Wfe(this,t,t-1)};Vc.prototype.raiseToTop=function(e){let t=t3(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))};Vc.prototype.lowerToBottom=function(e){let t=t3(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};Vc.prototype.isDestroyed=function(){return!1};Vc.prototype.destroy=function(){return this.removeAll(!0),ue(this)};var n3=Vc;function Qs(e){e=y(e,y.EMPTY_OBJECT),this._primitives=[],this._guid=Ln(),this._zIndex=void 0,this.show=y(e.show,!0),this.destroyPrimitives=y(e.destroyPrimitives,!0)}Object.defineProperties(Qs.prototype,{length:{get:function(){return this._primitives.length}}});Qs.prototype.add=function(e,t){let n=l(t),i=e._external=e._external||{},r=i._composites=i._composites||{};return r[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),e};Qs.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),!0}return!1};Qs.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};Qs.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n)delete e[n]._external._composites[this._guid],this.destroyPrimitives&&e[n].destroy();this._primitives=[]};Qs.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function i3(e,t){return e._primitives.indexOf(t)}Qs.prototype.raise=function(e){if(l(e)){let t=i3(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};Qs.prototype.raiseToTop=function(e){if(l(e)){let t=i3(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};Qs.prototype.lower=function(e){if(l(e)){let t=i3(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};Qs.prototype.lowerToBottom=function(e){if(l(e)){let t=i3(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};Qs.prototype.get=function(e){return this._primitives[e]};Qs.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};Qs.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.prePassesUpdate)&&i.prePassesUpdate(e)}};Qs.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let r=n[i];l(r.updateForPass)&&r.updateForPass(e,t)}};Qs.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.postPassesUpdate)&&i.postPassesUpdate(e)}};Qs.prototype.isDestroyed=function(){return!1};Qs.prototype.destroy=function(){return this.removeAll(),ue(this)};var du=Qs;function hm(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(hm.prototype,{length:{get:function(){return this._length}}});hm.prototype.add=function(e,t){t=y(t,0);let n=this._collections[t];if(!l(n)){n=new du({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,r=0;for(;r<i.length&&i[r]._zIndex<t;)r++;i.splice(r,0,n)}return n.add(e),this._length++,e._zIndex=t,e};hm.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};hm.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],r;return t?r=i.remove(e):r=i.removeAndDestroy(e),r&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),r}return!1};hm.prototype.removeAll=function(){let e=this._collectionsArray;for(let t=0;t<e.length;t++){let n=e[t];n.destroyPrimitives=!0,n.destroy()}this._collections={},this._collectionsArray=[],this._length=0};hm.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};hm.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};hm.prototype.isDestroyed=function(){return!1};hm.prototype.destroy=function(){return this.removeAll(),ue(this)};var r3=hm;function zb(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new xt}zb.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};zb.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};zb.prototype.update=function(e){let t=this._dynamicUpdaters.values;for(let n=0,i=t.length;n<i;n++)t[n].update(e);return!0};zb.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};zb.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):st.FAILED};var Hb=zb;var jfe=new z,qfe=h.ZERO,Yfe=new h,Xfe=new he;function VQe(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function Rd(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new VQe(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(Rd.prototype=Object.create(Gn.prototype),Rd.prototype.constructor=Rd);Rd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Dt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,jfe)),l(r)||(r=z.WHITE),i.color=Ot.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=nr.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,qfe,Yfe))),new pt({id:t,geometry:new il(this._options),attributes:i})};Rd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,jfe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ot.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=nr.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,qfe,Yfe))),new pt({id:t,geometry:new Fu(this._options),attributes:o})};Rd.prototype._computeCenter=function(e,t){return Y.getValueOrUndefined(this._entity.position,e,t)};Rd.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||ci.prototype._isHidden.call(this,e,t)};Rd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!Y.isConstant(t.rotation)||!Y.isConstant(t.height)||!Y.isConstant(t.extrudedHeight)||!Y.isConstant(t.granularity)||!Y.isConstant(t.stRotation)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.numberOfVerticalLines)||!Y.isConstant(t.zIndex)||this._onTerrain&&!Y.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Dt)};Rd.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrUndefined(t.height,ke.MINIMUM_VALUE),i=Y.getValueOrDefault(t.heightReference,ke.MINIMUM_VALUE,ze.NONE),r=Y.getValueOrUndefined(t.extrudedHeight,ke.MINIMUM_VALUE),o=Y.getValueOrDefault(t.extrudedHeightReference,ke.MINIMUM_VALUE,ze.NONE);l(r)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Dt?rn.VERTEX_FORMAT:lr.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(ke.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(ke.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(ke.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=Y.getValueOrUndefined(t.rotation,ke.MINIMUM_VALUE),s.granularity=Y.getValueOrUndefined(t.granularity,ke.MINIMUM_VALUE),s.stRotation=Y.getValueOrUndefined(t.stRotation,ke.MINIMUM_VALUE),s.numberOfVerticalLines=Y.getValueOrUndefined(t.numberOfVerticalLines,ke.MINIMUM_VALUE),s.offsetAttribute=Gn.computeGeometryOffsetAttribute(n,i,r,o),s.height=Gn.getGeometryHeight(n,i),r=Gn.getGeometryExtrudedHeight(r,o),r===Gn.CLAMP_TO_GROUND&&(r=fi.getMinimumMaximumHeights(il.computeRectangle(s,Xfe)).minimumTerrainHeight),s.extrudedHeight=r};Rd.DynamicGeometryUpdater=Gb;function Gb(e,t,n){ai.call(this,e,t,n)}l(Object.create)&&(Gb.prototype=Object.create(ai.prototype),Gb.prototype.constructor=Gb);Gb.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||ai.prototype._isHidden.call(this,e,t,n)};Gb.prototype._setOptions=function(e,t,n){let i=this._options,r=Y.getValueOrUndefined(t.height,n),o=Y.getValueOrDefault(t.heightReference,n,ze.NONE),s=Y.getValueOrUndefined(t.extrudedHeight,n),a=Y.getValueOrDefault(t.extrudedHeightReference,n,ze.NONE);l(s)&&!l(r)&&(r=0),i.center=Y.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=Y.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=Y.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=Y.getValueOrUndefined(t.rotation,n),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.stRotation=Y.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=Y.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=Gn.computeGeometryOffsetAttribute(r,o,s,a),i.height=Gn.getGeometryHeight(r,o),s=Gn.getGeometryExtrudedHeight(s,a),s===Gn.CLAMP_TO_GROUND&&(s=fi.getMinimumMaximumHeights(il.computeRectangle(i,Xfe)).minimumTerrainHeight),i.extrudedHeight=s};var o3=Rd;var kQe=new Dt(z.WHITE),d7=h.ZERO,h7=new h,UQe=new h,zQe=new h,m7=new z,HQe=new h(1,1,1);function GQe(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function hu(e,t){ci.call(this,{entity:e,scene:t,geometryOptions:new GQe(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(hu.prototype=Object.create(ci.prototype),hu.prototype.constructor=hu);Object.defineProperties(hu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});hu.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o,s=new gn(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=kn.fromDistanceDisplayCondition(a),u={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Dt){let f;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(f=this._materialProperty.color.getValue(e,m7)),l(f)||(f=z.WHITE),o=Ot.fromColor(f),u.color=o}return l(this._options.offsetAttribute)&&(u.offset=nr.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,d7,h7))),new pt({id:i,geometry:new Us(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.mapProjection.ellipsoid,n),attributes:u})};hu.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o=Y.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,m7),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new gn(r&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ot.fromColor(o),distanceDisplayCondition:kn.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=nr.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,d7,h7))),new pt({id:i,geometry:new zu(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.mapProjection.ellipsoid,n),attributes:a})};hu.prototype._computeCenter=function(e,t){return Y.getValueOrUndefined(this._entity.position,e,t)};hu.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||ci.prototype._isHidden.call(this,e,t)};hu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!Y.isConstant(e.orientation)||!t.radii.isConstant||!Y.isConstant(t.innerRadii)||!Y.isConstant(t.stackPartitions)||!Y.isConstant(t.slicePartitions)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.minimumClock)||!Y.isConstant(t.maximumClock)||!Y.isConstant(t.minimumCone)||!Y.isConstant(t.maximumCone)||!Y.isConstant(t.subdivisions)};hu.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrDefault(t.heightReference,ke.MINIMUM_VALUE,ze.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Dt?rn.VERTEX_FORMAT:lr.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(ke.MINIMUM_VALUE,i.radii),i.innerRadii=Y.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=Y.getValueOrUndefined(t.minimumClock,ke.MINIMUM_VALUE),i.maximumClock=Y.getValueOrUndefined(t.maximumClock,ke.MINIMUM_VALUE),i.minimumCone=Y.getValueOrUndefined(t.minimumCone,ke.MINIMUM_VALUE),i.maximumCone=Y.getValueOrUndefined(t.maximumCone,ke.MINIMUM_VALUE),i.stackPartitions=Y.getValueOrUndefined(t.stackPartitions,ke.MINIMUM_VALUE),i.slicePartitions=Y.getValueOrUndefined(t.slicePartitions,ke.MINIMUM_VALUE),i.subdivisions=Y.getValueOrUndefined(t.subdivisions,ke.MINIMUM_VALUE),i.offsetAttribute=n!==ze.NONE?nn.ALL:void 0};hu.prototype._onEntityPropertyChanged=gg;hu.DynamicGeometryUpdater=wD;function wD(e,t,n){ai.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new N,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new h,this._material={}}l(Object.create)&&(wD.prototype=Object.create(ai.prototype),wD.prototype.constructor=wD);wD.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!Y.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=Y.getValueOrUndefined(n.radii,e,UQe),r=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.mapProjection.ellipsoid,this._modelMatrix):void 0;if(!l(r)||!l(i)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let o=Y.getValueOrDefault(n.fill,e,!0),s=Y.getValueOrDefault(n.outline,e,!1),a=Y.getValueOrClonedDefault(n.outlineColor,e,z.BLACK,m7),c=lo.getValue(e,y(n.material,kQe),this._material),u=Y.getValueOrUndefined(n.innerRadii,e,zQe),f=Y.getValueOrUndefined(n.minimumClock,e),d=Y.getValueOrUndefined(n.maximumClock,e),p=Y.getValueOrUndefined(n.minimumCone,e),g=Y.getValueOrUndefined(n.maximumCone,e),m=Y.getValueOrUndefined(n.stackPartitions,e),x=Y.getValueOrUndefined(n.slicePartitions,e),C=Y.getValueOrUndefined(n.subdivisions,e),A=Y.getValueOrDefault(n.outlineWidth,e,1),b=Y.getValueOrDefault(n.heightReference,e,ze.NONE),T=b!==ze.NONE?nn.ALL:void 0,S=this._scene.mode,w=S===te.SCENE3D&&b===ze.NONE,D=this._options,I=this._geometryUpdater.shadowsProperty.getValue(e),B=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),L=Y.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,d7,h7);if(!w||this._lastSceneMode!==S||!l(this._primitive)||D.stackPartitions!==m||D.slicePartitions!==x||l(u)&&!h.equals(D.innerRadii!==u)||D.minimumClock!==f||D.maximumClock!==d||D.minimumCone!==p||D.maximumCone!==g||D.subdivisions!==C||this._lastOutlineWidth!==A||D.offsetAttribute!==T){let E=this._primitives;if(E.removeAndDestroy(this._primitive),E.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=S,this._lastOutlineWidth=A,D.stackPartitions=m,D.slicePartitions=x,D.subdivisions=C,D.offsetAttribute=T,D.radii=h.clone(w?HQe:i,D.radii),l(u))if(w){let F=h.magnitude(i);D.innerRadii=h.fromElements(u.x/F,u.y/F,u.z/F,D.innerRadii)}else D.innerRadii=h.clone(u,D.innerRadii);else D.innerRadii=void 0;D.minimumClock=f,D.maximumClock=d,D.minimumCone=p,D.maximumCone=g;let v=new lr({material:c,translucent:c.isTranslucent(),closed:!0});D.vertexFormat=v.vertexFormat;let P=this._geometryUpdater.createFillGeometryInstance(e,w,this._modelMatrix);this._primitive=E.add(new Tn({geometryInstances:P,appearance:v,asynchronous:!1,shadows:I}));let R=this._geometryUpdater.createOutlineGeometryInstance(e,w,this._modelMatrix);this._outlinePrimitive=E.add(new Tn({geometryInstances:R,appearance:new rn({flat:!0,translucent:R.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(A)}}),asynchronous:!1,shadows:I})),this._lastShow=o,this._lastOutlineShow=s,this._lastOutlineColor=z.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=B,this._lastOffset=h.clone(L,this._lastOffset)}else if(this._primitive.ready){let E=this._primitive,v=this._outlinePrimitive;E.show=!0,v.show=!0,E.appearance.material=c;let P=this._attributes;l(P)||(P=E.getGeometryInstanceAttributes(t),this._attributes=P),o!==this._lastShow&&(P.show=gn.toValue(o,P.show),this._lastShow=o);let R=this._outlineAttributes;l(R)||(R=v.getGeometryInstanceAttributes(t),this._outlineAttributes=R),s!==this._lastOutlineShow&&(R.show=gn.toValue(s,R.show),this._lastOutlineShow=s),z.equals(a,this._lastOutlineColor)||(R.color=Ot.toValue(a,R.color),z.clone(a,this._lastOutlineColor)),Tt.equals(B,this._lastDistanceDisplayCondition)||(P.distanceDisplayCondition=kn.toValue(B,P.distanceDisplayCondition),R.distanceDisplayCondition=kn.toValue(B,R.distanceDisplayCondition),Tt.clone(B,this._lastDistanceDisplayCondition)),h.equals(L,this._lastOffset)||(P.offset=nr.toValue(L,P.offset),R.offset=nr.toValue(L,P.offset),h.clone(L,this._lastOffset))}w&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),r=N.multiplyByScale(r,i,r),this._primitive.modelMatrix=r,this._outlinePrimitive.modelMatrix=r)};var s3=hu;var WQe=new h,Kfe=new z;function jQe(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function wf(e,t){ci.call(this,{entity:e,scene:t,geometryOptions:new jQe(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(wf.prototype=Object.create(ci.prototype),wf.prototype.constructor=wf);wf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Dt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,Kfe)),l(g)||(g=z.WHITE),r=Ot.fromColor(g),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};let c=t.plane,u=this._options,f=t.computeModelMatrix(e),d=Y.getValueOrDefault(c.plane,e,u.plane),p=Y.getValueOrUndefined(c.dimensions,e,u.dimensions);return u.plane=d,u.dimensions=p,f=p7(d,p,f,f),new pt({id:t,geometry:new RO(this._options),modelMatrix:f,attributes:i})};wf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Kfe),r=this._distanceDisplayConditionProperty.getValue(e),o=t.plane,s=this._options,a=t.computeModelMatrix(e),c=Y.getValueOrDefault(o.plane,e,s.plane),u=Y.getValueOrUndefined(o.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=u,a=p7(c,u,a,a),new pt({id:t,geometry:new BO,modelMatrix:a,attributes:{show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ot.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(r)}})};wf.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||ci.prototype._isHidden.call(this,e,t)};wf.prototype._getIsClosed=function(e){return!1};wf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!Y.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!Y.isConstant(t.outlineWidth)};wf.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Dt,i=this._options;i.vertexFormat=n?rn.VERTEX_FORMAT:lr.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(ke.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(ke.MINIMUM_VALUE,i.dimensions)};wf.DynamicGeometryUpdater=Wb;function Wb(e,t,n){ai.call(this,e,t,n)}l(Object.create)&&(Wb.prototype=Object.create(ai.prototype),Wb.prototype.constructor=Wb);Wb.prototype._isHidden=function(e,t,n){let i=this._options,r=Y.getValueOrUndefined(e.position,n,WQe);return!l(r)||!l(i.plane)||!l(i.dimensions)||ai.prototype._isHidden.call(this,e,t,n)};Wb.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=Y.getValueOrDefault(t.plane,n,i.plane),i.dimensions=Y.getValueOrUndefined(t.dimensions,n,i.dimensions)};var qQe=new h,YQe=new h,XQe=new h,KQe=new h,$Qe=new Q,ZQe=new Q,JQe=new N;function p7(e,t,n,i){let r=e.normal,o=e.distance,s=h.multiplyByScalar(r,-o,XQe),a=h.clone(h.UNIT_Z,YQe);M.equalsEpsilon(Math.abs(h.dot(a,r)),1,M.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,r,qQe);a=h.cross(r,c,a),h.normalize(c,c),h.normalize(a,a);let u=$Qe;Q.setColumn(u,0,c,u),Q.setColumn(u,1,a,u),Q.setColumn(u,2,r,u);let f=h.fromElements(t.x,t.y,1,KQe),d=Q.multiplyByScale(u,f,ZQe),p=N.fromRotationTranslation(d,s,JQe);return N.multiplyTransformation(n,p,i)}wf.createPrimitiveMatrix=p7;var a3=wf;var $fe="Entity polygons cannot have both height and perPositionHeight. height will be ignored",Zfe="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",Jfe=new z,Qfe=h.ZERO,ede=new h,tde=new he,QQe=[],eet=new W;function tet(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.textureCoordinates=void 0}function mu(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new tet(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(mu.prototype=Object.create(Gn.prototype),mu.prototype.constructor=mu);mu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Dt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,Jfe)),l(s)||(s=z.WHITE),r.color=Ot.fromColor(s)}l(i.offsetAttribute)&&(r.offset=nr.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Qfe,ede)));let o;return i.perPositionHeight&&!l(i.extrudedHeight)?o=new VI(i):o=new tT(i),new pt({id:t,geometry:o,attributes:r})};mu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r=Y.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Jfe),o=this._distanceDisplayConditionProperty.getValue(e),s={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ot.fromColor(r),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};l(i.offsetAttribute)&&(s.offset=nr.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Qfe,ede)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new Qf(i):a=new FO(i),new pt({id:t,geometry:a,attributes:s})};mu.prototype._computeCenter=function(e,t){let n=Y.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let r=this._scene.mapProjection.ellipsoid,o=La.fromPoints(i,r),s=o.projectPointsOntoPlane(i,QQe),a=s.length,c=0,u=a-1,f=new W;for(let p=0;p<a;u=p++){let g=s[p],m=s[u],x=g.x*m.y-m.x*g.y,C=W.add(g,m,eet);C=W.multiplyByScalar(C,x,C),f=W.add(f,C,f),c+=x}let d=1/(c*3);return f=W.multiplyByScalar(f,d,f),o.projectPointOntoEllipsoid(f,t)};mu.prototype._isHidden=function(e,t){return!l(t.hierarchy)||ci.prototype._isHidden.call(this,e,t)};mu.prototype._isOnTerrain=function(e,t){let n=Gn.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,r=l(i)&&(i.isConstant?i.getValue(ke.MINIMUM_VALUE):!0);return n&&!r};mu.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!Y.isConstant(t.height)||!Y.isConstant(t.extrudedHeight)||!Y.isConstant(t.granularity)||!Y.isConstant(t.stRotation)||!Y.isConstant(t.textureCoordinates)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.perPositionHeight)||!Y.isConstant(t.closeTop)||!Y.isConstant(t.closeBottom)||!Y.isConstant(t.zIndex)||!Y.isConstant(t.arcType)||this._onTerrain&&!Y.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Dt)};mu.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Dt,i=this._options;i.vertexFormat=n?rn.VERTEX_FORMAT:lr.MaterialSupport.TEXTURED.vertexFormat;let r=t.hierarchy.getValue(ke.MINIMUM_VALUE),o=Y.getValueOrUndefined(t.height,ke.MINIMUM_VALUE),s=Y.getValueOrDefault(t.heightReference,ke.MINIMUM_VALUE,ze.NONE),a=Y.getValueOrUndefined(t.extrudedHeight,ke.MINIMUM_VALUE),c=Y.getValueOrDefault(t.extrudedHeightReference,ke.MINIMUM_VALUE,ze.NONE),u=Y.getValueOrDefault(t.perPositionHeight,ke.MINIMUM_VALUE,!1);o=Gn.getGeometryHeight(o,s);let f;u?(l(o)&&(o=void 0,Lt($fe)),s!==ze.NONE&&u&&(o=void 0,Lt(Zfe))):(l(a)&&!l(o)&&(o=0),f=Gn.computeGeometryOffsetAttribute(o,s,a,c)),i.polygonHierarchy=r,i.granularity=Y.getValueOrUndefined(t.granularity,ke.MINIMUM_VALUE),i.stRotation=Y.getValueOrUndefined(t.stRotation,ke.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=Y.getValueOrDefault(t.closeTop,ke.MINIMUM_VALUE,!0),i.closeBottom=Y.getValueOrDefault(t.closeBottom,ke.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=o,i.arcType=Y.getValueOrDefault(t.arcType,ke.MINIMUM_VALUE,Kt.GEODESIC),i.textureCoordinates=Y.getValueOrUndefined(t.textureCoordinates,ke.MINIMUM_VALUE),a=Gn.getGeometryExtrudedHeight(a,c),a===Gn.CLAMP_TO_GROUND&&(a=fi.getMinimumMaximumHeights(tT.computeRectangle(i,tde)).minimumTerrainHeight),i.extrudedHeight=a};mu.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=l(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};mu.DynamicGeometryUpdater=jb;function jb(e,t,n){ai.call(this,e,t,n)}l(Object.create)&&(jb.prototype=Object.create(ai.prototype),jb.prototype.constructor=jb);jb.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||ai.prototype._isHidden.call(this,e,t,n)};jb.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=Y.getValueOrUndefined(t.hierarchy,n);let r=Y.getValueOrUndefined(t.height,n),o=Y.getValueOrDefault(t.heightReference,n,ze.NONE),s=Y.getValueOrDefault(t.extrudedHeightReference,n,ze.NONE),a=Y.getValueOrUndefined(t.extrudedHeight,n),c=Y.getValueOrUndefined(t.perPositionHeight,n);r=Gn.getGeometryHeight(r,s);let u;c?(l(r)&&(r=void 0,Lt($fe)),o!==ze.NONE&&c&&(r=void 0,Lt(Zfe))):(l(a)&&!l(r)&&(r=0),u=Gn.computeGeometryOffsetAttribute(r,o,a,s)),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.stRotation=Y.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=Y.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=Y.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=Y.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=Y.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=r,i.arcType=Y.getValueOrDefault(t.arcType,n,Kt.GEODESIC),a=Gn.getGeometryExtrudedHeight(a,s),a===Gn.CLAMP_TO_GROUND&&(a=fi.getMinimumMaximumHeights(tT.computeRectangle(i,tde)).minimumTerrainHeight),i.extrudedHeight=a};var c3=mu;var nde=new z;function net(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function mm(e,t){ci.call(this,{entity:e,scene:t,geometryOptions:new net(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(mm.prototype=Object.create(ci.prototype),mm.prototype.constructor=mm);mm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Dt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,nde)),l(c)||(c=z.WHITE),r=Ot.fromColor(c),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};return new pt({id:t,geometry:new VO(this._options),attributes:i})};mm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,nde),r=this._distanceDisplayConditionProperty.getValue(e);return new pt({id:t,geometry:new kO(this._options),attributes:{show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ot.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(r)}})};mm.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||ci.prototype._isHidden.call(this,e,t)};mm.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!Y.isConstant(t.granularity)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.cornerType)};mm.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,r=this._options,o=this._materialProperty instanceof Dt;r.vertexFormat=o?rn.VERTEX_FORMAT:lr.MaterialSupport.TEXTURED.vertexFormat,r.polylinePositions=t.positions.getValue(ke.MINIMUM_VALUE,r.polylinePositions),r.shapePositions=t.shape.getValue(ke.MINIMUM_VALUE,r.shape),r.granularity=l(n)?n.getValue(ke.MINIMUM_VALUE):void 0,r.cornerType=l(i)?i.getValue(ke.MINIMUM_VALUE):void 0};mm.DynamicGeometryUpdater=qb;function qb(e,t,n){ai.call(this,e,t,n)}l(Object.create)&&(qb.prototype=Object.create(ai.prototype),qb.prototype.constructor=qb);qb.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||ai.prototype._isHidden.call(this,e,t,n)};qb.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=Y.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=Y.getValueOrUndefined(t.shape,n),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.cornerType=Y.getValueOrUndefined(t.cornerType,n)};var l3=mm;var ide=new z,rde=h.ZERO,ode=new h,sde=new he,iet=new he,ret=new me;function oet(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function Md(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new oet(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(Md.prototype=Object.create(Gn.prototype),Md.prototype.constructor=Md);Md.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Dt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,ide)),l(r)||(r=z.WHITE),i.color=Ot.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=nr.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,rde,ode))),new pt({id:t,geometry:new aT(this._options),attributes:i})};Md.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,ide),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ot.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=nr.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,rde,ode))),new pt({id:t,geometry:new uT(this._options),attributes:o})};Md.prototype._computeCenter=function(e,t){let n=Y.getValueOrUndefined(this._entity.rectangle.coordinates,e,iet);if(!l(n))return;let i=he.center(n,ret);return me.toCartesian(i,oe.WGS84,t)};Md.prototype._isHidden=function(e,t){return!l(t.coordinates)||ci.prototype._isHidden.call(this,e,t)};Md.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!Y.isConstant(t.height)||!Y.isConstant(t.extrudedHeight)||!Y.isConstant(t.granularity)||!Y.isConstant(t.stRotation)||!Y.isConstant(t.rotation)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.zIndex)||this._onTerrain&&!Y.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Dt)};Md.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Dt,i=Y.getValueOrUndefined(t.height,ke.MINIMUM_VALUE),r=Y.getValueOrDefault(t.heightReference,ke.MINIMUM_VALUE,ze.NONE),o=Y.getValueOrUndefined(t.extrudedHeight,ke.MINIMUM_VALUE),s=Y.getValueOrDefault(t.extrudedHeightReference,ke.MINIMUM_VALUE,ze.NONE);l(o)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?rn.VERTEX_FORMAT:lr.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(ke.MINIMUM_VALUE,a.rectangle),a.granularity=Y.getValueOrUndefined(t.granularity,ke.MINIMUM_VALUE),a.stRotation=Y.getValueOrUndefined(t.stRotation,ke.MINIMUM_VALUE),a.rotation=Y.getValueOrUndefined(t.rotation,ke.MINIMUM_VALUE),a.offsetAttribute=Gn.computeGeometryOffsetAttribute(i,r,o,s),a.height=Gn.getGeometryHeight(i,r),o=Gn.getGeometryExtrudedHeight(o,s),o===Gn.CLAMP_TO_GROUND&&(o=fi.getMinimumMaximumHeights(aT.computeRectangle(a,sde)).minimumTerrainHeight),a.extrudedHeight=o};Md.DynamicGeometryUpdater=Yb;function Yb(e,t,n){ai.call(this,e,t,n)}l(Object.create)&&(Yb.prototype=Object.create(ai.prototype),Yb.prototype.constructor=Yb);Yb.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||ai.prototype._isHidden.call(this,e,t,n)};Yb.prototype._setOptions=function(e,t,n){let i=this._options,r=Y.getValueOrUndefined(t.height,n),o=Y.getValueOrDefault(t.heightReference,n,ze.NONE),s=Y.getValueOrUndefined(t.extrudedHeight,n),a=Y.getValueOrDefault(t.extrudedHeightReference,n,ze.NONE);l(s)&&!l(r)&&(r=0),i.rectangle=Y.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.stRotation=Y.getValueOrUndefined(t.stRotation,n),i.rotation=Y.getValueOrUndefined(t.rotation,n),i.offsetAttribute=Gn.computeGeometryOffsetAttribute(r,o,s,a),i.height=Gn.getGeometryHeight(r,o),s=Gn.getGeometryExtrudedHeight(s,a),s===Gn.CLAMP_TO_GROUND&&(s=fi.getMinimumMaximumHeights(aT.computeRectangle(i,sde)).minimumTerrainHeight),i.extrudedHeight=s};var u3=Md;var ade=new z,set=new Tt,aet=new Tt,cet=h.ZERO,uet=new h;function Bd(e,t,n,i,r,o,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.depthFailMaterial=void 0,this.closed=o,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new xt,this.updaters=new xt,this.updatersWithAttributes=new xt,this.attributes=new xt,this.subscriptions=new xt,this.showsUpdated=new xt,this.itemsToRemove=[],this.invalidated=!1;let a;l(r)&&(a=r.definitionChanged.addEventListener(Bd.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}Bd.prototype.onMaterialChanged=function(){this.invalidated=!0};Bd.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};Bd.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!Y.isConstant(e.distanceDisplayConditionProperty)||!Y.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Bd.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Bd.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i);let c;l(this.depthFailAppearanceType)&&(l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=lo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),c=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new Tn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),r.add(i),t=!1}else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Dt)&&(this.depthFailMaterial=lo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let C=u.fillMaterialProperty.color,A=Y.getValueOrDefault(C,e,z.WHITE,ade);z.equals(d._lastColor,A)||(d._lastColor=z.clone(A,d._lastColor),d.color=Ot.toValue(A,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(l(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof Dt&&(!u.depthFailMaterialProperty.isConstant||c)){let C=u.depthFailMaterialProperty.color,A=Y.getValueOrDefault(C,e,z.WHITE,ade);z.equals(d._lastDepthFailColor,A)||(d._lastDepthFailColor=z.clone(A,d._lastDepthFailColor),d.depthFailColor=Ot.toValue(A,d.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=gn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let C=Y.getValueOrDefault(m,e,aet,set);Tt.equals(C,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Tt.clone(C,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=kn.toValue(C,d.distanceDisplayCondition))}let x=u.terrainOffsetProperty;if(!Y.isConstant(x)){let C=Y.getValueOrDefault(x,e,cet,uet);h.equals(C,d._lastOffset)||(d._lastOffset=h.clone(C,d._lastOffset),d.offset=nr.toValue(C,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Bd.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=gn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Bd.prototype.contains=function(e){return this.updaters.contains(e.id)};Bd.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return st.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?st.FAILED:(i.boundingSphere.clone(t),st.DONE)};Bd.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),l(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function Xb(e,t,n,i,r){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}Xb.prototype.add=function(e,t){let n,i,r=t.createFillGeometryInstance(e);r.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let o=n.length;for(let a=0;a<o;a++){let c=n[a];if(c.isMaterial(t)){c.add(t,r);return}}let s=new Bd(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,r),n.push(s)};function cde(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let r=e[i];if(r.remove(t))return r.updaters.length===0&&(e.splice(i,1),r.destroy()),!0}return!1}Xb.prototype.remove=function(e){cde(this._solidItems,e)||cde(this._translucentItems,e)};function lde(e,t,n){let i=!1,r=t.length;for(let o=0;o<r;++o){let s=t[o],a=s.itemsToRemove,c=a.length;if(c>0)for(o=0;o<c;o++){let u=a[o];s.remove(u),e.add(n,u),i=!0}}return i}function f3(e,t,n,i){let r=t.length,o;for(o=r-1;o>=0;o--){let s=t[o];if(s.invalidated){t.splice(o,1);let a=s.updaters.values,c=a.length;for(let u=0;u<c;u++)e.add(n,a[u]);s.destroy()}}for(r=t.length,o=0;o<r;++o)i=t[o].update(n)&&i;return i}Xb.prototype.update=function(e){let t=f3(this,this._solidItems,e,!0);t=f3(this,this._translucentItems,e,t)&&t;let n=lde(this,this._solidItems,e),i=lde(this,this._translucentItems,e);return(n||i)&&(t=f3(this,this._solidItems,e,t)&&t,t=f3(this,this._translucentItems,e,t)&&t),t};function ude(e,t,n){let i=e.length;for(let r=0;r<i;r++){let o=e[r];if(o.contains(t))return o.getBoundingSphere(t,n)}return st.FAILED}Xb.prototype.getBoundingSphere=function(e,t){let n=ude(this._solidItems,e,t);return n===st.FAILED?ude(this._translucentItems,e,t):n};function fde(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}Xb.prototype.removeAllPrimitives=function(){fde(this._solidItems),fde(this._translucentItems)};var Ld=Xb;var fet=new Tt,det=new Tt,het=h.ZERO,met=new h;function Nd(e,t,n,i,r,o,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.closed=o,this.shadows=s,this.updaters=new xt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new xt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new xt,this.attributes=new xt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Nd.prototype.onMaterialChanged,this),this.subscriptions=new xt,this.showsUpdated=new xt}Nd.prototype.onMaterialChanged=function(){this.invalidated=!0};Nd.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,r=e.depthFailMaterialProperty;if(n===t&&r===i)return!0;let o=l(t)&&t.equals(n);return o=(!l(i)&&!l(r)||l(i)&&i.equals(r))&&o,o};Nd.prototype.add=function(e,t){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!Y.isConstant(t.distanceDisplayConditionProperty)||!Y.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Nd.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var pet=new z;Nd.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=lo.getValue(e,this.materialProperty,this.material);let a;l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=lo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new Tn({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=lo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Dt)&&(this.depthFailMaterial=lo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Dt&&!c.depthFailMaterialProperty.isConstant){let C=c.depthFailMaterialProperty.color,A=Y.getValueOrDefault(C,e,z.WHITE,pet);z.equals(d._lastDepthFailColor,A)||(d._lastDepthFailColor=z.clone(A,d._lastDepthFailColor),d.depthFailColor=Ot.toValue(A,d.depthFailColor))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=gn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let C=Y.getValueOrDefault(m,e,det,fet);Tt.equals(C,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Tt.clone(C,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=kn.toValue(C,d.distanceDisplayCondition))}let x=c.terrainOffsetProperty;if(!Y.isConstant(x)){let C=Y.getValueOrDefault(x,e,het,met);h.equals(C,d._lastOffset)||(d._lastOffset=h.clone(C,d._lastOffset),d.offset=nr.toValue(C,d.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Nd.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=gn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Nd.prototype.contains=function(e){return this.updaters.contains(e.id)};Nd.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return st.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?st.FAILED:(i.boundingSphere.clone(t),st.DONE)};Nd.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function Kb(e,t,n,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}Kb.prototype.add=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let s=n[o];if(s.isMaterial(t)){s.add(e,t);return}}let r=new Nd(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);r.add(e,t),n.push(r)};Kb.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};Kb.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};Kb.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return st.FAILED};Kb.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var Fd=Kb;var _et=new z,get=new Tt,yet=new Tt;function Zp(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new xt,this.updaters=new xt,this.updatersWithAttributes=new xt,this.attributes=new xt,this.subscriptions=new xt,this.showsUpdated=new xt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new rT}Zp.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Zp.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!Y.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Zp.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Zp.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new dl({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),r.add(i,this.zIndex),t=!1;else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let x=u.fillMaterialProperty.color,C=Y.getValueOrDefault(x,e,z.WHITE,_et);z.equals(d._lastColor,C)||(d._lastColor=z.clone(C,d._lastColor),d.color=Ot.toValue(C,d.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=gn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let x=Y.getValueOrDefault(m,e,yet,get);Tt.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Tt.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=kn.toValue(x,d.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Zp.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=gn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Zp.prototype.contains=function(e){return this.updaters.contains(e.id)};Zp.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return st.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),st.DONE):st.FAILED};Zp.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function $b(e,t){this._batches=[],this._primitives=e,this._classificationType=t}$b.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,r=Y.getValueOrDefault(t.zIndex,0),o,s=i.length;for(let a=0;a<s;++a){let c=i[a];if(c.zIndex===r&&!c.overlapping(n.geometry.rectangle)){o=c;break}}return l(o)||(o=new Zp(this._primitives,this._classificationType,n.attributes.color.value,r),i.push(o)),o.add(t,n),o};$b.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};$b.prototype.update=function(e){let t,n,i=!0,r=this._batches,o=r.length;for(t=0;t<o;++t)i=r[t].update(e)&&i;for(t=0;t<o;++t){let s=r[t],a=s.itemsToRemove,c=a.length;for(let u=0;u<c;u++){n=a[u],s.remove(n);let f=this.add(e,n);s.isDirty=!0,f.isDirty=!0}}for(t=o-1;t>=0;--t){let s=r[t];s.isDirty&&(i=r[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&r.splice(t,1)}return i};$b.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return st.FAILED};$b.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var vD=$b;var xet=new Tt,Cet=new Tt;function vf(e,t,n,i,r,o){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new xt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new xt,this.material=void 0,this.updatersWithAttributes=new xt,this.attributes=new xt,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(vf.prototype.onMaterialChanged,this),this.subscriptions=new xt,this.showsUpdated=new xt,this.usingSphericalTextureCoordinates=r,this.zIndex=o,this.rectangleCollisionCheck=new rT}vf.prototype.onMaterialChanged=function(){this.invalidated=!0};vf.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};vf.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Dt&&t instanceof Dt?!0:l(t)&&t.equals(n)};vf.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!Y.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,s,a,c){s==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};vf.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t)),!0}return!1};vf.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=lo.getValue(e,this.materialProperty,this.material),n=new dl({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=lo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d));let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=gn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let x=Y.getValueOrDefault(m,e,Cet,xet);Tt.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Tt.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=kn.toValue(x,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};vf.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=gn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};vf.prototype.contains=function(e){return this.updaters.contains(e.id)};vf.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return st.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?st.FAILED:(i.boundingSphere.clone(t),st.DONE)};vf.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function Zb(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}Zb.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=ef.shouldUseSphericalCoordinates(r.geometry.rectangle),s=Y.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let u=n[c];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===o&&u.zIndex===s&&!u.overlapping(r.geometry.rectangle)){u.add(e,t,r);return}}let a=new vf(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,o,s);a.add(e,t,r),n.push(a)};Zb.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};Zb.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};Zb.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return st.FAILED};Zb.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var d3=Zb;var Aet=new z,Tet=new Tt,bet=new Tt,Eet=h.ZERO,wet=new h;function Jp(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new xt,this.updaters=new xt,this.updatersWithAttributes=new xt,this.attributes=new xt,this.itemsToRemove=[],this.subscriptions=new xt,this.showsUpdated=new xt}Jp.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantOutline||!e.outlineColorProperty.isConstant||!Y.isConstant(e.distanceDisplayConditionProperty)||!Y.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Jp.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Jp.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new Tn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new rn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),r.add(i),t=!1;else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.outlineColorProperty.isConstant||c){let C=u.outlineColorProperty,A=Y.getValueOrDefault(C,e,z.WHITE,Aet);z.equals(d._lastColor,A)||(d._lastColor=z.clone(A,d._lastColor),d.color=Ot.toValue(A,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),g=d.show[0]===1;p!==g&&(d.show=gn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let C=Y.getValueOrDefault(m,e,bet,Tet);Tt.equals(C,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Tt.clone(C,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=kn.toValue(C,d.distanceDisplayCondition))}let x=u.terrainOffsetProperty;if(!Y.isConstant(x)){let C=Y.getValueOrDefault(x,e,Eet,wet);h.equals(C,d._lastOffset)||(d._lastOffset=h.clone(C,d._lastOffset),d.offset=nr.toValue(C,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Jp.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=gn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Jp.prototype.contains=function(e){return this.updaters.contains(e.id)};Jp.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return st.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?st.FAILED:(i.boundingSphere.clone(t),st.DONE)};Jp.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function Jb(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new xt,this._translucentBatches=new xt}Jb.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),r,o;n.attributes.color.value[3]===255?(r=this._solidBatches,o=r.get(i),l(o)||(o=new Jp(this._primitives,!1,i,this._shadows),r.set(i,o)),o.add(t,n)):(r=this._translucentBatches,o=r.get(i),l(o)||(o=new Jp(this._primitives,!0,i,this._shadows),r.set(i,o)),o.add(t,n))};Jb.prototype.remove=function(e){let t,n=this._solidBatches.values,i=n.length;for(t=0;t<i;t++)if(n[t].remove(e))return;let r=this._translucentBatches.values,o=r.length;for(t=0;t<o;t++)if(r[t].remove(e))return};Jb.prototype.update=function(e){let t,n,i,r,o=this._solidBatches.values,s=o.length,a=this._translucentBatches.values,c=a.length,u,f=!0,d=!1;do{for(d=!1,n=0;n<s;n++){r=o[n],f=r.update(e),u=r.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],r.remove(i),this.add(e,i)}for(n=0;n<c;n++){r=a[n],f=r.update(e),u=r.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],r.remove(i),this.add(e,i)}}while(d);return f};Jb.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,r=i.length;for(n=0;n<r;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let o=this._translucentBatches.values,s=o.length;for(n=0;n<s;n++){let a=o[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return st.FAILED};Jb.prototype.removeAllPrimitives=function(){let e,t=this._solidBatches.values,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._translucentBatches.values,r=i.length;for(e=0;e<r;e++)i[e].removeAllPrimitives()};var DD=Jb;var dde=new z;function vet(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function Vd(e,t){ci.call(this,{entity:e,scene:t,geometryOptions:new vet(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(Vd.prototype=Object.create(ci.prototype),Vd.prototype.constructor=Vd);Vd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Dt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,dde)),l(c)||(c=z.WHITE),r=Ot.fromColor(c),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};return new pt({id:t,geometry:new tR(this._options),attributes:i})};Vd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,dde),r=this._distanceDisplayConditionProperty.getValue(e);return new pt({id:t,geometry:new nR(this._options),attributes:{show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ot.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(r)}})};Vd.prototype._isHidden=function(e,t){return!l(t.positions)||ci.prototype._isHidden.call(this,e,t)};Vd.prototype._getIsClosed=function(e){return!1};Vd.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!Y.isConstant(t.minimumHeights)||!Y.isConstant(t.maximumHeights)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.granularity)};Vd.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,r=t.granularity,o=this._materialProperty instanceof Dt,s=this._options;s.vertexFormat=o?rn.VERTEX_FORMAT:lr.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(ke.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(ke.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(ke.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(r)?r.getValue(ke.MINIMUM_VALUE):void 0};Vd.DynamicGeometryUpdater=Qb;function Qb(e,t,n){ai.call(this,e,t,n)}l(Object.create)&&(Qb.prototype=Object.create(ai.prototype),Qb.prototype.constructor=Qb);Qb.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||ai.prototype._isHidden.call(this,e,t,n)};Qb.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=Y.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=Y.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=Y.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=Y.getValueOrUndefined(t.granularity,n)};var h3=Vd;var Det=[],hde=[RL,Y2,H2,o3,s3,a3,c3,l3,u3,h3];function PD(e,t){this.entity=e,this.scene=t;let n=new Array(hde.length),i=new ge;function r(s){i.raiseEvent(s)}let o=new Yo;for(let s=0;s<n.length;s++){let a=new hde[s](e,t);o.add(a.geometryChanged,r),n[s]=a}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(PD.prototype._onEntityPropertyChanged,this)}PD.prototype._onEntityPropertyChanged=function(e,t,n,i){let r=this.updaters;for(let o=0;o<r.length;o++)r[o]._onEntityPropertyChanged(e,t,n,i)};PD.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};PD.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),ue(this)};function Df(e,t,n,i){n=y(n,e.primitives),i=y(i,e.groundPrimitives),this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new xt,this._removedObjects=new xt,this._changedObjects=new xt;let r=Zt.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(r*2),this._closedColorBatches=new Array(r*2),this._closedMaterialBatches=new Array(r*2),this._openColorBatches=new Array(r*2),this._openMaterialBatches=new Array(r*2);let o=uo.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=o;let s;for(s=0;s<r;++s)this._outlineBatches[s]=new DD(n,e,s,!1),this._outlineBatches[r+s]=new DD(n,e,s,!0),this._closedColorBatches[s]=new Ld(n,rn,void 0,!0,s,!0),this._closedColorBatches[r+s]=new Ld(n,rn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new Fd(n,lr,void 0,!0,s,!0),this._closedMaterialBatches[r+s]=new Fd(n,lr,void 0,!0,s,!1),this._openColorBatches[s]=new Ld(n,rn,void 0,!1,s,!0),this._openColorBatches[r+s]=new Ld(n,rn,void 0,!1,s,!1),this._openMaterialBatches[s]=new Fd(n,lr,void 0,!1,s,!0),this._openMaterialBatches[r+s]=new Fd(n,lr,void 0,!1,s,!1);let a=qn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),u=[];if(o)for(s=0;s<a;++s)u.push(new d3(i,s,lr)),c[s]=new vD(i,s);else for(s=0;s<a;++s)c[s]=new vD(i,s);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new Hb(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new xt,this._updaterSets=new xt,this._entityCollection=t,t.collectionChanged.addEventListener(Df.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Det)}Df.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,s=o.values,a,c,u,f,d=this;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(x){d._removeUpdater(x),d._insertUpdaterIntoBatch(e,x)}):(r.push(c),n.push(c));for(a=r.length-1;a>-1;a--)c=r[a],u=c.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new PD(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(x){d._insertUpdaterIntoBatch(e,x)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(Df._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let p=!0,g=this._batches,m=g.length;for(a=0;a<m;a++)p=g[a].update(e)&&p;return p};var Pet=[],Iet=new re;Df.prototype.getBoundingSphere=function(e,t){let n=Pet,i=Iet,r=0,o=st.DONE,s=this._batches,a=s.length,c=e.id;if(!this._updaterSets.get(c))return st.FAILED;let u=this._updaterSets.get(c).updaters;for(let f=0;f<u.length;f++){let d=u[f];for(let p=0;p<a;p++){if(o=s[p].getBoundingSphere(d,i),o===st.PENDING)return st.PENDING;o===st.DONE&&(n[r]=re.clone(i,n[r]),r++)}}return r===0?st.FAILED:(n.length=r,re.fromBoundingSpheres(n,t),st.DONE)};Df.prototype.isDestroyed=function(){return!1};Df.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Df.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let r=this._updaterSets.values;for(n=r.length,e=0;e<n;e++)r[e].destroy();return this._updaterSets.removeAll(),ue(this)};Df.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Df.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=Zt.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(l(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let r=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof Dt?this._groundColorBatches[r].add(e,t):this._groundMaterialBatches[r].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Dt?l(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Dt?l(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};Df._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;!l(t.get(r))&&!l(n.get(r))&&n.set(r,i)};Df.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,r=this._removedObjects,o=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(r.set(a,c),o.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,r.remove(a)?o.set(a,c):i.set(a,c)};var m3=Df;var Oet=1,Ret="30px sans-serif",Met=$r.FILL,Bet=z.WHITE,Let=z.BLACK,Net=1,Fet=!1,Vet=new z(.165,.165,.165,.8),ket=new W(7,5),Uet=W.ZERO,zet=h.ZERO,Het=ze.NONE,Get=gi.CENTER,Wet=vn.CENTER,jet=new h,qet=new z,Yet=new z,Xet=new z,Ket=new W,$et=new h,Zet=new W,Jet=new St,Qet=new St,ett=new St,ttt=new Tt;function mde(e){this.entity=e,this.label=void 0,this.index=void 0}function u0(e,t){t.collectionChanged.addEventListener(u0.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new xt,this._onCollectionChanged(t,t.values,[],[])}u0.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._label,c,u=o.label,f=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),d;if(f&&(d=Y.getValueOrUndefined(s._position,e,jet),c=Y.getValueOrUndefined(a._text,e),f=l(d)&&l(c)),!f){_7(o,s,n);continue}Y.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=Y.getValueOrDefault(a._heightReference,e,Het);l(u)||(u=n.getLabel(s),u.id=s,o.label=u,p=h.equals(u.position,d)&&u.heightReference===g),u.show=!0,u.position=d,u.text=c,u.scale=Y.getValueOrDefault(a._scale,e,Oet),u.font=Y.getValueOrDefault(a._font,e,Ret),u.style=Y.getValueOrDefault(a._style,e,Met),u.fillColor=Y.getValueOrDefault(a._fillColor,e,Bet,qet),u.outlineColor=Y.getValueOrDefault(a._outlineColor,e,Let,Yet),u.outlineWidth=Y.getValueOrDefault(a._outlineWidth,e,Net),u.showBackground=Y.getValueOrDefault(a._showBackground,e,Fet),u.backgroundColor=Y.getValueOrDefault(a._backgroundColor,e,Vet,Xet),u.backgroundPadding=Y.getValueOrDefault(a._backgroundPadding,e,ket,Ket),u.pixelOffset=Y.getValueOrDefault(a._pixelOffset,e,Uet,Zet),u.eyeOffset=Y.getValueOrDefault(a._eyeOffset,e,zet,$et),u.heightReference=g,u.horizontalOrigin=Y.getValueOrDefault(a._horizontalOrigin,e,Get),u.verticalOrigin=Y.getValueOrDefault(a._verticalOrigin,e,Wet),u.translucencyByDistance=Y.getValueOrUndefined(a._translucencyByDistance,e,Jet),u.pixelOffsetScaleByDistance=Y.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,Qet),u.scaleByDistance=Y.getValueOrUndefined(a._scaleByDistance,e,ett),u.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e,ttt),u.disableDepthTestDistance=Y.getValueOrUndefined(a._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};u0.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return st.FAILED;let i=n.label;return t.center=h.clone(y(i._clampedPosition,i.position),t.center),t.radius=0,st.DONE};u0.prototype.isDestroyed=function(){return!1};u0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(u0.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return ue(this)};u0.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._label)&&l(o._position)&&s.set(o.id,new mde(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._label)&&l(o._position)?s.contains(o.id)||s.set(o.id,new mde(o)):(_7(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],_7(s.get(o.id),o,a),s.remove(o.id)};function _7(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var p3=u0;var ntt=1,itt=0,rtt=!0,ott=!0,stt=Zt.ENABLED,att=ze.NONE,ctt=z.RED,ltt=0,utt=z.WHITE,ftt=Ds.HIGHLIGHT,dtt=.5,htt=new W(1,1),mtt=new N,ptt=new N,pde=new z;function f0(e,t){t.collectionChanged.addEventListener(f0.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new xt,this._onCollectionChanged(t,t.values,[],[])}f0.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){let s=t[r],a=s._model,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),d;if(f&&(d=s.computeModelMatrix(e,mtt),c=De.createIfNeeded(Y.getValueOrUndefined(a._uri,e)),f=l(d)&&l(c)),!f){l(u)&&(u.modelPrimitive.show=!1);continue}let p=l(u)?u.modelPrimitive:void 0;if((!l(p)||c.url!==u.url)&&(l(p)&&(i.removeAndDestroy(p),delete n[s.id]),p=(zA.enableModelExperimental?wi:bp).fromGltf({url:c,incrementallyLoadTextures:Y.getValueOrDefault(a._incrementallyLoadTextures,e,rtt),scene:this._scene,marsOptions:a._marsOptions}),p.id=s,i.add(p),u={modelPrimitive:p,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFail:!1},n[s.id]=u,gtt(p,s,n)),p.show=!0,p.scale=Y.getValueOrDefault(a._scale,e,ntt),p.minimumPixelSize=Y.getValueOrDefault(a._minimumPixelSize,e,itt),p.maximumScale=Y.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=N.clone(d,p.modelMatrix),p.shadows=Y.getValueOrDefault(a._shadows,e,stt),p.heightReference=Y.getValueOrDefault(a._heightReference,e,att),p.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=Y.getValueOrDefault(a._silhouetteColor,e,ctt,pde),p.silhouetteSize=Y.getValueOrDefault(a._silhouetteSize,e,ltt),p.color=Y.getValueOrDefault(a._color,e,utt,pde),p.colorBlendMode=Y.getValueOrDefault(a._colorBlendMode,e,ftt),p.colorBlendAmount=Y.getValueOrDefault(a._colorBlendAmount,e,dtt),p.clippingPlanes=Y.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=Y.getValueOrDefault(a._clampAnimations,e,ott),p.imageBasedLighting.imageBasedLightingFactor=Y.getValueOrDefault(a._imageBasedLightingFactor,e,htt),p.lightColor=Y.getValueOrUndefined(a._lightColor,e),p.ready){!a._readyOk&&a._marsOptions&&a._marsOptions.callback&&(a._marsOptions.callback(s,p),a._readyOk=!0);let g=Y.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==g&&(g?p.activeAnimations.addAll({loop:Xr.REPEAT}):p.activeAnimations.removeAll(),u.animationsRunning=g);let m=Y.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(l(m)){let A=Object.keys(m);for(let b=0,T=A.length;b<T;++b){let S=A[b],w=m[S];if(!l(w))continue;let D=p.getNode(S);if(!l(D))continue;let I=N.fromTranslationRotationScale(w,ptt);D.matrix=N.multiply(D.originalMatrix,I,I)}}let x=!1,C=Y.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(l(C)){let A=Object.keys(C);for(let b=0,T=A.length;b<T;++b){let S=A[b],w=C[S];!l(w)||(x=!0,p.setArticulationStage(S,w))}}x&&p.applyArticulations()}}return!0};f0.prototype.isDestroyed=function(){return!1};f0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(f0.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)g7(this,e[i],t,n);return ue(this)};f0.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n)||n.loadFail)return st.FAILED;let i=n.modelPrimitive;return!l(i)||!i.show?st.FAILED:i.ready?i.heightReference!==ze.NONE&&!l(i._clampedModelMatrix)?st.PENDING:(re.clone(i.boundingSphere,t),st.DONE):st.PENDING};f0.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],l(o._model)&&l(o._position)&&s.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],l(o._model)&&l(o._position)?(_tt(o,a),s.set(o.id,o)):(g7(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],g7(this,o,a,c),s.remove(o.id)};function g7(e,t,n,i){let r=n[t.id];l(r)&&(i.removeAndDestroy(r.modelPrimitive),delete n[t.id])}function _tt(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}function gtt(e,t,n){e.readyPromise.catch(function(i){console.error(i),n[t.id].loadFail=!0})}var _3=f0;function d0(e){this._definitionChanged=new ge,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(d0.prototype,{isConstant:{get:function(){return Y.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:sr.FIXED}}});d0.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,sr.FIXED,t)};d0.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};d0.prototype.getValueInReferenceFrame=function(e,t,n){if(!!l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?oe.WGS84.scaleToGeodeticSurface(n,n):void 0};d0.prototype.equals=function(e){return this===e||e instanceof d0&&this._value===e._value};d0.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Qp=d0;var ytt=60,xtt=1,yde=new Cn,y7=new Cn,x7=new Cn;function _de(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function Ctt(e,t,n,i,r,o,s,a,c){let u=a,f;f=e.getValueInReferenceFrame(t,o,c[u]),l(f)&&(c[u++]=f);let d=!l(r)||ee.lessThanOrEquals(r,t)||ee.greaterThanOrEquals(r,n),p=0,g=i.length,m=i[p],x=n,C=!1,A,b,T;for(;p<g;){if(!d&&ee.greaterThanOrEquals(m,r)&&(f=e.getValueInReferenceFrame(r,o,c[u]),l(f)&&(c[u++]=f),d=!0),ee.greaterThan(m,t)&&ee.lessThan(m,x)&&!m.equals(r)&&(f=e.getValueInReferenceFrame(m,o,c[u]),l(f)&&(c[u++]=f)),p<g-1){if(s>0&&!C){let S=i[p+1],w=ee.secondsDifference(S,m);C=w>s,C&&(A=Math.ceil(w/s),b=0,T=w/Math.max(A,2),A=Math.max(A-1,1))}if(C&&b<A){m=ee.addSeconds(m,T,new ee),b++;continue}}C=!1,p++,m=i[p]}return f=e.getValueInReferenceFrame(n,o,c[u]),l(f)&&(c[u++]=f),u}function Att(e,t,n,i,r,o,s,a){let c,u=0,f=s,d=t,p=Math.max(o,60),g=!l(i)||ee.lessThanOrEquals(i,t)||ee.greaterThanOrEquals(i,n);for(;ee.lessThan(d,n);)!g&&ee.greaterThanOrEquals(d,i)&&(g=!0,c=e.getValueInReferenceFrame(i,r,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,r,a[f]),l(c)&&(a[f]=c,f++),u++,d=ee.addSeconds(t,p*u,new ee);return c=e.getValueInReferenceFrame(n,r,a[f]),l(c)&&(a[f]=c,f++),f}function Ttt(e,t,n,i,r,o,s,a){x7.start=t,x7.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!Cn.intersect(d,x7,yde).isEmpty){let p=d.start;d.isStartIncluded||(d.isStopIncluded?p=d.stop:p=ee.addSeconds(d.start,ee.secondsDifference(d.stop,d.start)/2,new ee));let g=e.getValueInReferenceFrame(p,r,a[c]);l(g)&&(a[c]=g,c++)}}return c}function btt(e,t,n,i,r,o,s,a){let c=e.getValueInReferenceFrame(t,r,a[s]);return l(c)&&(a[s++]=c),s}function Ett(e,t,n,i,r,o,s,a){y7.start=t,y7.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!Cn.intersect(d,y7,yde).isEmpty){let p=d.start,g=d.stop,m=t;ee.greaterThan(p,m)&&(m=p);let x=n;ee.lessThan(g,x)&&(x=g),c=xde(d.data,m,x,i,r,o,c,a)}}return c}function xde(e,t,n,i,r,o,s,a){for(;e instanceof o0;)e=e.resolvedProperty;if(e instanceof ba){let c=e._property._times;s=Ctt(e,t,n,c,i,r,o,s,a)}else e instanceof Ta?s=Ett(e,t,n,i,r,o,s,a):e instanceof a0?s=Ttt(e,t,n,i,r,o,s,a):e instanceof hl||e instanceof Qp&&Y.isConstant(e)?s=btt(e,t,n,i,r,o,s,a):s=Att(e,t,n,i,r,o,s,a);return s}function Cde(e,t,n,i,r,o,s){l(s)||(s=[]);let a=xde(e,t,n,i,r,o,0,s);return s.length=a,s}var gde=new Q;function ID(e,t){this._unusedIndexes=[],this._polylineCollection=new kg,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}ID.prototype.update=function(e){if(this._referenceFrame===sr.INERTIAL){let t=yt.computeIcrfToFixedMatrix(e,gde);l(t)||(t=yt.computeTemeToPseudoFixedMatrix(e,gde)),N.fromRotationTranslation(t,h.ZERO,this._polylineCollection.modelMatrix)}};ID.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,r=n._position,o,s,a=i._show,c=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(u){let d=Y.getValueOrUndefined(i._leadTime,e),p=Y.getValueOrUndefined(i._trailTime,e),g=n._availability,m=l(g),x=l(d),C=l(p);if(u=m||x&&C,u){if(C&&(o=ee.addSeconds(e,-p,new ee)),x&&(s=ee.addSeconds(e,d,new ee)),m){let A=g.start,b=g.stop;(!C||ee.greaterThan(A,o))&&(o=A),(!x||ee.lessThan(b,s))&&(s=b)}u=ee.lessThan(o,s)}}if(!u){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);return}if(!l(c)){let d=this._unusedIndexes;if(d.length>0){let g=d.pop();c=this._polylineCollection.get(g),t.index=g}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=Y.getValueOrDefault(i._resolution,e,ytt);c.show=!0,c.positions=Cde(r,o,s,e,this._referenceFrame,f,c.positions.slice()),c.material=lo.getValue(e,i._material,c.material),c.width=Y.getValueOrDefault(i._width,e,xtt),c.distanceDisplayCondition=Y.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};ID.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};ID.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ue(this)};function h0(e,t){t.collectionChanged.addEventListener(h0.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new xt,this._onCollectionChanged(t,t.values,[],[])}h0.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,r=n.length;i<r;i++){let o=n[i],a=o.entity._position,c=o.updater,u=sr.FIXED;this._scene.mode===te.SCENE3D&&(u=a.referenceFrame);let f=this._updaters[u];if(c===f&&l(f)){f.updateObject(e,o);continue}l(c)&&c.removeObject(o),l(f)||(f=new ID(this._scene,u),f.update(e),this._updaters[u]=f),o.updater=f,l(f)&&f.updateObject(e,o)}return!0};h0.prototype.isDestroyed=function(){return!1};h0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(h0.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return ue(this)};h0.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s,a=this._items;for(r=t.length-1;r>-1;r--)o=t[r],l(o._path)&&l(o._position)&&a.set(o.id,new _de(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._path)&&l(o._position)?a.contains(o.id)||a.set(o.id,new _de(o)):(s=a.get(o.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(o.id)));for(r=n.length-1;r>-1;r--)o=n[r],s=a.get(o.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(o.id))};h0._subSample=Cde;var g3=h0;var Ade=z.WHITE,Tde=z.BLACK,bde=0,Ede=1,Sde=0,wde=new z,Stt=new h,vde=new z,Dde=new St,Pde=new St,Ide=new Tt;function Ode(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function m0(e,t){t.collectionChanged.addEventListener(m0.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new xt,this._onCollectionChanged(t,t.values,[],[])}m0.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._point,c=o.pointPrimitive,u=o.billboard,f=Y.getValueOrDefault(a._heightReference,e,ze.NONE),d=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),p;if(d&&(p=Y.getValueOrUndefined(s._position,e,Stt),d=l(p)),!d){OD(o,s,n);continue}Y.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,m=!1;if(f!==ze.NONE&&!l(u)?(l(c)&&(OD(o,s,n),c=void 0),u=n.getBillboard(s),u.id=s,u.image=void 0,o.billboard=u,g=!0,m=h.equals(u.position,p)&&u.heightReference===f):f===ze.NONE&&!l(c)&&(l(u)&&(OD(o,s,n),u=void 0),c=n.getPoint(s),c.id=s,o.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=Y.getValueOrUndefined(a._scaleByDistance,e,Dde),c.translucencyByDistance=Y.getValueOrUndefined(a._translucencyByDistance,e,Pde),c.color=Y.getValueOrDefault(a._color,e,Ade,wde),c.outlineColor=Y.getValueOrDefault(a._outlineColor,e,Tde,vde),c.outlineWidth=Y.getValueOrDefault(a._outlineWidth,e,bde),c.pixelSize=Y.getValueOrDefault(a._pixelSize,e,Ede),c.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e,Ide),c.disableDepthTestDistance=Y.getValueOrDefault(a._disableDepthTestDistance,e,Sde);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=Y.getValueOrUndefined(a._scaleByDistance,e,Dde),u.translucencyByDistance=Y.getValueOrUndefined(a._translucencyByDistance,e,Pde),u.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e,Ide),u.disableDepthTestDistance=Y.getValueOrDefault(a._disableDepthTestDistance,e,Sde),u.heightReference=f;let x=Y.getValueOrDefault(a._color,e,Ade,wde),C=Y.getValueOrDefault(a._outlineColor,e,Tde,vde),A=Math.round(Y.getValueOrDefault(a._outlineWidth,e,bde)),b=Math.max(1,Math.round(Y.getValueOrDefault(a._pixelSize,e,Ede)));if(A>0?(u.scale=1,g=g||A!==o.outlineWidth||b!==o.pixelSize||!z.equals(x,o.color)||!z.equals(C,o.outlineColor)):(u.scale=b/50,b=50,g=g||A!==o.outlineWidth||!z.equals(x,o.color)||!z.equals(C,o.outlineColor)),g){o.color=z.clone(x,o.color),o.outlineColor=z.clone(C,o.outlineColor),o.pixelSize=b,o.outlineWidth=A;let T=x.alpha,S=x.toCssColorString(),w=C.toCssColorString(),D=JSON.stringify([S,b,w,A]);u.setImage(D,lb(T,S,w,A,b))}m&&u._updateClamping()}}return!0};m0.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return st.FAILED;if(l(n.pointPrimitive))t.center=h.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return st.PENDING;t.center=h.clone(i._clampedPosition,t.center)}return t.radius=0,st.DONE};m0.prototype.isDestroyed=function(){return!1};m0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(m0.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return ue(this)};m0.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._point)&&l(o._position)&&s.set(o.id,new Ode(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._point)&&l(o._position)?s.contains(o.id)||s.set(o.id,new Ode(o)):(OD(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],OD(s.get(o.id),o,a),s.remove(o.id)};function OD(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let r=e.billboard;l(r)&&(e.billboard=void 0,n.removeBillboard(t))}}var y3=m0;var wtt=new Jn(0),x3={},Rde=new z,vtt=new Dt(z.WHITE),Dtt=new Jn(!0),Ptt=new Jn(Zt.DISABLED),Itt=new Jn(new Tt),Ott=new Jn(qn.BOTH);function Rtt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Mtt(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function kd(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(kd.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new ge,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new Rtt,this._groundGeometryOptions=new Mtt,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=uo.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(kd.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&Y.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}});kd.prototype.isOutlineVisible=function(e){return!1};kd.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e);return y(n,!1)};kd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new gn(n&&t.isShowing&&this._showProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=kn.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o},a;return this._materialProperty instanceof Dt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Rde)),l(a)||(a=z.WHITE),s.color=Ot.fromColor(a)),this.clampToGround?new pt({id:t,geometry:new qA(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Dt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,Rde)),l(a)||(a=z.WHITE),s.depthFailColor=Ot.fromColor(a)),new pt({id:t,geometry:new Z_(this._geometryOptions),attributes:s}))};kd.prototype.createOutlineGeometryInstance=function(e){};kd.prototype.isDestroyed=function(){return!1};kd.prototype.destroy=function(){this._entitySubscription(),ue(this)};kd.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let r=this._entity.polyline;if(!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.positions,s=r.show;if(l(s)&&s.isConstant&&!s.getValue(ke.MINIMUM_VALUE)||!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=r.zIndex,c=y(r.material,vtt),u=c instanceof Dt;this._materialProperty=c,this._depthFailMaterialProperty=r.depthFailMaterial,this._showProperty=y(s,Dtt),this._shadowsProperty=y(r.shadows,Ptt),this._distanceDisplayConditionProperty=y(r.distanceDisplayCondition,Itt),this._classificationTypeProperty=y(r.classificationType,Ott),this._fillEnabled=!0,this._zIndex=y(a,wtt);let f=r.width,d=r.arcType,p=r.clampToGround,g=r.granularity;if(!o.isConstant||!Y.isConstant(f)||!Y.isConstant(d)||!Y.isConstant(g)||!Y.isConstant(p)||!Y.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let m=this._geometryOptions,x=o.getValue(ke.MINIMUM_VALUE,m.positions);if(!l(x)||x.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let C;u&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Dt)?C=os.VERTEX_FORMAT:C=pa.VERTEX_FORMAT,m.vertexFormat=C,m.positions=x,m.width=l(f)?f.getValue(ke.MINIMUM_VALUE):void 0,m.arcType=l(d)?d.getValue(ke.MINIMUM_VALUE):void 0,m.granularity=l(g)?g.getValue(ke.MINIMUM_VALUE):void 0;let A=this._groundGeometryOptions;A.positions=x,A.width=m.width,A.arcType=m.arcType,A.granularity=m.granularity,this._clampToGround=l(p)?p.getValue(ke.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&Lt("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};kd.prototype.createDynamicUpdater=function(e,t){return new RD(e,t,this)};var eE={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function RD(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function Mde(e){if(l(e._line))return e._line;let t=e._geometryUpdater._scene.id,n=x3[t],i=e._primitives;!l(n)||n.isDestroyed()?(n=new kg,x3[t]=n,i.add(n)):i.contains(n)||i.add(n);let r=n.add();return r.id=e._geometryUpdater._entity,e._line=r,r}RD.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,r=i.positions,o=Y.getValueOrUndefined(r,e,this._positions);t._clampToGround=Y.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=o,t._groundGeometryOptions.width=Y.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=Y.getValueOrDefault(i._arcType,e,Kt.GEODESIC),t._groundGeometryOptions.granularity=Y.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!Y.getValueOrDefault(i._show,e,!0)||!l(o)||o.length<2)return;let f=t.fillMaterialProperty,d;if(f instanceof Dt)d=new os;else{let p=lo.getValue(e,f,this._material);d=new pa({material:p,translucent:p.isTranslucent()}),this._material=p}this._groundPolylinePrimitive=s.add(new zh({geometryInstances:t.createFillGeometryInstance(e),appearance:d,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),Y.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=Mde(this);if(!n.isShowing||!n.isAvailable(e)||!Y.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(o)||o.length<2){a.show=!1;return}let c=Kt.GEODESIC;c=Y.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe;c!==Kt.NONE&&l(u)&&(eE.ellipsoid=u.ellipsoid,eE.positions=o,eE.granularity=Y.getValueOrUndefined(i._granularity,e),eE.height=Ni.extractHeights(o,u.ellipsoid),c===Kt.GEODESIC?o=Ni.generateCartesianArc(eE):o=Ni.generateCartesianRhumbArc(eE)),a.show=!0,a.positions=o.slice(),a.material=lo.getValue(e,t.fillMaterialProperty,a.material),a.width=Y.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=Y.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};RD.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(l(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(l(n)&&l(n.boundingSphere))return re.clone(n.boundingSphere,e),st.DONE}return l(t)&&!t.ready?st.PENDING:st.DONE}else{let t=Mde(this);if(t.show&&t.positions.length>0)return re.fromPoints(t.positions,e),st.DONE}return st.FAILED};RD.prototype.isDestroyed=function(){return!1};RD.prototype.destroy=function(){let t=this._geometryUpdater._scene.id,n=x3[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete x3[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ue(this)};var C3=kd;var Btt=new z,Ltt=new Tt,Ntt=new Tt;function Ud(e,t,n,i,r){let o;n instanceof Dt?o=os:o=pa,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=o,this.materialProperty=n,this.updaters=new xt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new xt,this.material=void 0,this.updatersWithAttributes=new xt,this.attributes=new xt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Ud.prototype.onMaterialChanged,this),this.subscriptions=new xt,this.showsUpdated=new xt,this.zIndex=i,this._asynchronous=r}Ud.prototype.onMaterialChanged=function(){this.invalidated=!0};Ud.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Dt&&t instanceof Dt?!0:l(t)&&t.equals(n)};Ud.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!Y.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,s,a,c){s==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Ud.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};Ud.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new zh({show:!1,asynchronous:this._asynchronous,geometryInstances:r.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===pa&&(this.material=lo.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===pa&&(this.material=lo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!c.fillMaterialProperty.isConstant){let x=c.fillMaterialProperty.color,C=Y.getValueOrDefault(x,e,z.WHITE,Btt);z.equals(d._lastColor,C)||(d._lastColor=z.clone(C,d._lastColor),d.color=Ot.toValue(C,d.color))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=gn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let x=Y.getValueOrDefault(m,e,Ntt,Ltt);Tt.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Tt.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=kn.toValue(x,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Ud.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=gn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Ud.prototype.contains=function(e){return this.updaters.contains(e.id)};Ud.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return st.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?st.FAILED:(i.boundingSphere.clone(t),st.DONE)};Ud.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function tE(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=y(n,!0)}tE.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=Y.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===o){c.add(e,t,r);return}}let s=new Ud(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,o,this._asynchronous);s.add(e,t,r),n.push(s)};tE.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};tE.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};tE.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return st.FAILED};tE.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var A3=tE;var Ftt=[];function Bde(e,t){let n=e._batches,i=n.length;for(let r=0;r<i;r++)n[r].remove(t)}function Lde(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let s=n.classificationTypeProperty.getValue(t);e._groundBatches[s].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let r=0;l(n.depthFailMaterialProperty)&&(r=n.depthFailMaterialProperty instanceof Dt?1:2);let o;l(i)&&(o=i+r*Zt.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Dt?e._colorBatches[o].add(t,n):e._materialBatches[o].add(t,n))}function pm(e,t,n,i){i=y(i,e.groundPrimitives),n=y(n,e.primitives),this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new xt,this._removedObjects=new xt,this._changedObjects=new xt;let r,o=Zt.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(o*3),this._materialBatches=new Array(o*3),r=0;r<o;++r)this._colorBatches[r]=new Ld(n,os,void 0,!1,r),this._materialBatches[r]=new Fd(n,pa,void 0,!1,r),this._colorBatches[r+o]=new Ld(n,os,os,!1,r),this._materialBatches[r+o]=new Fd(n,pa,os,!1,r),this._colorBatches[r+o*2]=new Ld(n,os,pa,!1,r),this._materialBatches[r+o*2]=new Fd(n,pa,pa,!1,r);this._dynamicBatch=new Hb(n,i);let s=qn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),r=0;r<s;++r)this._groundBatches[r]=new A3(i,r);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new xt,this._updaters=new xt,this._entityCollection=t,t.collectionChanged.addEventListener(pm.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Ftt)}pm.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,s=o.values,a,c,u,f;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaters.get(u),f.entity===c?(Bde(this,f),Lde(this,e,f)):(r.push(c),n.push(c));for(a=r.length-1;a>-1;a--)c=r[a],u=c.id,f=this._updaters.get(u),Bde(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new C3(c,this._scene),this._updaters.set(u,f),Lde(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(pm._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let d=!0,p=this._batches,g=p.length;for(a=0;a<g;a++)d=p[a].update(e)&&d;return d};var Vtt=[],ktt=new re;pm.prototype.getBoundingSphere=function(e,t){let n=Vtt,i=ktt,r=0,o=st.DONE,s=this._batches,a=s.length,c=this._updaters.get(e.id);if(!c)return st.FAILED;for(let u=0;u<a;u++){if(o=s[u].getBoundingSphere(c,i),o===st.PENDING)return st.PENDING;o===st.DONE&&(n[r]=re.clone(i,n[r]),r++)}return r===0?st.FAILED:(n.length=r,re.fromBoundingSpheres(n,t),st.DONE)};pm.prototype.isDestroyed=function(){return!1};pm.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(pm.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),ue(this)};pm._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;!l(t.get(r))&&!l(n.get(r))&&n.set(r,i)};pm.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,r=this._removedObjects,o=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(r.set(a,c),o.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,r.remove(a)?o.set(a,c):i.set(a,c)};var T3=pm;function Pf(e){dl.initializeTerrainHeights(),zh.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Yo,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=y(e.visualizersCallback,Pf.defaultVisualizersCallback);let i=!1,r=new du,o=new du;n.length>0&&(t.primitives.add(r),t.groundPrimitives.add(o),i=!0),this._primitives=r,this._groundPrimitives=o;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let s=new q2;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let u=this,f=function(){t.primitives.add(r),t.groundPrimitives.add(o),a(),c(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(f),c=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}Pf.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new rR(t,i),new m3(e,i,n._primitives,n._groundPrimitives),new p3(t,i),new _3(e,i),new k2(e,i),new y3(t,i),new g3(e,i),new T3(e,i,n._primitives,n._groundPrimitives)]};Object.defineProperties(Pf.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}});Pf.prototype.isDestroyed=function(){return!1};Pf.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),l(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),ue(this)};Pf.prototype.update=function(e){if(!fi.initialized)return this._ready=!1,!1;let t=!0,n,i,r,o,s=this._dataSourceCollection,a=s.length;for(n=0;n<a;n++){let c=s.get(n);for(l(c.update)&&(t=c.update(e)&&t),r=c._visualizers,o=r.length,i=0;i<o;i++)t=r[i].update(e)&&t}for(r=this._defaultDataSource._visualizers,o=r.length,i=0;i<o;i++)t=r[i].update(e)&&t;return this._ready=t,t};Pf.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let r=t.get(i),o=r.credit;l(o)&&e.creditDisplay.addCredit(o);let s=r._resourceCredits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCredit(s[c])}}};var Utt=[],ztt=new re;Pf.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return st.PENDING;let i,r,o=this._defaultDataSource;if(!o.entities.contains(e)){o=void 0;let p=this._dataSourceCollection;for(r=p.length,i=0;i<r;i++){let g=p.get(i);if(g.entities.contains(e)){o=g;break}}}if(!l(o))return st.FAILED;let s=Utt,a=ztt,c=0,u=st.DONE,f=o._visualizers,d=f.length;for(i=0;i<d;i++){let p=f[i];if(l(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,a),!t&&u===st.PENDING)return st.PENDING;u===st.DONE&&(s[c]=re.clone(a,s[c]),c++)}}return c===0?st.FAILED:(s.length=c,re.fromBoundingSpheres(s,n),st.DONE)};Pf.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,r=this._groundPrimitives,o=i.add(new du),s=r.add(new r3);t._primitives=o,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),o.add(a),t._visualizers=this._visualizersCallback(n,a,t)};Pf.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,r=t._primitives,o=t._groundPrimitives,s=t.clustering;r.remove(s);let a=t._visualizers,c=a.length;for(let u=0;u<c;u++)a[u].destroy();n.remove(r),i.remove(o),t._visualizers=void 0};Pf.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,r=this._groundPrimitives,o=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(o),r.raise(s)):t===n-1?(i.lower(o),r.lower(s)):t===0?(i.lowerToBottom(o),r.lowerToBottom(s),i.raise(o),r.raise(s)):(i.raiseToTop(o),r.raiseToTop(s))};var b3=Pf;var Nde=new Q,Fde=new Q,Vde=new Q,Htt=new N,E3=new h,kde=new h,C7=new h,A7=new h,Ude=new h,zde=new h,nE=new ee,Gtt=1.25;function Wtt(e,t,n,i,r,o,s){let a=e.scene.mode,c=r.getValue(o,e._lastCartesian);if(l(c)){let u=!1,f=!1,d,p,g;if(a===te.SCENE3D){ee.addSeconds(o,.001,nE);let b=r.getValue(nE,E3);if(l(b)||(ee.addSeconds(o,-.001,nE),b=r.getValue(nE,E3),f=!0),l(b)){let T=yt.computeFixedToIcrfMatrix(o,Nde),S=yt.computeFixedToIcrfMatrix(nE,Fde),w;!l(T)||!l(S)?(w=yt.computeTemeToPseudoFixedMatrix(o,Vde),T=Q.transpose(w,Nde),S=yt.computeTemeToPseudoFixedMatrix(nE,Fde),Q.transpose(S,S)):w=Q.transpose(T,Vde);let D=Q.multiplyByVector(T,c,Ude),I=Q.multiplyByVector(S,b,zde);h.subtract(D,I,A7);let O=h.magnitude(A7)*1e3,B=M.GRAVITATIONALPARAMETER,L=-B/(O*O-2*B/h.magnitude(D));L<0||L>Gtt*s.maximumRadius?(d=kde,h.normalize(c,d),h.negate(d,d),g=h.clone(h.UNIT_Z,C7),p=h.cross(g,d,E3),h.magnitude(p)>M.EPSILON7&&(h.normalize(d,d),h.normalize(p,p),g=h.cross(d,p,C7),h.normalize(g,g),u=!0)):h.equalsEpsilon(c,b,M.EPSILON7)||(g=kde,h.normalize(D,g),h.normalize(I,I),p=h.cross(g,I,C7),f&&(p=h.multiplyByScalar(p,-1,p)),h.equalsEpsilon(p,h.ZERO,M.EPSILON7)||(d=h.cross(p,g,E3),Q.multiplyByVector(w,d,d),Q.multiplyByVector(w,p,p),Q.multiplyByVector(w,g,g),h.normalize(d,d),h.normalize(p,p),h.normalize(g,g),u=!0))}}l(e.boundingSphere)&&(c=e.boundingSphere.center);let m,x,C;i&&(m=h.clone(t.position,A7),x=h.clone(t.direction,Ude),C=h.clone(t.up,zde));let A=Htt;u?(A[0]=d.x,A[1]=d.y,A[2]=d.z,A[3]=0,A[4]=p.x,A[5]=p.y,A[6]=p.z,A[7]=0,A[8]=g.x,A[9]=g.y,A[10]=g.z,A[11]=0,A[12]=c.x,A[13]=c.y,A[14]=c.z,A[15]=0):yt.eastNorthUpToFixedFrame(c,s,A),t._setTransform(A),i&&(h.clone(m,t.position),h.clone(x,t.direction),h.clone(C,t.up),h.cross(x,C,t.right))}if(n){let u=a===te.SCENE2D||h.equals(e._offset3D,h.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,u)}}function MD(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=y(n,oe.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new h,this._defaultOffset3D=void 0,this._offset3D=new h}Object.defineProperties(MD,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});MD.defaultOffset3D=new h(-14e3,3500,3500);var S3=new ju,jtt=new h;MD.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,r=n.mode;if(r===te.MORPHING)return;let o=this.entity,s=o.position;if(!l(s))return;let a=o!==this._lastEntity,c=r!==this._mode,u=n.camera,f=a||c,d=!0;if(a){let p=o.viewFrom,g=l(p);if(!g&&l(t)){S3.pitch=-M.PI_OVER_FOUR,S3.range=0;let m=s.getValue(e,jtt);if(l(m)){let x=2-1/Math.max(1,h.magnitude(m)/i.maximumRadius);S3.pitch*=x}u.viewBoundingSphere(t,S3),this.boundingSphere=t,f=!1,d=!1}else(!g||!l(p.getValue(e,this._offset3D)))&&h.clone(MD._defaultOffset3D,this._offset3D)}else!c&&this._mode!==te.SCENE2D&&h.clone(u.position,this._offset3D);this._lastEntity=o,this._mode=r,Wtt(this,u,f,d,s,e,i)};var w3=MD;var ec={};MX(ec,{BlobReader:()=>z3,BlobWriter:()=>VD,Data64URIReader:()=>F7,Data64URIWriter:()=>V7,ERR_ABORT:()=>O7,ERR_BAD_FORMAT:()=>J3,ERR_CENTRAL_DIRECTORY_NOT_FOUND:()=>Jhe,ERR_DUPLICATED_NAME:()=>lme,ERR_ENCRYPTED:()=>tme,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:()=>Zhe,ERR_EOCDR_NOT_FOUND:()=>Khe,ERR_EOCDR_ZIP64_NOT_FOUND:()=>$he,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:()=>eme,ERR_HTTP_RANGE:()=>FD,ERR_INVALID_COMMENT:()=>ume,ERR_INVALID_ENCRYPTION_STRENGTH:()=>hme,ERR_INVALID_ENTRY_COMMENT:()=>fme,ERR_INVALID_ENTRY_NAME:()=>dme,ERR_INVALID_EXTRAFIELD_DATA:()=>pme,ERR_INVALID_EXTRAFIELD_TYPE:()=>mme,ERR_INVALID_PASSWORD:()=>$x,ERR_INVALID_SIGNATURE:()=>zD,ERR_INVALID_VERSION:()=>bj,ERR_LOCAL_FILE_HEADER_NOT_FOUND:()=>Qhe,ERR_UNSUPPORTED_COMPRESSION:()=>lj,ERR_UNSUPPORTED_ENCRYPTION:()=>nme,ERR_UNSUPPORTED_FORMAT:()=>uV,HttpRangeReader:()=>G7,HttpReader:()=>H3,Reader:()=>gm,TextReader:()=>L7,TextWriter:()=>N7,Uint8ArrayReader:()=>W7,Uint8ArrayWriter:()=>j7,Writer:()=>Kx,ZipReader:()=>uj,ZipWriter:()=>Ej,configure:()=>P7,getMimeType:()=>ghe});function Wde(e){return jde(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function jde(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?jde(n):n),[])}var Hde=[0,1,2,3].concat(...Wde([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function _o(){let e=this;function t(r){let o=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,u=e.stat_desc.max_length,f,d,p,g,m,x,C=0;for(g=0;g<=15;g++)r.bl_count[g]=0;for(o[r.heap[r.heap_max]*2+1]=0,f=r.heap_max+1;f<573;f++)d=r.heap[f],g=o[o[d*2+1]*2+1]+1,g>u&&(g=u,C++),o[d*2+1]=g,!(d>e.max_code)&&(r.bl_count[g]++,m=0,d>=c&&(m=a[d-c]),x=o[d*2],r.opt_len+=x*(g+m),s&&(r.static_len+=x*(s[d*2+1]+m)));if(C!==0){do{for(g=u-1;r.bl_count[g]===0;)g--;r.bl_count[g]--,r.bl_count[g+1]+=2,r.bl_count[u]--,C-=2}while(C>0);for(g=u;g!==0;g--)for(d=r.bl_count[g];d!==0;)p=r.heap[--f],!(p>e.max_code)&&(o[p*2+1]!=g&&(r.opt_len+=(g-o[p*2+1])*o[p*2],o[p*2+1]=g),d--)}}function n(r,o){let s=0;do s|=r&1,r>>>=1,s<<=1;while(--o>0);return s>>>1}function i(r,o,s){let a=[],c=0,u,f,d;for(u=1;u<=15;u++)a[u]=c=c+s[u-1]<<1;for(f=0;f<=o;f++)d=r[f*2+1],d!==0&&(r[f*2]=n(a[d]++,d))}e.build_tree=function(r){let o=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,c,u,f=-1,d;for(r.heap_len=0,r.heap_max=573,c=0;c<a;c++)o[c*2]!==0?(r.heap[++r.heap_len]=f=c,r.depth[c]=0):o[c*2+1]=0;for(;r.heap_len<2;)d=r.heap[++r.heap_len]=f<2?++f:0,o[d*2]=1,r.depth[d]=0,r.opt_len--,s&&(r.static_len-=s[d*2+1]);for(e.max_code=f,c=Math.floor(r.heap_len/2);c>=1;c--)r.pqdownheap(o,c);d=a;do c=r.heap[1],r.heap[1]=r.heap[r.heap_len--],r.pqdownheap(o,1),u=r.heap[1],r.heap[--r.heap_max]=c,r.heap[--r.heap_max]=u,o[d*2]=o[c*2]+o[u*2],r.depth[d]=Math.max(r.depth[c],r.depth[u])+1,o[c*2+1]=o[u*2+1]=d,r.heap[1]=d++,r.pqdownheap(o,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],t(r),i(o,e.max_code,r.bl_count)}}_o._length_code=[0,1,2,3,4,5,6,7].concat(...Wde([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));_o.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];_o.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];_o.d_code=function(e){return e<256?Hde[e]:Hde[256+(e>>>7)]};_o.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];_o.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];_o.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];_o.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Ea(e,t,n,i,r){let o=this;o.static_tree=e,o.extra_bits=t,o.extra_base=n,o.elems=i,o.max_length=r}Ea.static_ltree=[12,8,140,8,76,8,204,8,44,8,172,8,108,8,236,8,28,8,156,8,92,8,220,8,60,8,188,8,124,8,252,8,2,8,130,8,66,8,194,8,34,8,162,8,98,8,226,8,18,8,146,8,82,8,210,8,50,8,178,8,114,8,242,8,10,8,138,8,74,8,202,8,42,8,170,8,106,8,234,8,26,8,154,8,90,8,218,8,58,8,186,8,122,8,250,8,6,8,134,8,70,8,198,8,38,8,166,8,102,8,230,8,22,8,150,8,86,8,214,8,54,8,182,8,118,8,246,8,14,8,142,8,78,8,206,8,46,8,174,8,110,8,238,8,30,8,158,8,94,8,222,8,62,8,190,8,126,8,254,8,1,8,129,8,65,8,193,8,33,8,161,8,97,8,225,8,17,8,145,8,81,8,209,8,49,8,177,8,113,8,241,8,9,8,137,8,73,8,201,8,41,8,169,8,105,8,233,8,25,8,153,8,89,8,217,8,57,8,185,8,121,8,249,8,5,8,133,8,69,8,197,8,37,8,165,8,101,8,229,8,21,8,149,8,85,8,213,8,53,8,181,8,117,8,245,8,13,8,141,8,77,8,205,8,45,8,173,8,109,8,237,8,29,8,157,8,93,8,221,8,61,8,189,8,125,8,253,8,19,9,275,9,147,9,403,9,83,9,339,9,211,9,467,9,51,9,307,9,179,9,435,9,115,9,371,9,243,9,499,9,11,9,267,9,139,9,395,9,75,9,331,9,203,9,459,9,43,9,299,9,171,9,427,9,107,9,363,9,235,9,491,9,27,9,283,9,155,9,411,9,91,9,347,9,219,9,475,9,59,9,315,9,187,9,443,9,123,9,379,9,251,9,507,9,7,9,263,9,135,9,391,9,71,9,327,9,199,9,455,9,39,9,295,9,167,9,423,9,103,9,359,9,231,9,487,9,23,9,279,9,151,9,407,9,87,9,343,9,215,9,471,9,55,9,311,9,183,9,439,9,119,9,375,9,247,9,503,9,15,9,271,9,143,9,399,9,79,9,335,9,207,9,463,9,47,9,303,9,175,9,431,9,111,9,367,9,239,9,495,9,31,9,287,9,159,9,415,9,95,9,351,9,223,9,479,9,63,9,319,9,191,9,447,9,127,9,383,9,255,9,511,9,0,7,64,7,32,7,96,7,16,7,80,7,48,7,112,7,8,7,72,7,40,7,104,7,24,7,88,7,56,7,120,7,4,7,68,7,36,7,100,7,20,7,84,7,52,7,116,7,3,8,131,8,67,8,195,8,35,8,163,8,99,8,227,8];Ea.static_dtree=[0,5,16,5,8,5,24,5,4,5,20,5,12,5,28,5,2,5,18,5,10,5,26,5,6,5,22,5,14,5,30,5,1,5,17,5,9,5,25,5,5,5,21,5,13,5,29,5,3,5,19,5,11,5,27,5,7,5,23,5];Ea.static_l_desc=new Ea(Ea.static_ltree,_o.extra_lbits,256+1,286,15);Ea.static_d_desc=new Ea(Ea.static_dtree,_o.extra_dbits,0,30,15);Ea.static_bl_desc=new Ea(null,_o.extra_blbits,0,19,7);var qtt=9,Ytt=8;function _m(e,t,n,i,r){let o=this;o.good_length=e,o.max_lazy=t,o.nice_length=n,o.max_chain=i,o.func=r}var qde=0,O3=1,Yx=2,zd=[new _m(0,0,0,0,qde),new _m(4,4,8,4,O3),new _m(4,5,16,8,O3),new _m(4,6,32,32,O3),new _m(4,4,16,16,Yx),new _m(8,16,32,32,Yx),new _m(8,16,128,128,Yx),new _m(8,32,128,256,Yx),new _m(32,128,258,1024,Yx),new _m(32,258,258,4096,Yx)],v3=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],If=0,D3=1,BD=2,P3=3,Xtt=32,T7=42,I3=113,LD=666,b7=8,Ktt=0,E7=1,$tt=2,wo=3,R3=258,pu=R3+wo+1;function Gde(e,t,n,i){let r=e[t*2],o=e[n*2];return r<o||r==o&&i[t]<=i[n]}function Ztt(){let e=this,t,n,i,r,o,s,a,c,u,f,d,p,g,m,x,C,A,b,T,S,w,D,I,O,B,L,_,E,v,P,R,F,U,k=new _o,H=new _o,V=new _o;e.depth=[];let q,j,X,G,$,J,ce,de;e.bl_count=[],e.heap=[],R=[],F=[],U=[];function ie(){u=2*o,d[g-1]=0;for(let He=0;He<g-1;He++)d[He]=0;L=zd[_].max_lazy,v=zd[_].good_length,P=zd[_].nice_length,B=zd[_].max_chain,w=0,A=0,I=0,b=O=wo-1,S=0,p=0}function ae(){let He;for(He=0;He<286;He++)R[He*2]=0;for(He=0;He<30;He++)F[He*2]=0;for(He=0;He<19;He++)U[He*2]=0;R[256*2]=1,e.opt_len=e.static_len=0,X=$=0}function _e(){k.dyn_tree=R,k.stat_desc=Ea.static_l_desc,H.dyn_tree=F,H.stat_desc=Ea.static_d_desc,V.dyn_tree=U,V.stat_desc=Ea.static_bl_desc,ce=0,de=0,J=8,ae()}e.pqdownheap=function(He,We){let Ue=e.heap,Je=Ue[We],gt=We<<1;for(;gt<=e.heap_len&&(gt<e.heap_len&&Gde(He,Ue[gt+1],Ue[gt],e.depth)&>++,!Gde(He,Je,Ue[gt],e.depth));)Ue[We]=Ue[gt],We=gt,gt<<=1;Ue[We]=Je};function be(He,We){let Ue=-1,Je,gt=He[0*2+1],cn=0,Rn=7,$i=4;gt===0&&(Rn=138,$i=3),He[(We+1)*2+1]=65535;for(let Nr=0;Nr<=We;Nr++)Je=gt,gt=He[(Nr+1)*2+1],!(++cn<Rn&&Je==gt)&&(cn<$i?U[Je*2]+=cn:Je!==0?(Je!=Ue&&U[Je*2]++,U[16*2]++):cn<=10?U[17*2]++:U[18*2]++,cn=0,Ue=Je,gt===0?(Rn=138,$i=3):Je==gt?(Rn=6,$i=3):(Rn=7,$i=4))}function Te(){let He;for(be(R,k.max_code),be(F,H.max_code),V.build_tree(e),He=19-1;He>=3&&U[_o.bl_order[He]*2+1]===0;He--);return e.opt_len+=3*(He+1)+5+5+4,He}function Oe(He){e.pending_buf[e.pending++]=He}function Be(He){Oe(He&255),Oe(He>>>8&255)}function tt(He){Oe(He>>8&255),Oe(He&255&255)}function lt(He,We){let Ue,Je=We;de>16-Je?(Ue=He,ce|=Ue<<de&65535,Be(ce),ce=Ue>>>16-de,de+=Je-16):(ce|=He<<de&65535,de+=Je)}function Pt(He,We){let Ue=He*2;lt(We[Ue]&65535,We[Ue+1]&65535)}function ht(He,We){let Ue,Je=-1,gt,cn=He[0*2+1],Rn=0,$i=7,Nr=4;for(cn===0&&($i=138,Nr=3),Ue=0;Ue<=We;Ue++)if(gt=cn,cn=He[(Ue+1)*2+1],!(++Rn<$i&>==cn)){if(Rn<Nr)do Pt(gt,U);while(--Rn!==0);else gt!==0?(gt!=Je&&(Pt(gt,U),Rn--),Pt(16,U),lt(Rn-3,2)):Rn<=10?(Pt(17,U),lt(Rn-3,3)):(Pt(18,U),lt(Rn-11,7));Rn=0,Je=gt,cn===0?($i=138,Nr=3):gt==cn?($i=6,Nr=3):($i=7,Nr=4)}}function wn(He,We,Ue){let Je;for(lt(He-257,5),lt(We-1,5),lt(Ue-4,4),Je=0;Je<Ue;Je++)lt(U[_o.bl_order[Je]*2+1],3);ht(R,He-1),ht(F,We-1)}function ii(){de==16?(Be(ce),ce=0,de=0):de>=8&&(Oe(ce&255),ce>>>=8,de-=8)}function nt(){lt(E7<<1,3),Pt(256,Ea.static_ltree),ii(),1+J+10-de<9&&(lt(E7<<1,3),Pt(256,Ea.static_ltree),ii()),J=7}function Mt(He,We){let Ue,Je,gt;if(e.pending_buf[G+X*2]=He>>>8&255,e.pending_buf[G+X*2+1]=He&255,e.pending_buf[q+X]=We&255,X++,He===0?R[We*2]++:($++,He--,R[(_o._length_code[We]+256+1)*2]++,F[_o.d_code(He)*2]++),(X&8191)===0&&_>2){for(Ue=X*8,Je=w-A,gt=0;gt<30;gt++)Ue+=F[gt*2]*(5+_o.extra_dbits[gt]);if(Ue>>>=3,$<Math.floor(X/2)&&Ue<Math.floor(Je/2))return!0}return X==j-1}function ri(He,We){let Ue,Je,gt=0,cn,Rn;if(X!==0)do Ue=e.pending_buf[G+gt*2]<<8&65280|e.pending_buf[G+gt*2+1]&255,Je=e.pending_buf[q+gt]&255,gt++,Ue===0?Pt(Je,He):(cn=_o._length_code[Je],Pt(cn+256+1,He),Rn=_o.extra_lbits[cn],Rn!==0&&(Je-=_o.base_length[cn],lt(Je,Rn)),Ue--,cn=_o.d_code(Ue),Pt(cn,We),Rn=_o.extra_dbits[cn],Rn!==0&&(Ue-=_o.base_dist[cn],lt(Ue,Rn)));while(gt<X);Pt(256,He),J=He[256*2+1]}function we(){de>8?Be(ce):de>0&&Oe(ce&255),ce=0,de=0}function _t(He,We,Ue){we(),J=8,Ue&&(Be(We),Be(~We)),e.pending_buf.set(c.subarray(He,He+We),e.pending),e.pending+=We}function Yt(He,We,Ue){lt((Ktt<<1)+(Ue?1:0),3),_t(He,We,!0)}function Gi(He,We,Ue){let Je,gt,cn=0;_>0?(k.build_tree(e),H.build_tree(e),cn=Te(),Je=e.opt_len+3+7>>>3,gt=e.static_len+3+7>>>3,gt<=Je&&(Je=gt)):Je=gt=We+5,We+4<=Je&&He!=-1?Yt(He,We,Ue):gt==Je?(lt((E7<<1)+(Ue?1:0),3),ri(Ea.static_ltree,Ea.static_dtree)):(lt(($tt<<1)+(Ue?1:0),3),wn(k.max_code+1,H.max_code+1,cn+1),ri(R,F)),ae(),Ue&&we()}function ti(He){Gi(A>=0?A:-1,w-A,He),A=w,t.flush_pending()}function Br(){let He,We,Ue,Je;do{if(Je=u-I-w,Je===0&&w===0&&I===0)Je=o;else if(Je==-1)Je--;else if(w>=o+o-pu){c.set(c.subarray(o,o+o),0),D-=o,w-=o,A-=o,He=g,Ue=He;do We=d[--Ue]&65535,d[Ue]=We>=o?We-o:0;while(--He!==0);He=o,Ue=He;do We=f[--Ue]&65535,f[Ue]=We>=o?We-o:0;while(--He!==0);Je+=o}if(t.avail_in===0)return;He=t.read_buf(c,w+I,Je),I+=He,I>=wo&&(p=c[w]&255,p=(p<<C^c[w+1]&255)&x)}while(I<pu&&t.avail_in!==0)}function or(He){let We=65535,Ue;for(We>i-5&&(We=i-5);;){if(I<=1){if(Br(),I===0&&He==0)return If;if(I===0)break}if(w+=I,I=0,Ue=A+We,(w===0||w>=Ue)&&(I=w-Ue,w=Ue,ti(!1),t.avail_out===0)||w-A>=o-pu&&(ti(!1),t.avail_out===0))return If}return ti(He==4),t.avail_out===0?He==4?BD:If:He==4?P3:D3}function Lr(He){let We=B,Ue=w,Je,gt,cn=O,Rn=w>o-pu?w-(o-pu):0,$i=P,Nr=a,zo=w+R3,$n=c[Ue+cn-1],Ho=c[Ue+cn];O>=v&&(We>>=2),$i>I&&($i=I);do if(Je=He,!(c[Je+cn]!=Ho||c[Je+cn-1]!=$n||c[Je]!=c[Ue]||c[++Je]!=c[Ue+1])){Ue+=2,Je++;do;while(c[++Ue]==c[++Je]&&c[++Ue]==c[++Je]&&c[++Ue]==c[++Je]&&c[++Ue]==c[++Je]&&c[++Ue]==c[++Je]&&c[++Ue]==c[++Je]&&c[++Ue]==c[++Je]&&c[++Ue]==c[++Je]&&Ue<zo);if(gt=R3-(zo-Ue),Ue=zo-R3,gt>cn){if(D=He,cn=gt,gt>=$i)break;$n=c[Ue+cn-1],Ho=c[Ue+cn]}}while((He=f[He&Nr]&65535)>Rn&&--We!==0);return cn<=I?cn:I}function Pi(He){let We=0,Ue;for(;;){if(I<pu){if(Br(),I<pu&&He==0)return If;if(I===0)break}if(I>=wo&&(p=(p<<C^c[w+(wo-1)]&255)&x,We=d[p]&65535,f[w&a]=d[p],d[p]=w),We!==0&&(w-We&65535)<=o-pu&&E!=2&&(b=Lr(We)),b>=wo)if(Ue=Mt(w-D,b-wo),I-=b,b<=L&&I>=wo){b--;do w++,p=(p<<C^c[w+(wo-1)]&255)&x,We=d[p]&65535,f[w&a]=d[p],d[p]=w;while(--b!==0);w++}else w+=b,b=0,p=c[w]&255,p=(p<<C^c[w+1]&255)&x;else Ue=Mt(0,c[w]&255),I--,w++;if(Ue&&(ti(!1),t.avail_out===0))return If}return ti(He==4),t.avail_out===0?He==4?BD:If:He==4?P3:D3}function gr(He){let We=0,Ue,Je;for(;;){if(I<pu){if(Br(),I<pu&&He==0)return If;if(I===0)break}if(I>=wo&&(p=(p<<C^c[w+(wo-1)]&255)&x,We=d[p]&65535,f[w&a]=d[p],d[p]=w),O=b,T=D,b=wo-1,We!==0&&O<L&&(w-We&65535)<=o-pu&&(E!=2&&(b=Lr(We)),b<=5&&(E==1||b==wo&&w-D>4096)&&(b=wo-1)),O>=wo&&b<=O){Je=w+I-wo,Ue=Mt(w-1-T,O-wo),I-=O-1,O-=2;do++w<=Je&&(p=(p<<C^c[w+(wo-1)]&255)&x,We=d[p]&65535,f[w&a]=d[p],d[p]=w);while(--O!==0);if(S=0,b=wo-1,w++,Ue&&(ti(!1),t.avail_out===0))return If}else if(S!==0){if(Ue=Mt(0,c[w-1]&255),Ue&&ti(!1),w++,I--,t.avail_out===0)return If}else S=1,w++,I--}return S!==0&&(Ue=Mt(0,c[w-1]&255),S=0),ti(He==4),t.avail_out===0?He==4?BD:If:He==4?P3:D3}function Ia(He){return He.total_in=He.total_out=0,He.msg=null,e.pending=0,e.pending_out=0,n=I3,r=0,_e(),ie(),0}e.deflateInit=function(He,We,Ue,Je,gt,cn){return Je||(Je=b7),gt||(gt=Ytt),cn||(cn=0),He.msg=null,We==-1&&(We=6),gt<1||gt>qtt||Je!=b7||Ue<9||Ue>15||We<0||We>9||cn<0||cn>2?-2:(He.dstate=e,s=Ue,o=1<<s,a=o-1,m=gt+7,g=1<<m,x=g-1,C=Math.floor((m+wo-1)/wo),c=new Uint8Array(o*2),f=[],d=[],j=1<<gt+6,e.pending_buf=new Uint8Array(j*4),i=j*4,G=Math.floor(j/2),q=(1+2)*j,_=We,E=cn,Ia(He))},e.deflateEnd=function(){return n!=T7&&n!=I3&&n!=LD?-2:(e.pending_buf=null,d=null,f=null,c=null,e.dstate=null,n==I3?-3:0)},e.deflateParams=function(He,We,Ue){let Je=0;return We==-1&&(We=6),We<0||We>9||Ue<0||Ue>2?-2:(zd[_].func!=zd[We].func&&He.total_in!==0&&(Je=He.deflate(1)),_!=We&&(_=We,L=zd[_].max_lazy,v=zd[_].good_length,P=zd[_].nice_length,B=zd[_].max_chain),E=Ue,Je)},e.deflateSetDictionary=function(He,We,Ue){let Je=Ue,gt,cn=0;if(!We||n!=T7)return-2;if(Je<wo)return 0;for(Je>o-pu&&(Je=o-pu,cn=Ue-Je),c.set(We.subarray(cn,cn+Je),0),w=Je,A=Je,p=c[0]&255,p=(p<<C^c[1]&255)&x,gt=0;gt<=Je-wo;gt++)p=(p<<C^c[gt+(wo-1)]&255)&x,f[gt&a]=d[p],d[p]=gt;return 0},e.deflate=function(He,We){let Ue,Je,gt,cn,Rn;if(We>4||We<0)return-2;if(!He.next_out||!He.next_in&&He.avail_in!==0||n==LD&&We!=4)return He.msg=v3[2- -2],-2;if(He.avail_out===0)return He.msg=v3[2- -5],-5;if(t=He,cn=r,r=We,n==T7&&(Je=b7+(s-8<<4)<<8,gt=(_-1&255)>>1,gt>3&&(gt=3),Je|=gt<<6,w!==0&&(Je|=Xtt),Je+=31-Je%31,n=I3,tt(Je)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return r=-1,0}else if(t.avail_in===0&&We<=cn&&We!=4)return t.msg=v3[2- -5],-5;if(n==LD&&t.avail_in!==0)return He.msg=v3[2- -5],-5;if(t.avail_in!==0||I!==0||We!=0&&n!=LD){switch(Rn=-1,zd[_].func){case qde:Rn=or(We);break;case O3:Rn=Pi(We);break;case Yx:Rn=gr(We);break;default:}if((Rn==BD||Rn==P3)&&(n=LD),Rn==If||Rn==BD)return t.avail_out===0&&(r=-1),0;if(Rn==D3){if(We==1)nt();else if(Yt(0,0,!1),We==3)for(Ue=0;Ue<g;Ue++)d[Ue]=0;if(t.flush_pending(),t.avail_out===0)return r=-1,0}}return We!=4?0:1}}function Yde(){let e=this;e.next_in_index=0,e.next_out_index=0,e.avail_in=0,e.total_in=0,e.avail_out=0,e.total_out=0}Yde.prototype={deflateInit:function(e,t){let n=this;return n.dstate=new Ztt,t||(t=15),n.dstate.deflateInit(n,e,t)},deflate:function(e){let t=this;return t.dstate?t.dstate.deflate(t,e):-2},deflateEnd:function(){let e=this;if(!e.dstate)return-2;let t=e.dstate.deflateEnd();return e.dstate=null,t},deflateParams:function(e,t){let n=this;return n.dstate?n.dstate.deflateParams(n,e,t):-2},deflateSetDictionary:function(e,t){let n=this;return n.dstate?n.dstate.deflateSetDictionary(n,e,t):-2},read_buf:function(e,t,n){let i=this,r=i.avail_in;return r>n&&(r=n),r===0?0:(i.avail_in-=r,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+r),t),i.next_in_index+=r,i.total_in+=r,r)},flush_pending:function(){let e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,e.dstate.pending===0&&(e.dstate.pending_out=0))}};function Jtt(e){let t=this,n=new Yde,i=Qtt(e&&e.chunkSize?e.chunkSize:64*1024),r=0,o=new Uint8Array(i),s=e?e.level:-1;typeof s>"u"&&(s=-1),n.deflateInit(s),n.next_out=o,t.append=function(a,c){let u,f,d=0,p=0,g=0,m=[];if(!!a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,u=n.deflate(r),u!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?m.push(new Uint8Array(o)):m.push(o.slice(0,n.next_out_index))),g+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=d&&(c(n.next_in_index),d=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return m.length>1?(f=new Uint8Array(g),m.forEach(function(x){f.set(x,p),p+=x.length})):f=m[0]||new Uint8Array(0),f}},t.flush=function(){let a,c,u=0,f=0,d=[];do{if(n.next_out_index=0,n.avail_out=i,a=n.deflate(4),a!=1&&a!=0)throw new Error("deflating: "+n.msg);i-n.avail_out>0&&d.push(o.slice(0,n.next_out_index)),f+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),c=new Uint8Array(f),d.forEach(function(p){c.set(p,u),u+=p.length}),c}}function Qtt(e){return e+5*(Math.floor(e/16383)+1)}var Xde=Jtt;var _u=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],mhe=1440,ent=0,tnt=4,nnt=9,int=5,rnt=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],ont=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],snt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],ant=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],cnt=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],lnt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],p0=15;function D7(){let e=this,t,n,i,r,o,s;function a(u,f,d,p,g,m,x,C,A,b,T){let S,w,D,I,O,B,L,_,E,v,P,R,F,U,k;v=0,O=d;do i[u[f+v]]++,v++,O--;while(O!==0);if(i[0]==d)return x[0]=-1,C[0]=0,0;for(_=C[0],B=1;B<=p0&&i[B]===0;B++);for(L=B,_<B&&(_=B),O=p0;O!==0&&i[O]===0;O--);for(D=O,_>O&&(_=O),C[0]=_,U=1<<B;B<O;B++,U<<=1)if((U-=i[B])<0)return-3;if((U-=i[O])<0)return-3;for(i[O]+=U,s[1]=B=0,v=1,F=2;--O!==0;)s[F]=B+=i[v],F++,v++;O=0,v=0;do(B=u[f+v])!==0&&(T[s[B]++]=O),v++;while(++O<d);for(d=s[D],s[0]=O=0,v=0,I=-1,R=-_,o[0]=0,P=0,k=0;L<=D;L++)for(S=i[L];S--!==0;){for(;L>R+_;){if(I++,R+=_,k=D-R,k=k>_?_:k,(w=1<<(B=L-R))>S+1&&(w-=S+1,F=L,B<k))for(;++B<k&&!((w<<=1)<=i[++F]);)w-=i[F];if(k=1<<B,b[0]+k>mhe)return-3;o[I]=P=b[0],b[0]+=k,I!==0?(s[I]=O,r[0]=B,r[1]=_,B=O>>>R-_,r[2]=P-o[I-1]-B,A.set(r,(o[I-1]+B)*3)):x[0]=P}for(r[1]=L-R,v>=d?r[0]=128+64:T[v]<p?(r[0]=T[v]<256?0:32+64,r[2]=T[v++]):(r[0]=m[T[v]-p]+16+64,r[2]=g[T[v++]-p]),w=1<<L-R,B=O>>>R;B<k;B+=w)A.set(r,(P+B)*3);for(B=1<<L-1;(O&B)!==0;B>>>=1)O^=B;for(O^=B,E=(1<<R)-1;(O&E)!=s[I];)I--,R-=_,E=(1<<R)-1}return U!==0&&D!=1?-5:0}function c(u){let f;for(t||(t=[],n=[],i=new Int32Array(p0+1),r=[],o=new Int32Array(p0),s=new Int32Array(p0+1)),n.length<u&&(n=[]),f=0;f<u;f++)n[f]=0;for(f=0;f<p0+1;f++)i[f]=0;for(f=0;f<3;f++)r[f]=0;o.set(i.subarray(0,p0),0),s.set(i.subarray(0,p0+1),0)}e.inflate_trees_bits=function(u,f,d,p,g){let m;return c(19),t[0]=0,m=a(u,0,19,19,null,null,d,f,p,t,n),m==-3?g.msg="oversubscribed dynamic bit lengths tree":(m==-5||f[0]===0)&&(g.msg="incomplete dynamic bit lengths tree",m=-3),m},e.inflate_trees_dynamic=function(u,f,d,p,g,m,x,C,A){let b;return c(288),t[0]=0,b=a(d,0,u,257,snt,ant,m,p,C,t,n),b!=0||p[0]===0?(b==-3?A.msg="oversubscribed literal/length tree":b!=-4&&(A.msg="incomplete literal/length tree",b=-3),b):(c(288),b=a(d,u,f,0,cnt,lnt,x,g,C,t,n),b!=0||g[0]===0&&u>257?(b==-3?A.msg="oversubscribed distance tree":b==-5?(A.msg="incomplete distance tree",b=-3):b!=-4&&(A.msg="empty distance tree with lengths",b=-3),b):0)}}D7.inflate_trees_fixed=function(e,t,n,i){return e[0]=nnt,t[0]=int,n[0]=rnt,i[0]=ont,0};var M3=0,Kde=1,$de=2,Zde=3,Jde=4,Qde=5,ehe=6,S7=7,the=8,B3=9;function unt(){let e=this,t,n=0,i,r=0,o=0,s=0,a=0,c=0,u=0,f=0,d,p=0,g,m=0;function x(C,A,b,T,S,w,D,I){let O,B,L,_,E,v,P,R,F,U,k,H,V,q,j,X;P=I.next_in_index,R=I.avail_in,E=D.bitb,v=D.bitk,F=D.write,U=F<D.read?D.read-F-1:D.end-F,k=_u[C],H=_u[A];do{for(;v<20;)R--,E|=(I.read_byte(P++)&255)<<v,v+=8;if(O=E&k,B=b,L=T,X=(L+O)*3,(_=B[X])===0){E>>=B[X+1],v-=B[X+1],D.window[F++]=B[X+2],U--;continue}do{if(E>>=B[X+1],v-=B[X+1],(_&16)!==0){for(_&=15,V=B[X+2]+(E&_u[_]),E>>=_,v-=_;v<15;)R--,E|=(I.read_byte(P++)&255)<<v,v+=8;O=E&H,B=S,L=w,X=(L+O)*3,_=B[X];do if(E>>=B[X+1],v-=B[X+1],(_&16)!==0){for(_&=15;v<_;)R--,E|=(I.read_byte(P++)&255)<<v,v+=8;if(q=B[X+2]+(E&_u[_]),E>>=_,v-=_,U-=V,F>=q)j=F-q,F-j>0&&2>F-j?(D.window[F++]=D.window[j++],D.window[F++]=D.window[j++],V-=2):(D.window.set(D.window.subarray(j,j+2),F),F+=2,j+=2,V-=2);else{j=F-q;do j+=D.end;while(j<0);if(_=D.end-j,V>_){if(V-=_,F-j>0&&_>F-j)do D.window[F++]=D.window[j++];while(--_!==0);else D.window.set(D.window.subarray(j,j+_),F),F+=_,j+=_,_=0;j=0}}if(F-j>0&&V>F-j)do D.window[F++]=D.window[j++];while(--V!==0);else D.window.set(D.window.subarray(j,j+V),F),F+=V,j+=V,V=0;break}else if((_&64)===0)O+=B[X+2],O+=E&_u[_],X=(L+O)*3,_=B[X];else return I.msg="invalid distance code",V=I.avail_in-R,V=v>>3<V?v>>3:V,R+=V,P-=V,v-=V<<3,D.bitb=E,D.bitk=v,I.avail_in=R,I.total_in+=P-I.next_in_index,I.next_in_index=P,D.write=F,-3;while(!0);break}if((_&64)===0){if(O+=B[X+2],O+=E&_u[_],X=(L+O)*3,(_=B[X])===0){E>>=B[X+1],v-=B[X+1],D.window[F++]=B[X+2],U--;break}}else return(_&32)!==0?(V=I.avail_in-R,V=v>>3<V?v>>3:V,R+=V,P-=V,v-=V<<3,D.bitb=E,D.bitk=v,I.avail_in=R,I.total_in+=P-I.next_in_index,I.next_in_index=P,D.write=F,1):(I.msg="invalid literal/length code",V=I.avail_in-R,V=v>>3<V?v>>3:V,R+=V,P-=V,v-=V<<3,D.bitb=E,D.bitk=v,I.avail_in=R,I.total_in+=P-I.next_in_index,I.next_in_index=P,D.write=F,-3)}while(!0)}while(U>=258&&R>=10);return V=I.avail_in-R,V=v>>3<V?v>>3:V,R+=V,P-=V,v-=V<<3,D.bitb=E,D.bitk=v,I.avail_in=R,I.total_in+=P-I.next_in_index,I.next_in_index=P,D.write=F,0}e.init=function(C,A,b,T,S,w){t=M3,u=C,f=A,d=b,p=T,g=S,m=w,i=null},e.proc=function(C,A,b){let T,S,w,D=0,I=0,O=0,B,L,_,E;for(O=A.next_in_index,B=A.avail_in,D=C.bitb,I=C.bitk,L=C.write,_=L<C.read?C.read-L-1:C.end-L;;)switch(t){case M3:if(_>=258&&B>=10&&(C.bitb=D,C.bitk=I,A.avail_in=B,A.total_in+=O-A.next_in_index,A.next_in_index=O,C.write=L,b=x(u,f,d,p,g,m,C,A),O=A.next_in_index,B=A.avail_in,D=C.bitb,I=C.bitk,L=C.write,_=L<C.read?C.read-L-1:C.end-L,b!=0)){t=b==1?S7:B3;break}o=u,i=d,r=p,t=Kde;case Kde:for(T=o;I<T;){if(B!==0)b=0;else return C.bitb=D,C.bitk=I,A.avail_in=B,A.total_in+=O-A.next_in_index,A.next_in_index=O,C.write=L,C.inflate_flush(A,b);B--,D|=(A.read_byte(O++)&255)<<I,I+=8}if(S=(r+(D&_u[T]))*3,D>>>=i[S+1],I-=i[S+1],w=i[S],w===0){s=i[S+2],t=ehe;break}if((w&16)!==0){a=w&15,n=i[S+2],t=$de;break}if((w&64)===0){o=w,r=S/3+i[S+2];break}if((w&32)!==0){t=S7;break}return t=B3,A.msg="invalid literal/length code",b=-3,C.bitb=D,C.bitk=I,A.avail_in=B,A.total_in+=O-A.next_in_index,A.next_in_index=O,C.write=L,C.inflate_flush(A,b);case $de:for(T=a;I<T;){if(B!==0)b=0;else return C.bitb=D,C.bitk=I,A.avail_in=B,A.total_in+=O-A.next_in_index,A.next_in_index=O,C.write=L,C.inflate_flush(A,b);B--,D|=(A.read_byte(O++)&255)<<I,I+=8}n+=D&_u[T],D>>=T,I-=T,o=f,i=g,r=m,t=Zde;case Zde:for(T=o;I<T;){if(B!==0)b=0;else return C.bitb=D,C.bitk=I,A.avail_in=B,A.total_in+=O-A.next_in_index,A.next_in_index=O,C.write=L,C.inflate_flush(A,b);B--,D|=(A.read_byte(O++)&255)<<I,I+=8}if(S=(r+(D&_u[T]))*3,D>>=i[S+1],I-=i[S+1],w=i[S],(w&16)!==0){a=w&15,c=i[S+2],t=Jde;break}if((w&64)===0){o=w,r=S/3+i[S+2];break}return t=B3,A.msg="invalid distance code",b=-3,C.bitb=D,C.bitk=I,A.avail_in=B,A.total_in+=O-A.next_in_index,A.next_in_index=O,C.write=L,C.inflate_flush(A,b);case Jde:for(T=a;I<T;){if(B!==0)b=0;else return C.bitb=D,C.bitk=I,A.avail_in=B,A.total_in+=O-A.next_in_index,A.next_in_index=O,C.write=L,C.inflate_flush(A,b);B--,D|=(A.read_byte(O++)&255)<<I,I+=8}c+=D&_u[T],D>>=T,I-=T,t=Qde;case Qde:for(E=L-c;E<0;)E+=C.end;for(;n!==0;){if(_===0&&(L==C.end&&C.read!==0&&(L=0,_=L<C.read?C.read-L-1:C.end-L),_===0&&(C.write=L,b=C.inflate_flush(A,b),L=C.write,_=L<C.read?C.read-L-1:C.end-L,L==C.end&&C.read!==0&&(L=0,_=L<C.read?C.read-L-1:C.end-L),_===0)))return C.bitb=D,C.bitk=I,A.avail_in=B,A.total_in+=O-A.next_in_index,A.next_in_index=O,C.write=L,C.inflate_flush(A,b);C.window[L++]=C.window[E++],_--,E==C.end&&(E=0),n--}t=M3;break;case ehe:if(_===0&&(L==C.end&&C.read!==0&&(L=0,_=L<C.read?C.read-L-1:C.end-L),_===0&&(C.write=L,b=C.inflate_flush(A,b),L=C.write,_=L<C.read?C.read-L-1:C.end-L,L==C.end&&C.read!==0&&(L=0,_=L<C.read?C.read-L-1:C.end-L),_===0)))return C.bitb=D,C.bitk=I,A.avail_in=B,A.total_in+=O-A.next_in_index,A.next_in_index=O,C.write=L,C.inflate_flush(A,b);b=0,C.window[L++]=s,_--,t=M3;break;case S7:if(I>7&&(I-=8,B++,O--),C.write=L,b=C.inflate_flush(A,b),L=C.write,_=L<C.read?C.read-L-1:C.end-L,C.read!=C.write)return C.bitb=D,C.bitk=I,A.avail_in=B,A.total_in+=O-A.next_in_index,A.next_in_index=O,C.write=L,C.inflate_flush(A,b);t=the;case the:return b=1,C.bitb=D,C.bitk=I,A.avail_in=B,A.total_in+=O-A.next_in_index,A.next_in_index=O,C.write=L,C.inflate_flush(A,b);case B3:return b=-3,C.bitb=D,C.bitk=I,A.avail_in=B,A.total_in+=O-A.next_in_index,A.next_in_index=O,C.write=L,C.inflate_flush(A,b);default:return b=-2,C.bitb=D,C.bitk=I,A.avail_in=B,A.total_in+=O-A.next_in_index,A.next_in_index=O,C.write=L,C.inflate_flush(A,b)}},e.free=function(){}}var nhe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],iE=0,w7=1,ihe=2,rhe=3,ohe=4,she=5,L3=6,N3=7,ahe=8,Xx=9;function fnt(e,t){let n=this,i=iE,r=0,o=0,s=0,a,c=[0],u=[0],f=new unt,d=0,p=new Int32Array(mhe*3),g=0,m=new D7;n.bitk=0,n.bitb=0,n.window=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(x,C){C&&(C[0]=g),i==L3&&f.free(x),i=iE,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(x,C){let A,b,T;return b=x.next_out_index,T=n.read,A=(T<=n.write?n.write:n.end)-T,A>x.avail_out&&(A=x.avail_out),A!==0&&C==-5&&(C=0),x.avail_out-=A,x.total_out+=A,x.next_out.set(n.window.subarray(T,T+A),b),b+=A,T+=A,T==n.end&&(T=0,n.write==n.end&&(n.write=0),A=n.write-T,A>x.avail_out&&(A=x.avail_out),A!==0&&C==-5&&(C=0),x.avail_out-=A,x.total_out+=A,x.next_out.set(n.window.subarray(T,T+A),b),b+=A,T+=A),x.next_out_index=b,n.read=T,C},n.proc=function(x,C){let A,b,T,S,w,D,I,O;for(S=x.next_in_index,w=x.avail_in,b=n.bitb,T=n.bitk,D=n.write,I=D<n.read?n.read-D-1:n.end-D;;){let B,L,_,E,v,P,R,F;switch(i){case iE:for(;T<3;){if(w!==0)C=0;else return n.bitb=b,n.bitk=T,x.avail_in=w,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,C);w--,b|=(x.read_byte(S++)&255)<<T,T+=8}switch(A=b&7,d=A&1,A>>>1){case 0:b>>>=3,T-=3,A=T&7,b>>>=A,T-=A,i=w7;break;case 1:B=[],L=[],_=[[]],E=[[]],D7.inflate_trees_fixed(B,L,_,E),f.init(B[0],L[0],_[0],0,E[0],0),b>>>=3,T-=3,i=L3;break;case 2:b>>>=3,T-=3,i=rhe;break;case 3:return b>>>=3,T-=3,i=Xx,x.msg="invalid block type",C=-3,n.bitb=b,n.bitk=T,x.avail_in=w,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,C)}break;case w7:for(;T<32;){if(w!==0)C=0;else return n.bitb=b,n.bitk=T,x.avail_in=w,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,C);w--,b|=(x.read_byte(S++)&255)<<T,T+=8}if((~b>>>16&65535)!=(b&65535))return i=Xx,x.msg="invalid stored block lengths",C=-3,n.bitb=b,n.bitk=T,x.avail_in=w,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,C);r=b&65535,b=T=0,i=r!==0?ihe:d!==0?N3:iE;break;case ihe:if(w===0||I===0&&(D==n.end&&n.read!==0&&(D=0,I=D<n.read?n.read-D-1:n.end-D),I===0&&(n.write=D,C=n.inflate_flush(x,C),D=n.write,I=D<n.read?n.read-D-1:n.end-D,D==n.end&&n.read!==0&&(D=0,I=D<n.read?n.read-D-1:n.end-D),I===0)))return n.bitb=b,n.bitk=T,x.avail_in=w,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,C);if(C=0,A=r,A>w&&(A=w),A>I&&(A=I),n.window.set(x.read_buf(S,A),D),S+=A,w-=A,D+=A,I-=A,(r-=A)!==0)break;i=d!==0?N3:iE;break;case rhe:for(;T<14;){if(w!==0)C=0;else return n.bitb=b,n.bitk=T,x.avail_in=w,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,C);w--,b|=(x.read_byte(S++)&255)<<T,T+=8}if(o=A=b&16383,(A&31)>29||(A>>5&31)>29)return i=Xx,x.msg="too many length or distance symbols",C=-3,n.bitb=b,n.bitk=T,x.avail_in=w,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,C);if(A=258+(A&31)+(A>>5&31),!a||a.length<A)a=[];else for(O=0;O<A;O++)a[O]=0;b>>>=14,T-=14,s=0,i=ohe;case ohe:for(;s<4+(o>>>10);){for(;T<3;){if(w!==0)C=0;else return n.bitb=b,n.bitk=T,x.avail_in=w,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,C);w--,b|=(x.read_byte(S++)&255)<<T,T+=8}a[nhe[s++]]=b&7,b>>>=3,T-=3}for(;s<19;)a[nhe[s++]]=0;if(c[0]=7,A=m.inflate_trees_bits(a,c,u,p,x),A!=0)return C=A,C==-3&&(a=null,i=Xx),n.bitb=b,n.bitk=T,x.avail_in=w,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,C);s=0,i=she;case she:for(;A=o,!(s>=258+(A&31)+(A>>5&31));){let U,k;for(A=c[0];T<A;){if(w!==0)C=0;else return n.bitb=b,n.bitk=T,x.avail_in=w,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,C);w--,b|=(x.read_byte(S++)&255)<<T,T+=8}if(A=p[(u[0]+(b&_u[A]))*3+1],k=p[(u[0]+(b&_u[A]))*3+2],k<16)b>>>=A,T-=A,a[s++]=k;else{for(O=k==18?7:k-14,U=k==18?11:3;T<A+O;){if(w!==0)C=0;else return n.bitb=b,n.bitk=T,x.avail_in=w,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,C);w--,b|=(x.read_byte(S++)&255)<<T,T+=8}if(b>>>=A,T-=A,U+=b&_u[O],b>>>=O,T-=O,O=s,A=o,O+U>258+(A&31)+(A>>5&31)||k==16&&O<1)return a=null,i=Xx,x.msg="invalid bit length repeat",C=-3,n.bitb=b,n.bitk=T,x.avail_in=w,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,C);k=k==16?a[O-1]:0;do a[O++]=k;while(--U!==0);s=O}}if(u[0]=-1,v=[],P=[],R=[],F=[],v[0]=9,P[0]=6,A=o,A=m.inflate_trees_dynamic(257+(A&31),1+(A>>5&31),a,v,P,R,F,p,x),A!=0)return A==-3&&(a=null,i=Xx),C=A,n.bitb=b,n.bitk=T,x.avail_in=w,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,C);f.init(v[0],P[0],p,R[0],p,F[0]),i=L3;case L3:if(n.bitb=b,n.bitk=T,x.avail_in=w,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,(C=f.proc(n,x,C))!=1)return n.inflate_flush(x,C);if(C=0,f.free(x),S=x.next_in_index,w=x.avail_in,b=n.bitb,T=n.bitk,D=n.write,I=D<n.read?n.read-D-1:n.end-D,d===0){i=iE;break}i=N3;case N3:if(n.write=D,C=n.inflate_flush(x,C),D=n.write,I=D<n.read?n.read-D-1:n.end-D,n.read!=n.write)return n.bitb=b,n.bitk=T,x.avail_in=w,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,C);i=ahe;case ahe:return C=1,n.bitb=b,n.bitk=T,x.avail_in=w,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,C);case Xx:return C=-3,n.bitb=b,n.bitk=T,x.avail_in=w,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,C);default:return C=-2,n.bitb=b,n.bitk=T,x.avail_in=w,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,C)}}},n.free=function(x){n.reset(x,null),n.window=null,p=null},n.set_dictionary=function(x,C,A){n.window.set(x.subarray(C,C+A),0),n.read=n.write=A},n.sync_point=function(){return i==w7?1:0}}var dnt=32,hnt=8,mnt=0,che=1,lhe=2,uhe=3,fhe=4,dhe=5,v7=6,ND=7,hhe=12,_0=13,pnt=[0,0,255,255];function _nt(){let e=this;e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0;function t(n){return!n||!n.istate?-2:(n.total_in=n.total_out=0,n.msg=null,n.istate.mode=ND,n.istate.blocks.reset(n,null),0)}e.inflateEnd=function(n){return e.blocks&&e.blocks.free(n),e.blocks=null,0},e.inflateInit=function(n,i){return n.msg=null,e.blocks=null,i<8||i>15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new fnt(n,1<<i),t(n),0)},e.inflate=function(n,i){let r,o;if(!n||!n.istate||!n.next_in)return-2;let s=n.istate;for(i=i==tnt?-5:0,r=-5;;)switch(s.mode){case mnt:if(n.avail_in===0)return r;if(r=i,n.avail_in--,n.total_in++,((s.method=n.read_byte(n.next_in_index++))&15)!=hnt){s.mode=_0,n.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=_0,n.msg="invalid window size",s.marker=5;break}s.mode=che;case che:if(n.avail_in===0)return r;if(r=i,n.avail_in--,n.total_in++,o=n.read_byte(n.next_in_index++)&255,((s.method<<8)+o)%31!==0){s.mode=_0,n.msg="incorrect header check",s.marker=5;break}if((o&dnt)===0){s.mode=ND;break}s.mode=lhe;case lhe:if(n.avail_in===0)return r;r=i,n.avail_in--,n.total_in++,s.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,s.mode=uhe;case uhe:if(n.avail_in===0)return r;r=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,s.mode=fhe;case fhe:if(n.avail_in===0)return r;r=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,s.mode=dhe;case dhe:return n.avail_in===0?r:(r=i,n.avail_in--,n.total_in++,s.need+=n.read_byte(n.next_in_index++)&255,s.mode=v7,2);case v7:return s.mode=_0,n.msg="need dictionary",s.marker=0,-2;case ND:if(r=s.blocks.proc(n,r),r==-3){s.mode=_0,s.marker=0;break}if(r==0&&(r=i),r!=1)return r;r=i,s.blocks.reset(n,s.was),s.mode=hhe;case hhe:return 1;case _0:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,r){let o=0,s=r;if(!n||!n.istate||n.istate.mode!=v7)return-2;let a=n.istate;return s>=1<<a.wbits&&(s=(1<<a.wbits)-1,o=r-s),a.blocks.set_dictionary(i,o,s),a.mode=ND,0},e.inflateSync=function(n){let i,r,o,s,a;if(!n||!n.istate)return-2;let c=n.istate;if(c.mode!=_0&&(c.mode=_0,c.marker=0),(i=n.avail_in)===0)return-5;for(r=n.next_in_index,o=c.marker;i!==0&&o<4;)n.read_byte(r)==pnt[o]?o++:n.read_byte(r)!==0?o=0:o=4-o,r++,i--;return n.total_in+=r-n.next_in_index,n.next_in_index=r,n.avail_in=i,c.marker=o,o!=4?-3:(s=n.total_in,a=n.total_out,t(n),n.total_in=s,n.total_out=a,c.mode=ND,0)},e.inflateSyncPoint=function(n){return!n||!n.istate||!n.istate.blocks?-2:n.istate.blocks.sync_point()}}function phe(){}phe.prototype={inflateInit:function(e){let t=this;return t.istate=new _nt,e||(e=15),t.istate.inflateInit(t,e)},inflate:function(e){let t=this;return t.istate?t.istate.inflate(t,e):-2},inflateEnd:function(){let e=this;if(!e.istate)return-2;let t=e.istate.inflateEnd(e);return e.istate=null,t},inflateSync:function(){let e=this;return e.istate?e.istate.inflateSync(e):-2},inflateSetDictionary:function(e,t){let n=this;return n.istate?n.istate.inflateSetDictionary(n,e,t):-2},read_byte:function(e){return this.next_in[e]},read_buf:function(e,t){return this.next_in.subarray(e,e+t)}};function gnt(e){let t=this,n=new phe,i=e&&e.chunkSize?Math.floor(e.chunkSize*2):128*1024,r=ent,o=new Uint8Array(i),s=!1;n.inflateInit(),n.next_out=o,t.append=function(a,c){let u=[],f,d,p=0,g=0,m=0;if(a.length!==0){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,n.avail_in===0&&!s&&(n.next_in_index=0,s=!0),f=n.inflate(r),s&&f===-5){if(n.avail_in!==0)throw new Error("inflating: bad input")}else if(f!==0&&f!==1)throw new Error("inflating: "+n.msg);if((s||f===1)&&n.avail_in===a.length)throw new Error("inflating: bad input");n.next_out_index&&(n.next_out_index===i?u.push(new Uint8Array(o)):u.push(o.slice(0,n.next_out_index))),m+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=p&&(c(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return u.length>1?(d=new Uint8Array(m),u.forEach(function(x){d.set(x,g),g+=x.length})):d=u[0]||new Uint8Array(0),d}},t.flush=function(){n.inflateEnd()}}var _he=gnt;var ynt={chunkSize:524288,maxWorkers:typeof navigator<"u"&&navigator.hardwareConcurrency||2,terminateWorkerTimeout:5e3,useWebWorkers:!0,workerScripts:void 0},gu=Object.assign({},ynt);function F3(){return gu}function P7(e){if(e.chunkSize!==void 0&&(gu.chunkSize=e.chunkSize),e.maxWorkers!==void 0&&(gu.maxWorkers=e.maxWorkers),e.terminateWorkerTimeout!==void 0&&(gu.terminateWorkerTimeout=e.terminateWorkerTimeout),e.useWebWorkers!==void 0&&(gu.useWebWorkers=e.useWebWorkers),e.Deflate!==void 0&&(gu.Deflate=e.Deflate),e.Inflate!==void 0&&(gu.Inflate=e.Inflate),e.workerScripts!==void 0){if(e.workerScripts.deflate){if(!Array.isArray(e.workerScripts.deflate))throw new Error("workerScripts.deflate must be an array");gu.workerScripts||(gu.workerScripts={}),gu.workerScripts.deflate=e.workerScripts.deflate}if(e.workerScripts.inflate){if(!Array.isArray(e.workerScripts.inflate))throw new Error("workerScripts.inflate must be an array");gu.workerScripts||(gu.workerScripts={}),gu.workerScripts.inflate=e.workerScripts.inflate}}}var ghe=xnt;function xnt(){return"application/octet-stream"}var O7="Abort error";async function V3(e,t,n,i,r,o,s){let a=Math.max(o.chunkSize,64);return c();async function c(u=0,f=0){let d=s.signal;if(u<r){I7(d,e);let p=await t.readUint8Array(u+i,Math.min(a,r-u)),g=p.length;I7(d,e);let m=await e.append(p);if(I7(d,e),f+=await yhe(n,m),s.onprogress)try{s.onprogress(u+g,r)}catch{}return c(u+a,f)}else{let p=await e.flush();return f+=await yhe(n,p.data),{signature:p.signature,length:f}}}}function I7(e,t){if(e&&e.aborted)throw t.flush(),new Error(O7)}async function yhe(e,t){return t.length&&await e.writeUint8Array(t),t.length}var xhe="HTTP error ",FD="HTTP Range not supported",B7="text/plain",Che="Content-Length",Ahe="Accept-Ranges",The="Range",bhe="HEAD",G3="GET",k3="bytes",U3=class{constructor(){this.size=0}init(){this.initialized=!0}},gm=class extends U3{},Kx=class extends U3{writeUint8Array(t){this.size+=t.length}},L7=class extends gm{constructor(t){super(),this.blobReader=new z3(new Blob([t],{type:B7}))}async init(){super.init(),this.blobReader.init(),this.size=this.blobReader.size}async readUint8Array(t,n){return this.blobReader.readUint8Array(t,n)}},N7=class extends Kx{constructor(t){super(),this.encoding=t,this.blob=new Blob([],{type:B7})}async writeUint8Array(t){super.writeUint8Array(t),this.blob=new Blob([this.blob,t.buffer],{type:B7})}getData(){let t=new FileReader;return new Promise((n,i)=>{t.onload=r=>n(r.target.result),t.onerror=()=>i(t.error),t.readAsText(this.blob,this.encoding)})}},F7=class extends gm{constructor(t){super(),this.dataURI=t;let n=t.length;for(;t.charAt(n-1)=="=";)n--;this.dataStart=t.indexOf(",")+1,this.size=Math.floor((n-this.dataStart)*.75)}async readUint8Array(t,n){let i=new Uint8Array(n),r=Math.floor(t/3)*4,o=atob(this.dataURI.substring(r+this.dataStart,Math.ceil((t+n)/3)*4+this.dataStart)),s=t-Math.floor(r/4)*3;for(let a=s;a<s+n;a++)i[a-s]=o.charCodeAt(a);return i}},V7=class extends Kx{constructor(t){super(),this.data="data:"+(t||"")+";base64,",this.pending=[]}async writeUint8Array(t){super.writeUint8Array(t);let n=0,i=this.pending,r=this.pending.length;for(this.pending="",n=0;n<Math.floor((r+t.length)/3)*3-r;n++)i+=String.fromCharCode(t[n]);for(;n<t.length;n++)this.pending+=String.fromCharCode(t[n]);i.length>2?this.data+=btoa(i):this.pending=i}getData(){return this.data+btoa(this.pending)}},z3=class extends gm{constructor(t){super(),this.blob=t,this.size=t.size}async readUint8Array(t,n){let i=new FileReader;return new Promise((r,o)=>{i.onload=s=>r(new Uint8Array(s.target.result)),i.onerror=()=>o(i.error),i.readAsArrayBuffer(this.blob.slice(t,t+n))})}},VD=class extends Kx{constructor(t){super(),this.contentType=t,this.arrayBuffers=[]}async writeUint8Array(t){super.writeUint8Array(t),this.arrayBuffers.push(t.buffer)}getData(){return this.blob||(this.blob=new Blob(this.arrayBuffers,{type:this.contentType})),this.blob}},k7=class extends gm{constructor(t,n){super(),this.url=t,this.preventHeadRequest=n.preventHeadRequest,this.useRangeHeader=n.useRangeHeader,this.forceRangeRequests=n.forceRangeRequests,this.options=Object.assign({},n),delete this.options.preventHeadRequest,delete this.options.useRangeHeader,delete this.options.forceRangeRequests,delete this.options.useXHR}async init(){if(super.init(),Ehe(this.url)&&!this.preventHeadRequest){let t=await U7(bhe,this.url,this.options);if(this.size=Number(t.headers.get(Che)),!this.forceRangeRequests&&this.useRangeHeader&&t.headers.get(Ahe)!=k3)throw new Error(FD);this.size===void 0&&await R7(this,this.options)}else await R7(this,this.options)}async readUint8Array(t,n){if(this.useRangeHeader){let i=await U7(G3,this.url,this.options,Object.assign({},this.options.headers,{[The]:k3+"="+t+"-"+(t+n-1)}));if(i.status!=206)throw new Error(FD);return new Uint8Array(await i.arrayBuffer())}else return this.data||await R7(this,this.options),new Uint8Array(this.data.subarray(t,t+n))}};async function R7(e,t){let n=await U7(G3,e.url,t);e.data=new Uint8Array(await n.arrayBuffer()),e.size||(e.size=e.data.length)}async function U7(e,t,n,i){i=Object.assign({},n.headers,i);let r=await fetch(t,Object.assign({},n,{method:e,headers:i}));if(r.status<400)return r;throw new Error(xhe+(r.statusText||r.status))}var z7=class extends gm{constructor(t,n){super(),this.url=t,this.preventHeadRequest=n.preventHeadRequest,this.useRangeHeader=n.useRangeHeader,this.forceRangeRequests=n.forceRangeRequests}async init(){if(super.init(),Ehe(this.url)&&!this.preventHeadRequest)return new Promise((t,n)=>H7(bhe,this.url,i=>{this.size=Number(i.getResponseHeader(Che)),this.useRangeHeader?this.forceRangeRequests||i.getResponseHeader(Ahe)==k3?t():n(new Error(FD)):this.size===void 0?M7(this,this.url).then(()=>t()).catch(n):t()},n));await M7(this,this.url)}async readUint8Array(t,n){if(this.useRangeHeader){let i=await new Promise((r,o)=>H7(G3,this.url,s=>r(s),o,[[The,k3+"="+t+"-"+(t+n-1)]]));if(i.status!=206)throw new Error(FD);return new Uint8Array(i.response)}else return this.data||await M7(this,this.url),new Uint8Array(this.data.subarray(t,t+n))}};function M7(e,t){return new Promise((n,i)=>H7(G3,t,r=>{e.data=new Uint8Array(r.response),e.size||(e.size=e.data.length),n()},i))}function H7(e,t,n,i,r=[]){let o=new XMLHttpRequest;return o.addEventListener("load",()=>{o.status<400?n(o):i(xhe+(o.statusText||o.status))},!1),o.addEventListener("error",i,!1),o.open(e,t),r.forEach(s=>o.setRequestHeader(s[0],s[1])),o.responseType="arraybuffer",o.send(),o}var H3=class extends gm{constructor(t,n={}){super(),this.url=t,n.useXHR?this.reader=new z7(t,n):this.reader=new k7(t,n)}set size(t){}get size(){return this.reader.size}async init(){super.init(),await this.reader.init()}async readUint8Array(t,n){return this.reader.readUint8Array(t,n)}},G7=class extends H3{constructor(t,n={}){n.useRangeHeader=!0,super(t,n)}},W7=class extends gm{constructor(t){super(),this.array=t,this.size=t.length}async readUint8Array(t,n){return this.array.slice(t,t+n)}},j7=class extends Kx{constructor(){super(),this.array=new Uint8Array(0)}async writeUint8Array(t){super.writeUint8Array(t);let n=this.array;this.array=new Uint8Array(n.length+t.length),this.array.set(n),this.array.set(t,n.length)}getData(){return this.array}};function Ehe(e){if(typeof document<"u"){let t=document.createElement("a");return t.href=e,t.protocol=="http:"||t.protocol=="https:"}else return/^https?:\/\//i.test(e)}var rE="/",q7=new Date(2107,11,31),Y7=new Date(1980,0,1);var Cnt="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),She=e=>{let t="";for(let n=0;n<e.length;n++)t+=Cnt[e[n]];return t};var whe=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=t>>>1^3988292384:t=t>>>1;whe[e]=t}var X7=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0;for(let i=0,r=t.length|0;i<r;i++)n=n>>>8^whe[(n^t[i])&255];this.crc=n}get(){return~this.crc}},g0=X7;var El={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=El.getPartial(n);return i===32?e.concat(t):El._shiftRight(t,i,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+El.getPartial(n)},clamp(e,t){if(e.length*32<t)return e;e=e.slice(0,Math.ceil(t/32));let n=e.length;return t=t&31,n>0&&t&&(e[n-1]=El.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s<e.length;s++)i.push(n|e[s]>>>t),n=e[s]<<32-t;let r=e.length?e[e.length-1]:0,o=El.getPartial(r);return i.push(El.partial(t+o&31,t+o>32?n:i.pop(),1)),i}},K7={bytes:{fromBits(e){let n=El.bitLength(e)/8,i=new Uint8Array(n),r;for(let o=0;o<n;o++)(o&3)===0&&(r=e[o/4]),i[o]=r>>>24,r<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],(n&3)===3&&(t.push(i),i=0);return n&3&&t.push(El.partial(8*(n&3),i)),t}}},$7={};$7.sha1=function(e){e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()};$7.sha1.prototype={blockSize:512,reset:function(){let e=this;return e._h=this._init.slice(0),e._buffer=[],e._length=0,e},update:function(e){let t=this;typeof e=="string"&&(e=K7.utf8String.toBits(e));let n=t._buffer=El.concat(t._buffer,e),i=t._length,r=t._length=i+El.bitLength(e);if(r>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let o=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=r;a+=t.blockSize)t._block(o.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t},finalize:function(){let e=this,t=e._buffer,n=e._h;t=El.concat(t,[El.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:function(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i},_S:function(e,t){return t<<e|t>>>32-e},_block:function(e){let t=this,n=t._h,i=Array(80);for(let u=0;u<16;u++)i[u]=e[u];let r=n[0],o=n[1],s=n[2],a=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,r)+t._f(u,o,s,a)+c+i[u]+t._key[Math.floor(u/20)]|0;c=a,a=s,s=t._S(30,o),o=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};var Z7={};Z7.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],r=e.length,o,s,a,c=1;if(r!==4&&r!==6&&r!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],o=r;o<4*r+28;o++){let u=s[o-1];(o%r===0||r===8&&o%r===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],o%r===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),s[o]=s[o-r]^u}for(let u=0;o;u++,o--){let f=s[u&3?o:o-4];o<=4||u<4?a[u]=f:a[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],r=[],o=[],s,a,c,u;for(let f=0;f<256;f++)o[(r[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=o[s]||1){let d=s^s<<1^s<<2^s<<3^s<<4;d=d>>8^d&255^99,n[f]=d,i[d]=f,u=r[c=r[a=r[f]]];let p=u*16843009^c*65537^a*257^f*16843008,g=r[d]*257^d*16843008;for(let m=0;m<4;m++)e[m][f]=g=g<<24^g>>>8,t[m][d]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,r=[0,0,0,0],o=this._tables[t],s=o[0],a=o[1],c=o[2],u=o[3],f=o[4],d=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],m=e[t?1:3]^n[3],x=4,C,A,b;for(let T=0;T<i;T++)C=s[d>>>24]^a[p>>16&255]^c[g>>8&255]^u[m&255]^n[x],A=s[p>>>24]^a[g>>16&255]^c[m>>8&255]^u[d&255]^n[x+1],b=s[g>>>24]^a[m>>16&255]^c[d>>8&255]^u[p&255]^n[x+2],m=s[m>>>24]^a[d>>16&255]^c[p>>8&255]^u[g&255]^n[x+3],x+=4,d=C,p=A,g=b;for(let T=0;T<4;T++)r[t?3&-T:T]=f[d>>>24]<<24^f[p>>16&255]<<16^f[g>>8&255]<<8^f[m&255]^n[x++],C=d,d=p,p=g,g=m,m=C;return r}};var J7={};J7.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let r=El.bitLength(t);for(let o=0;o<i;o+=4){this.incCounter(n);let s=e.encrypt(n);t[o]^=s[0],t[o+1]^=s[1],t[o+2]^=s[2],t[o+3]^=s[3]}return El.clamp(t,r)}};var Q7={};Q7.hmacSha1=class{constructor(e){let t=this,n=t._hash=$7.sha1,i=[[],[]],r=n.prototype.blockSize/32;t._baseHash=[new n,new n],e.length>r&&(e=n.hash(e));for(let o=0;o<r;o++)i[0][o]=e[o]^909522486,i[1][o]=e[o]^1549556828;t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){let e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){let t=this;t._updated=!0,t._resultHash.update(e)}digest(){let e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}};var $x="Invalid pasword",oE=16,Ant="raw",vhe={name:"PBKDF2"},Tnt={name:"HMAC"},bnt="SHA-1",Ent=Object.assign({hash:Tnt},vhe),Snt=Object.assign({iterations:1e3,hash:{name:bnt}},vhe),wnt=["deriveBits"],UD=[8,12,16],kD=[16,24,32],y0=10,Dhe=[0,0,0,0],ym=K7.bytes,Phe=Z7.aes,Ihe=J7.ctrGladman,Ohe=Q7.hmacSha1,W3=class{constructor(t,n,i){Object.assign(this,{password:t,signed:n,strength:i-1,pendingInput:new Uint8Array(0)})}async append(t){let n=this;if(n.password){let r=yu(t,0,UD[n.strength]+2);await vnt(n,r,n.password),n.password=null,n.aesCtrGladman=new Ihe(new Phe(n.keys.key),Array.from(Dhe)),n.hmac=new Ohe(n.keys.authentication),t=yu(t,UD[n.strength]+2)}let i=new Uint8Array(t.length-y0-(t.length-y0)%oE);return Rhe(n,t,i,0,y0,!0)}flush(){let t=this,n=t.pendingInput,i=yu(n,0,n.length-y0),r=yu(n,n.length-y0),o=new Uint8Array(0);if(i.length){let a=ym.toBits(i);t.hmac.update(a);let c=t.aesCtrGladman.update(a);o=ym.fromBits(c)}let s=!0;if(t.signed){let a=yu(ym.fromBits(t.hmac.digest()),0,y0);for(let c=0;c<y0;c++)a[c]!=r[c]&&(s=!1)}return{valid:s,data:o}}},j3=class{constructor(t,n){Object.assign(this,{password:t,strength:n-1,pendingInput:new Uint8Array(0)})}async append(t){let n=this,i=new Uint8Array(0);n.password&&(i=await Dnt(n,n.password),n.password=null,n.aesCtrGladman=new Ihe(new Phe(n.keys.key),Array.from(Dhe)),n.hmac=new Ohe(n.keys.authentication));let r=new Uint8Array(i.length+t.length-t.length%oE);return r.set(i,0),Rhe(n,t,r,i.length,0)}flush(){let t=this,n=new Uint8Array(0);if(t.pendingInput.length){let r=t.aesCtrGladman.update(ym.toBits(t.pendingInput));t.hmac.update(r),n=ym.fromBits(r)}let i=yu(ym.fromBits(t.hmac.digest()),0,y0);return{data:ej(n,i),signature:i}}};function Rhe(e,t,n,i,r,o){let s=t.length-r;e.pendingInput.length&&(t=ej(e.pendingInput,t),n=Pnt(n,s-s%oE));let a;for(a=0;a<=s-oE;a+=oE){let c=ym.toBits(yu(t,a,a+oE));o&&e.hmac.update(c);let u=e.aesCtrGladman.update(c);o||e.hmac.update(u),n.set(ym.fromBits(u),a+i)}return e.pendingInput=yu(t,a),n}async function vnt(e,t,n){await Mhe(e,n,yu(t,0,UD[e.strength]));let i=yu(t,UD[e.strength]),r=e.keys.passwordVerification;if(r[0]!=i[0]||r[1]!=i[1])throw new Error($x)}async function Dnt(e,t){let n=crypto.getRandomValues(new Uint8Array(UD[e.strength]));return await Mhe(e,t,n),ej(n,e.keys.passwordVerification)}async function Mhe(e,t,n){let i=new TextEncoder().encode(t),r=await crypto.subtle.importKey(Ant,i,Ent,!1,wnt),o=await crypto.subtle.deriveBits(Object.assign({salt:n},Snt),r,8*(kD[e.strength]*2+2)),s=new Uint8Array(o);e.keys={key:ym.toBits(yu(s,0,kD[e.strength])),authentication:ym.toBits(yu(s,kD[e.strength],kD[e.strength]*2)),passwordVerification:yu(s,kD[e.strength]*2)}}function ej(e,t){let n=e;return e.length+t.length&&(n=new Uint8Array(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function Pnt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function yu(e,t,n){return e.subarray(t,n)}var sE=12,q3=class{constructor(t,n){let i=this;Object.assign(i,{password:t,passwordVerification:n}),Fhe(i,t)}append(t){let n=this;if(n.password){let i=Bhe(n,t.subarray(0,sE));if(n.password=null,i[sE-1]!=n.passwordVerification)throw new Error($x);t=t.subarray(sE)}return Bhe(n,t)}flush(){return{valid:!0,data:new Uint8Array(0)}}},Y3=class{constructor(t,n){let i=this;Object.assign(i,{password:t,passwordVerification:n}),Fhe(i,t)}append(t){let n=this,i,r;if(n.password){n.password=null;let o=crypto.getRandomValues(new Uint8Array(sE));o[sE-1]=n.passwordVerification,i=new Uint8Array(t.length+o.length),i.set(Lhe(n,o),0),r=sE}else i=new Uint8Array(t.length),r=0;return i.set(Lhe(n,t),r),i}flush(){return{data:new Uint8Array(0)}}};function Bhe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=Vhe(e)^t[i],tj(e,n[i]);return n}function Lhe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=Vhe(e)^t[i],tj(e,t[i]);return n}function Fhe(e,t){e.keys=[305419896,591751049,878082192],e.crcKey0=new g0(e.keys[0]),e.crcKey2=new g0(e.keys[2]);for(let n=0;n<t.length;n++)tj(e,t.charCodeAt(n))}function tj(e,t){e.crcKey0.append([t]),e.keys[0]=~e.crcKey0.get(),e.keys[1]=Nhe(e.keys[1]+khe(e.keys[0])),e.keys[1]=Nhe(Math.imul(e.keys[1],134775813)+1),e.crcKey2.append([e.keys[1]>>>24]),e.keys[2]=~e.crcKey2.get()}function Vhe(e){let t=e.keys[2]|2;return khe(Math.imul(t,t^1)>>>8)}function khe(e){return e&255}function Nhe(e){return e&4294967295}var X3="deflate",K3="inflate",zD="Invalid signature",nj=class{constructor(t,{signature:n,password:i,signed:r,compressed:o,zipCrypto:s,passwordVerification:a,encryptionStrength:c},{chunkSize:u}){let f=Boolean(i);Object.assign(this,{signature:n,encrypted:f,signed:r,compressed:o,inflate:o&&new t({chunkSize:u}),crc32:r&&new g0,zipCrypto:s,decrypt:f&&s?new q3(i,a):new W3(i,r,c)})}async append(t){let n=this;return n.encrypted&&t.length&&(t=await n.decrypt.append(t)),n.compressed&&t.length&&(t=await n.inflate.append(t)),(!n.encrypted||n.zipCrypto)&&n.signed&&t.length&&n.crc32.append(t),t}async flush(){let t=this,n,i=new Uint8Array(0);if(t.encrypted){let r=t.decrypt.flush();if(!r.valid)throw new Error(zD);i=r.data}if((!t.encrypted||t.zipCrypto)&&t.signed){let r=new DataView(new Uint8Array(4).buffer);if(n=t.crc32.get(),r.setUint32(0,n),t.signature!=r.getUint32(0,!1))throw new Error(zD)}return t.compressed&&(i=await t.inflate.append(i)||new Uint8Array(0),await t.inflate.flush()),{data:i,signature:n}}},ij=class{constructor(t,{encrypted:n,signed:i,compressed:r,level:o,zipCrypto:s,password:a,passwordVerification:c,encryptionStrength:u},{chunkSize:f}){Object.assign(this,{encrypted:n,signed:i,compressed:r,deflate:r&&new t({level:o||5,chunkSize:f}),crc32:i&&new g0,zipCrypto:s,encrypt:n&&s?new Y3(a,c):new j3(a,u)})}async append(t){let n=this,i=t;return n.compressed&&t.length&&(i=await n.deflate.append(t)),n.encrypted&&i.length&&(i=await n.encrypt.append(i)),(!n.encrypted||n.zipCrypto)&&n.signed&&t.length&&n.crc32.append(t),i}async flush(){let t=this,n,i=new Uint8Array(0);if(t.compressed&&(i=await t.deflate.flush()||new Uint8Array(0)),t.encrypted){i=await t.encrypt.append(i);let r=t.encrypt.flush();n=r.signature;let o=new Uint8Array(i.length+r.data.length);o.set(i,0),o.set(r.data,i.length),i=o}return(!t.encrypted||t.zipCrypto)&&t.signed&&(n=t.crc32.get()),{data:i,signature:n}}};function Uhe(e,t,n){if(t.codecType.startsWith(X3))return new ij(e,t,n);if(t.codecType.startsWith(K3))return new nj(e,t,n)}var Mnt={},zhe="init",Hhe="append",rj="flush",Int="message",Ghe=!0,$3=(e,t,n,i,r,o,s)=>(Object.assign(e,{busy:!0,codecConstructor:t,options:Object.assign({},n),scripts:s,terminate(){e.worker&&!e.busy&&(e.worker.terminate(),e.interface=null)},onTaskFinished(){e.busy=!1,r(e)}}),o?Rnt(e,i):Ont(e,i));function Ont(e,t){let n=Uhe(e.codecConstructor,e.options,t);return{async append(i){try{return await n.append(i)}catch(r){throw e.onTaskFinished(),r}},async flush(){try{return await n.flush()}finally{e.onTaskFinished()}}}}function Rnt(e,t){let n,i={type:"module"};if(!e.interface){if(!Ghe)e.worker=r(i);else try{e.worker=r()}catch{Ghe=!1,e.worker=r(i)}e.worker.addEventListener(Int,a,!1),e.interface={append(c){return o({type:Hhe,data:c})},flush(){return o({type:rj})}}}return e.interface;function r(c={}){return new Worker(new URL(e.scripts[0],Mnt.url),c)}async function o(c){if(!n){let u=e.options,f=e.scripts.slice(1);await s({scripts:f,type:zhe,options:u,config:{chunkSize:t.chunkSize}})}return s(c)}function s(c){let u=e.worker,f=new Promise((d,p)=>n={resolve:d,reject:p});try{if(c.data)try{c.data=c.data.buffer,u.postMessage(c,[c.data])}catch{u.postMessage(c)}else u.postMessage(c)}catch(d){n.reject(d),n=null,e.onTaskFinished()}return f}function a(c){let u=c.data;if(n){let f=u.error,d=u.type;if(f){let p=new Error(f.message);p.stack=f.stack,n.reject(p),n=null,e.onTaskFinished()}else if(d==zhe||d==rj||d==Hhe){let p=u.data;d==rj?(n.resolve({data:new Uint8Array(p),signature:u.signature}),n=null,e.onTaskFinished()):n.resolve(p&&new Uint8Array(p))}}}}var Zx=[],oj=[];function Z3(e,t,n){let r=!(!t.compressed&&!t.signed&&!t.encrypted)&&(t.useWebWorkers||t.useWebWorkers===void 0&&n.useWebWorkers),o=r&&n.workerScripts?n.workerScripts[t.codecType]:[];if(Zx.length<n.maxWorkers){let a={};return Zx.push(a),$3(a,e,t,n,s,r,o)}else{let a=Zx.find(c=>!c.busy);return a?(Whe(a),$3(a,e,t,n,s,r,o)):new Promise(c=>oj.push({resolve:c,codecConstructor:e,options:t,webWorker:r,scripts:o}))}function s(a){if(oj.length){let[{resolve:c,codecConstructor:u,options:f,webWorker:d,scripts:p}]=oj.splice(0,1);c($3(a,u,f,n,s,d,p))}else a.worker?(Whe(a),Number.isFinite(n.terminateWorkerTimeout)&&n.terminateWorkerTimeout>=0&&(a.terminateTimeout=setTimeout(()=>{Zx=Zx.filter(c=>c!=a),a.terminate()},n.terminateWorkerTimeout))):Zx=Zx.filter(c=>c!=a)}}function Whe(e){e.terminateTimeout&&(clearTimeout(e.terminateTimeout),e.terminateTimeout=null)}var Bnt=["filename","rawFilename","directory","encrypted","compressedSize","uncompressedSize","lastModDate","rawLastModDate","comment","rawComment","signature","extraField","rawExtraField","bitFlag","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","filenameUTF8","commentUTF8","offset","zip64","compressionMethod","extraFieldNTFS","lastAccessDate","creationDate","extraFieldExtendedTimestamp","version","versionMadeBy","msDosCompatible","internalFileAttribute","externalFileAttribute"],e_=class{constructor(t){Bnt.forEach(n=>this[n]=t[n])}};var J3="File format is not recognized",Khe="End of central directory not found",$he="End of Zip64 central directory not found",Zhe="End of Zip64 central directory locator not found",Jhe="Central directory header not found",Qhe="Local file header not found",eme="Zip64 extra field not found",tme="File contains encrypted entry",nme="Encryption method not supported",lj="Compression method not supported",jhe="utf-8",qhe=["uncompressedSize","compressedSize","offset"],uj=class{constructor(t,n={}){Object.assign(this,{reader:t,options:n,config:F3()})}async getEntries(t={}){let n=this,i=n.reader;if(i.initialized||await i.init(),i.size<22)throw new Error(J3);let r=await Hnt(i,101010256,i.size,22,65535*16);if(!r)throw new Error(Khe);let o=Qa(r),s=ea(o,12),a=ea(o,16),c=xu(o,8),u=0;if(a==4294967295||s==4294967295||c==65535){let x=await x0(i,r.offset-20,20),C=Qa(x);if(ea(C,0)!=117853008)throw new Error($he);a=Q3(C,8);let A=await x0(i,a,56),b=Qa(A),T=r.offset-20-56;if(ea(b,0)!=101075792&&a!=T){let S=a;a=T,u=a-S,A=await x0(i,a,56),b=Qa(A)}if(ea(b,0)!=101075792)throw new Error(Zhe);c=Q3(b,32),s=Q3(b,40),a-=s}if(a<0||a>=i.size)throw new Error(J3);let f=0,d=await x0(i,a,s),p=Qa(d),g=r.offset-s;if(ea(p,f)!=33639248&&a!=g){let x=a;a=g,u=a-x,d=await x0(i,a,s),p=Qa(d)}if(a<0||a>=i.size)throw new Error(J3);let m=[];for(let x=0;x<c;x++){let C=new fj(i,n.config,n.options);if(ea(p,f)!=33639248)throw new Error(Jhe);ime(C,p,f+6);let A=Boolean(C.bitFlag.languageEncodingFlag),b=f+46,T=b+C.filenameLength,S=T+C.extraFieldLength,w=xu(p,f+4),D=(w&0)==0;Object.assign(C,{versionMadeBy:w,msDosCompatible:D,compressedSize:0,uncompressedSize:0,commentLength:xu(p,f+32),directory:D&&(cE(p,f+38)&16)==16,offset:ea(p,f+42)+u,internalFileAttribute:ea(p,f+34),externalFileAttribute:ea(p,f+38),rawFilename:d.subarray(b,T),filenameUTF8:A,commentUTF8:A,rawExtraField:d.subarray(T,S)});let I=S+C.commentLength;C.rawComment=d.subarray(S,I),C.filename=Xhe(C.rawFilename,C.filenameUTF8?jhe:aE(n,t,"filenameEncoding")),C.comment=Xhe(C.rawComment,C.commentUTF8?jhe:aE(n,t,"commentEncoding")),!C.directory&&C.filename.endsWith(rE)&&(C.directory=!0),rme(C,C,p,f+6);let O=new e_(C);if(O.getData=(B,L)=>C.getData(B,O,L),m.push(O),f=I,t.onprogress)try{t.onprogress(x+1,c,new e_(C))}catch{}}return m}async close(){}};var fj=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i={}){let r=this,{reader:o,offset:s,extraFieldAES:a,compressionMethod:c,config:u,bitFlag:f,signature:d,rawLastModDate:p,compressedSize:g}=r,m=r.localDirectory={};o.initialized||await o.init();let x=await x0(o,s,30),C=Qa(x),A=aE(r,i,"password");if(A=A&&A.length&&A,a&&a.originalCompressionMethod!=99)throw new Error(lj);if(c!=0&&c!=8)throw new Error(lj);if(ea(C,0)!=67324752)throw new Error(Qhe);ime(m,C,4),x=await x0(o,s,30+m.filenameLength+m.extraFieldLength),m.rawExtraField=x.subarray(30+m.filenameLength),rme(r,m,C,4),n.lastAccessDate=m.lastAccessDate,n.creationDate=m.creationDate;let b=r.encrypted&&m.encrypted,T=b&&!a;if(b){if(!T&&a.strength===void 0)throw new Error(nme);if(!A)throw new Error(tme)}let S=await Z3(u.Inflate,{codecType:K3,password:A,zipCrypto:T,encryptionStrength:a&&a.strength,signed:aE(r,i,"checkSignature"),passwordVerification:T&&(f.dataDescriptor?p>>>8&255:d>>>24&255),signature:d,compressed:c!=0,encrypted:b,useWebWorkers:aE(r,i,"useWebWorkers")},u);t.initialized||await t.init();let w=aE(r,i,"signal"),D=s+30+m.filenameLength+m.extraFieldLength;return await V3(S,o,t,D,g,u,{onprogress:i.onprogress,signal:w}),t.getData()}};function ime(e,t,n){let i=e.rawBitFlag=xu(t,n+2),r=(i&1)==1,o=ea(t,n+6);Object.assign(e,{encrypted:r,version:xu(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:o,lastModDate:Gnt(o),filenameLength:xu(t,n+22),extraFieldLength:xu(t,n+24)})}function rme(e,t,n,i){let r=t.rawExtraField,o=t.extraField=new Map,s=Qa(new Uint8Array(r)),a=0;try{for(;a<r.length;){let x=xu(s,a),C=xu(s,a+2);o.set(x,{type:x,data:r.slice(a+4,a+4+C)}),a+=4+C}}catch{}let c=xu(n,i+4);t.signature=ea(n,i+10),t.uncompressedSize=ea(n,i+18),t.compressedSize=ea(n,i+14);let u=o.get(1);u&&(Vnt(u,t),t.extraFieldZip64=u);let f=o.get(28789);f&&(Yhe(f,"filename","rawFilename",t,e),t.extraFieldUnicodePath=f);let d=o.get(25461);d&&(Yhe(d,"comment","rawComment",t,e),t.extraFieldUnicodeComment=d);let p=o.get(39169);p?(knt(p,t,c),t.extraFieldAES=p):t.compressionMethod=c;let g=o.get(10);g&&(Unt(g,t),t.extraFieldNTFS=g);let m=o.get(21589);m&&(znt(m,t),t.extraFieldExtendedTimestamp=m)}function Vnt(e,t){t.zip64=!0;let n=Qa(e.data);e.values=[];for(let r=0;r<Math.floor(e.data.length/8);r++)e.values.push(Q3(n,0+r*8));let i=qhe.filter(r=>t[r]==4294967295);for(let r=0;r<i.length;r++)e[i[r]]=e.values[r];qhe.forEach(r=>{if(t[r]==4294967295)if(e[r]!==void 0)t[r]=e[r];else throw new Error(eme)})}function Yhe(e,t,n,i,r){let o=Qa(e.data);e.version=cE(o,0),e.signature=ea(o,1);let s=new g0;s.append(r[n]);let a=Qa(new Uint8Array(4));a.setUint32(0,s.get(),!0),e[t]=new TextDecoder().decode(e.data.subarray(5)),e.valid=!r.bitFlag.languageEncodingFlag&&e.signature==ea(a,0),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function knt(e,t,n){let i=Qa(e.data);e.vendorVersion=cE(i,0),e.vendorId=cE(i,2);let r=cE(i,4);e.strength=r,e.originalCompressionMethod=n,t.compressionMethod=e.compressionMethod=xu(i,5)}function Unt(e,t){let n=Qa(e.data),i=4,r;try{for(;i<e.data.length&&!r;){let o=xu(n,i),s=xu(n,i+2);o==1&&(r=e.data.slice(i+4,i+4+s)),i+=4+s}}catch{}try{if(r&&r.length==24){let o=Qa(r),s=o.getBigUint64(0,!0),a=o.getBigUint64(8,!0),c=o.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let u=cj(s),f=cj(a),d=cj(c),p={lastModDate:u,lastAccessDate:f,creationDate:d};Object.assign(e,p),Object.assign(t,p)}}catch{}}function znt(e,t){let n=Qa(e.data),i=cE(n,0),r=[],o=[];(i&1)==1&&(r.push("lastModDate"),o.push("rawLastModDate")),(i&2)==2&&(r.push("lastAccessDate"),o.push("rawLastAccessDate")),(i&4)==4&&(r.push("creationDate"),o.push("rawCreationDate"));let s=1;r.forEach((a,c)=>{if(e.data.length>=s+4){let u=ea(n,s);t[a]=e[a]=new Date(u*1e3);let f=o[c];e[f]=u}s+=4})}async function Hnt(e,t,n,i,r){let o=new Uint8Array(4),s=Qa(o);Wnt(s,0,t);let a=i+r;return await c(i)||await c(Math.min(a,n));async function c(u){let f=n-u,d=await x0(e,f,u);for(let p=d.length-i;p>=0;p--)if(d[p]==o[0]&&d[p+1]==o[1]&&d[p+2]==o[2]&&d[p+3]==o[3])return{offset:f+p,buffer:d.slice(p,p+i).buffer}}}function aE(e,t,n){return t[n]===void 0?e.options[n]:t[n]}function Xhe(e,t){return!t||t.trim().toLowerCase()=="cp437"?She(e):new TextDecoder(t).decode(e)}function Gnt(e){let t=(e&4294901760)>>16,n=e&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0)}catch{}}function cj(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function cE(e,t){return e.getUint8(t)}function xu(e,t){return e.getUint16(t,!0)}function ea(e,t){return e.getUint32(t,!0)}function Q3(e,t){return Number(e.getBigUint64(t,!0))}function Wnt(e,t,n){e.setUint32(t,n,!0)}function Qa(e){return new DataView(e.buffer)}function x0(e,t,n){return e.readUint8Array(t,n)}var lme="File already exists",ume="Zip file comment exceeds 64KB",fme="File entry comment exceeds 64KB",dme="File entry name exceeds 64KB",bj="Version exceeds 65535",hme="The strength must equal 1, 2, or 3",mme="Extra field type exceeds 65535",pme="Extra field data exceeds 64KB",uV="Zip64 is not supported",ame=new Uint8Array([7,0,2,0,65,69,3,0,0]),cme=24,Aj=0,Ej=class{constructor(t,n={}){Object.assign(this,{writer:t,options:n,config:F3(),files:new Map,offset:t.size,pendingCompressedSize:0,pendingEntries:[]})}async add(t="",n,i={}){let r=this;if(Aj<r.config.maxWorkers){Aj++;try{return await Knt(r,t,n,i)}finally{Aj--;let o=r.pendingEntries.shift();o&&r.add(o.name,o.reader,o.options).then(o.resolve).catch(o.reject)}}else return new Promise((o,s)=>r.pendingEntries.push({name:t,reader:n,options:i,resolve:o,reject:s}))}async close(t=new Uint8Array(0),n={}){return await Jnt(this,t,n),this.writer.getData()}};async function Knt(e,t,n,i){if(t=t.trim(),i.directory&&!t.endsWith(rE)?t+=rE:i.directory=t.endsWith(rE),e.files.has(t))throw new Error(lme);let r=new TextEncoder().encode(t);if(r.length>65535)throw new Error(dme);let o=i.comment||"",s=new TextEncoder().encode(o);if(s.length>65535)throw new Error(fme);let a=e.options.version||i.version||0;if(a>65535)throw new Error(bj);let c=e.options.versionMadeBy||i.versionMadeBy||20;if(c>65535)throw new Error(bj);let u=Sa(e,i,"lastModDate")||new Date,f=Sa(e,i,"lastAccessDate"),d=Sa(e,i,"creationDate"),p=Sa(e,i,"password"),g=Sa(e,i,"encryptionStrength")||3,m=Sa(e,i,"zipCrypto");if(p!==void 0&&g!==void 0&&(g<1||g>3))throw new Error(hme);let x=new Uint8Array(0),C=i.extraField;if(C){let F=0,U=0;C.forEach(k=>F+=4+k.length),x=new Uint8Array(F),C.forEach((k,H)=>{if(H>65535)throw new Error(mme);if(k.length>65535)throw new Error(pme);na(x,new Uint16Array([H]),U),na(x,new Uint16Array([k.length]),U+2),na(x,k,U+4),U+=4+k.length})}let A=Sa(e,i,"extendedTimestamp");A===void 0&&(A=!0);let b=0,T=Sa(e,i,"keepOrder");T===void 0&&(T=!0);let S=0,w=Sa(e,i,"msDosCompatible");w===void 0&&(w=!0);let D=Sa(e,i,"internalFileAttribute")||0,I=Sa(e,i,"externalFileAttribute")||0;n&&(n.initialized||await n.init(),S=n.size,b=eit(S));let O=i.zip64||e.options.zip64||!1;if(e.offset+e.pendingCompressedSize>=4294967295||S>=4294967295||b>=4294967295){if(i.zip64===!1||e.options.zip64===!1||!T)throw new Error(uV);O=!0}e.pendingCompressedSize+=b,await Promise.resolve();let B=Sa(e,i,"level"),L=Sa(e,i,"useWebWorkers"),_=Sa(e,i,"bufferedWrite"),E=Sa(e,i,"dataDescriptor"),v=Sa(e,i,"dataDescriptorSignature"),P=Sa(e,i,"signal");E===void 0&&(E=!0),E&&v===void 0&&(v=!0);let R=await $nt(e,t,n,Object.assign({},i,{rawFilename:r,rawComment:s,version:a,versionMadeBy:c,lastModDate:u,lastAccessDate:f,creationDate:d,rawExtraField:x,zip64:O,password:p,level:B,useWebWorkers:L,encryptionStrength:g,extendedTimestamp:A,zipCrypto:m,bufferedWrite:_,keepOrder:T,dataDescriptor:E,dataDescriptorSignature:v,signal:P,msDosCompatible:w,internalFileAttribute:D,externalFileAttribute:I}));return b&&(e.pendingCompressedSize-=b),Object.assign(R,{name:t,comment:o,extraField:C}),new e_(R)}async function $nt(e,t,n,i){let r=e.files,o=e.writer,s=Array.from(r.values()).pop(),a={},c,u,f;r.set(t,a);try{let d,p,g;if(i.keepOrder&&(d=s&&s.lock),a.lock=g=new Promise(m=>f=m),i.bufferedWrite||e.lockWrite||!i.dataDescriptor?(p=new VD,p.init(),c=!0):(e.lockWrite=new Promise(m=>u=m),o.initialized||await o.init(),p=o),a=await Znt(n,p,e.config,i),a.lock=g,r.set(t,a),a.filename=t,c){let m=0,x=p.getData();await Promise.all([e.lockWrite,d]);let C;do C=Array.from(r.values()).find(A=>A.writingBufferedData),C&&await C.lock;while(C&&C.lock);if(a.writingBufferedData=!0,!i.dataDescriptor){let b=await _me(x,0,26),T=new DataView(b);(!a.encrypted||i.zipCrypto)&&mr(T,14,a.signature),a.zip64?(mr(T,18,4294967295),mr(T,22,4294967295)):(mr(T,18,a.compressedSize),mr(T,22,a.uncompressedSize)),await o.writeUint8Array(new Uint8Array(b)),m=26}await Qnt(o,x,m),delete a.writingBufferedData}if(a.offset=e.offset,a.zip64){let m=Hd(a.rawExtraFieldZip64);Sl(m,20,BigInt(a.offset))}else if(a.offset>=4294967295)throw new Error(uV);return e.offset+=a.length,a}catch(d){throw(c&&a.writingBufferedData||!c&&a.dataWritten)&&(d.corruptedEntry=e.hasCorruptedEntries=!0,a.uncompressedSize&&(e.offset+=a.uncompressedSize)),r.delete(t),d}finally{f(),u&&u()}}async function Znt(e,t,n,i){let{rawFilename:r,lastAccessDate:o,creationDate:s,password:a,level:c,zip64:u,zipCrypto:f,dataDescriptor:d,dataDescriptorSignature:p,directory:g,version:m,versionMadeBy:x,rawComment:C,rawExtraField:A,useWebWorkers:b,onprogress:T,signal:S,encryptionStrength:w,extendedTimestamp:D,msDosCompatible:I,internalFileAttribute:O,externalFileAttribute:B}=i,L=Boolean(a&&a.length),_=c!==0&&!g,E;if(L&&!f){E=new Uint8Array(ame.length+2);let Oe=Hd(E);Jr(Oe,0,39169),na(E,ame,2),lV(Oe,8,w)}else E=new Uint8Array(0);let v,P;if(D){P=new Uint8Array(9+(o?4:0)+(s?4:0));let Oe=Hd(P);Jr(Oe,0,21589),Jr(Oe,2,P.length-4);let Be=1+(o?2:0)+(s?4:0);lV(Oe,4,Be),mr(Oe,5,Math.floor(i.lastModDate.getTime()/1e3)),o&&mr(Oe,9,Math.floor(o.getTime()/1e3)),s&&mr(Oe,13,Math.floor(s.getTime()/1e3));try{v=new Uint8Array(36);let tt=Hd(v),lt=Tj(i.lastModDate);Jr(tt,0,10),Jr(tt,2,32),Jr(tt,8,1),Jr(tt,10,24),Sl(tt,12,lt),Sl(tt,20,Tj(o)||lt),Sl(tt,28,Tj(s)||lt)}catch{v=new Uint8Array(0)}}else v=P=new Uint8Array(0);let R={version:m||20,versionMadeBy:x,zip64:u,directory:Boolean(g),filenameUTF8:!0,rawFilename:r,commentUTF8:!0,rawComment:C,rawExtraFieldZip64:u?new Uint8Array(cme+4):new Uint8Array(0),rawExtraFieldExtendedTimestamp:P,rawExtraFieldNTFS:v,rawExtraFieldAES:E,rawExtraField:A,extendedTimestamp:D,msDosCompatible:I,internalFileAttribute:O,externalFileAttribute:B},F=R.uncompressedSize=0,U=2048;d&&(U=U|8);let k=0;_&&(k=8),u&&(R.version=R.version>45?R.version:45),L&&(U=U|1,f||(R.version=R.version>51?R.version:51,k=99,_&&(R.rawExtraFieldAES[9]=8))),R.compressionMethod=k;let H=R.headerArray=new Uint8Array(26),V=Hd(H);Jr(V,0,R.version),Jr(V,2,U),Jr(V,4,k);let q=new Uint32Array(1),j=Hd(q),X;i.lastModDate<Y7?X=Y7:i.lastModDate>q7?X=q7:X=i.lastModDate,Jr(j,0,(X.getHours()<<6|X.getMinutes())<<5|X.getSeconds()/2),Jr(j,2,(X.getFullYear()-1980<<4|X.getMonth()+1)<<5|X.getDate());let G=q[0];mr(V,6,G),Jr(V,22,r.length);let $=E.length+P.length+v.length+R.rawExtraField.length;Jr(V,24,$);let J=new Uint8Array(30+r.length+$),ce=Hd(J);mr(ce,0,67324752),na(J,H,4),na(J,r,30),na(J,E,30+r.length),na(J,P,30+r.length+E.length),na(J,v,30+r.length+E.length+P.length),na(J,R.rawExtraField,30+r.length+E.length+P.length+v.length);let de,ie=0;if(e){F=R.uncompressedSize=e.size;let Oe=await Z3(n.Deflate,{codecType:X3,level:c,password:a,encryptionStrength:w,zipCrypto:L&&f,passwordVerification:L&&f&&G>>8&255,signed:!0,compressed:_,encrypted:L,useWebWorkers:b},n);await t.writeUint8Array(J),R.dataWritten=!0,de=await V3(Oe,e,t,0,F,n,{onprogress:T,signal:S}),ie=de.length}else await t.writeUint8Array(J),R.dataWritten=!0;let ae=new Uint8Array(0),_e,be=0;if(d&&(ae=new Uint8Array(u?p?24:20:p?16:12),_e=Hd(ae),p&&(be=4,mr(_e,0,134695760))),e){let Oe=de.signature;if((!L||f)&&Oe!==void 0&&(mr(V,10,Oe),R.signature=Oe,d&&mr(_e,be,Oe)),u){let Be=Hd(R.rawExtraFieldZip64);Jr(Be,0,1),Jr(Be,2,cme),mr(V,14,4294967295),Sl(Be,12,BigInt(ie)),mr(V,18,4294967295),Sl(Be,4,BigInt(F)),d&&(Sl(_e,be+4,BigInt(ie)),Sl(_e,be+12,BigInt(F)))}else mr(V,14,ie),mr(V,18,F),d&&(mr(_e,be+4,ie),mr(_e,be+8,F))}d&&await t.writeUint8Array(ae);let Te=J.length+ie+ae.length;return Object.assign(R,{compressedSize:ie,lastModDate:X,rawLastModDate:G,creationDate:s,lastAccessDate:o,encrypted:L,length:Te}),R}async function Jnt(e,t,n){let i=e.writer,r=e.files,o=0,s=0,a=e.offset,c=r.size;for(let[,p]of r)s+=46+p.rawFilename.length+p.rawComment.length+p.rawExtraFieldZip64.length+p.rawExtraFieldAES.length+p.rawExtraFieldExtendedTimestamp.length+p.rawExtraFieldNTFS.length+p.rawExtraField.length;let u=n.zip64||e.options.zip64||!1;if(a>=4294967295||s>=4294967295||c>=65535){if(n.zip64===!1||e.options.zip64===!1)throw new Error(uV);u=!0}let f=new Uint8Array(s+(u?98:22)),d=Hd(f);if(t&&t.length)if(t.length<=65535)Jr(d,o+20,t.length);else throw new Error(ume);for(let[p,g]of Array.from(r.values()).entries()){let{rawFilename:m,rawExtraFieldZip64:x,rawExtraFieldAES:C,rawExtraField:A,rawComment:b,versionMadeBy:T,headerArray:S,directory:w,zip64:D,msDosCompatible:I,internalFileAttribute:O,externalFileAttribute:B}=g,L,_;if(g.extendedTimestamp){_=g.rawExtraFieldNTFS,L=new Uint8Array(9);let v=Hd(L);Jr(v,0,21589),Jr(v,2,L.length-4),lV(v,4,1),mr(v,5,Math.floor(g.lastModDate.getTime()/1e3))}else _=L=new Uint8Array(0);let E=x.length+C.length+L.length+_.length+A.length;if(mr(d,o,33639248),Jr(d,o+4,T),na(f,S,o+6),Jr(d,o+30,E),Jr(d,o+32,b.length),mr(d,o+34,O),B?mr(d,o+38,B):w&&I&&lV(d,o+38,16),D?mr(d,o+42,4294967295):mr(d,o+42,g.offset),na(f,m,o+46),na(f,x,o+46+m.length),na(f,C,o+46+m.length+x.length),na(f,L,o+46+m.length+x.length+C.length),na(f,_,o+46+m.length+x.length+C.length+L.length),na(f,A,o+46+m.length+x.length+C.length+L.length+_.length),na(f,b,o+46+m.length+E),o+=46+m.length+E+b.length,n.onprogress)try{n.onprogress(p+1,r.size,new e_(g))}catch{}}u&&(mr(d,o,101075792),Sl(d,o+4,BigInt(44)),Jr(d,o+12,45),Jr(d,o+14,45),Sl(d,o+24,BigInt(c)),Sl(d,o+32,BigInt(c)),Sl(d,o+40,BigInt(s)),Sl(d,o+48,BigInt(a)),mr(d,o+56,117853008),Sl(d,o+64,BigInt(a)+BigInt(s)),mr(d,o+72,1),c=65535,a=4294967295,s=4294967295,o+=76),mr(d,o,101010256),Jr(d,o+8,c),Jr(d,o+10,c),mr(d,o+12,s),mr(d,o+16,a),await i.writeUint8Array(f),t&&t.length&&await i.writeUint8Array(t)}function _me(e,t,n){let i=new FileReader;return new Promise((r,o)=>{i.onload=s=>r(s.target.result),i.onerror=()=>o(i.error),i.readAsArrayBuffer(t||n?e.slice(t,n):e)})}async function Qnt(e,t,n=0){await r();async function r(){if(n<t.size){let o=await _me(t,n,n+536870912);await e.writeUint8Array(new Uint8Array(o)),n+=536870912,await r()}}}function Tj(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function Sa(e,t,n){return t[n]===void 0?e.options[n]:t[n]}function eit(e){return e+5*(Math.floor(e/16383)+1)}function lV(e,t,n){e.setUint8(t,n)}function Jr(e,t,n){e.setUint16(t,n,!0)}function mr(e,t,n){e.setUint32(t,n,!0)}function Sl(e,t,n){e.setBigUint64(t,n,!0)}function na(e,t,n){e.set(t,n)}function Hd(e){return new DataView(e.buffer)}P7({Deflate:Xde,Inflate:_he});var Sj=32,tit="http://www.opengis.net/kml/2.2",Wd="http://www.google.com/kml/ext/2.2",nit="http://www.w3.org/2000/xmlns/";function fV(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var iit=/^data:image\/([^,;]+)/;fV.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof De){if(e=De.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(iit);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let r=e.fetchBlob().then(function(o){t._files[n]=o});return this._promises.push(r),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(r=>{e.toBlob(function(o){t._files[n]=o,r()})});return this._promises.push(i),n}return""};function rit(e,t){return function(n){e._files[t]=n}}fV.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new fe("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},r=n(e,t,i);for(let o in i)if(i.hasOwnProperty(o)){let s=Promise.resolve(i[o]);this._promises.push(s),s.then(rit(this,o))}return r};Object.defineProperties(fV.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function dV(e){this._time=e}dV.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),y(i,t)};dV.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return Qx(n)};dV.prototype.getMaterialType=function(e){if(!!l(e))return e.getType(this._time)};function wj(){this._ids={},this._styles={},this._count=0}wj.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};wj.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function xme(){this._ids={}}xme.prototype.get=function(e){if(!l(e))return this.get(Ln());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function vj(e){e=y(e,y.EMPTY_OBJECT);let t=e.entities,n=y(e.kmz,!1),i=vj._createState(e),r=t.values.filter(function(u){return!l(u.parent)}),o=i.kmlDoc,s=o.documentElement;s.setAttributeNS(nit,"xmlns:gx",Wd);let a=o.createElement("Document");s.appendChild(a),Ame(i,a,r),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?oit(f,c.files):{kml:f,externalFiles:c.files}})}function oit(e,t){let n=Qt("ThirdParty/Workers/z-worker-pako.js");ec.configure({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new ec.BlobWriter,r=new ec.ZipWriter(i);return r.add("doc.kml",new ec.TextReader(e)).then(function(){let o=Object.keys(t);return Cme(r,o,t,0)}).then(function(){return r.close()}).then(function(o){return{kmz:o}})}function Cme(e,t,n,i){if(t.length===i)return;let r=t[i];return e.add(r,new ec.BlobReader(n[r])).then(function(){return Cme(e,t,n,i+1)})}vj._createState=function(e){let t=e.entities,n=new wj,i=t.computeAvailability(),r=l(e.time)?e.time:i.start,o=y(e.defaultAvailability,i),s=y(e.sampleDuration,60);o.start===ke.MINIMUM_VALUE?o.stop===ke.MAXIMUM_VALUE?o=new Cn:ee.addSeconds(o.stop,-10*s,o.start):o.stop===ke.MAXIMUM_VALUE&&ee.addSeconds(o.start,10*s,o.stop);let a=new fV(e.modelCallback);return{kmlDoc:document.implementation.createDocument(tit,"kml"),ellipsoid:y(e.ellipsoid,oe.WGS84),idManager:new xme,styleCache:n,externalFileHandler:a,time:r,valueGetter:new dV(r),sampleDuration:s,defaultAvailability:new $o([o])}};function Ame(e,t,n){let i=e.kmlDoc,r=e.styleCache,o=e.valueGetter,s=e.idManager,a=n.length,c,u,f;for(let d=0;d<a;++d){let p=n[d];c=[],u=[],f=[],sit(e,p,u,f),ait(e,p.polyline,u,f),yme(e,p.rectangle,u,f,c),yme(e,p.polygon,u,f,c),fit(e,p,p.model,u,f);let g,m=p.availability;l(m)&&(g=i.createElement("TimeSpan"),ee.equals(m.start,ke.MINIMUM_VALUE)||g.appendChild(ln(i,"begin",ee.toIso8601(m.start))),ee.equals(m.stop,ke.MAXIMUM_VALUE)||g.appendChild(ln(i,"end",ee.toIso8601(m.stop))));for(let A=0;A<c.length;++A){let b=c[A];b.setAttribute("id",s.get(p.id)),b.appendChild(ln(i,"name",p.name)),b.appendChild(ln(i,"visibility",p.show)),b.appendChild(ln(i,"description",p.description)),l(g)&&b.appendChild(g),t.appendChild(b)}let x=u.length;if(x>0){let A=i.createElement("Placemark");A.setAttribute("id",s.get(p.id));let b=p.name,T=p.label;if(l(T)){let w=i.createElement("LabelStyle"),D=o.get(T.text);b=l(D)&&D.length>0?D:b;let I=o.getColor(T.fillColor);l(I)&&(w.appendChild(ln(i,"color",I)),w.appendChild(ln(i,"colorMode","normal")));let O=o.get(T.scale);l(O)&&w.appendChild(ln(i,"scale",O)),f.push(w)}A.appendChild(ln(i,"name",b)),A.appendChild(ln(i,"visibility",p.show)),A.appendChild(ln(i,"description",p.description)),l(g)&&A.appendChild(g),t.appendChild(A);let S=f.length;if(S>0){let w=i.createElement("Style");for(let D=0;D<S;++D)w.appendChild(f[D]);A.appendChild(ln(i,"styleUrl",r.get(w)))}if(u.length===1)A.appendChild(u[0]);else if(u.length>1){let w=i.createElement("MultiGeometry");for(let D=0;D<x;++D)w.appendChild(u[D]);A.appendChild(w)}}let C=p._children;if(C.length>0){let A=i.createElement("Folder");A.setAttribute("id",s.get(p.id)),A.appendChild(ln(i,"name",p.name)),A.appendChild(ln(i,"visibility",p.show)),A.appendChild(ln(i,"description",p.description)),t.appendChild(A),Ame(e,A,C)}}}var wl=new h,kc=new me,Gd=new ee;function sit(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter,a=y(t.billboard,t.point);if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){Tme(e,t,a,n,i);return}s.get(c,void 0,wl);let u=ln(r,"coordinates",Jx(wl,o)),f=r.createElement("Point"),d=r.createElement("altitudeMode");d.appendChild(eC(e,a.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=a instanceof Ec?Eme(e,a):bme(e,a);i.push(p)}function Tme(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof Ta?(c=u.intervals,f=!1):c=y(t.availability,e.defaultAvailability);let d=n instanceof mg,p,g,m,x=[];for(p=0;p<c.length;++p){let A=c.get(p),b=f?u:A.data,T=o.createElement("altitudeMode");b instanceof Qp?(b=b._value,T.appendChild(eC(e,ze.CLAMP_TO_GROUND))):l(n)?T.appendChild(eC(e,n.heightReference)):T.appendChild(eC(e,ze.NONE));let S=[],w=[];if(b.isConstant){a.get(b,void 0,wl);let I=ln(o,"coordinates",Jx(wl,s));S.push(ee.toIso8601(A.start)),w.push(I),S.push(ee.toIso8601(A.stop)),w.push(I)}else if(b instanceof ba)for(m=b._property._times,g=0;g<m.length;++g)S.push(ee.toIso8601(m[g])),b.getValueInReferenceFrame(m[g],sr.FIXED,wl),w.push(Jx(wl,s));else if(b instanceof Ef){m=b._times;let I=b._values;for(g=0;g<m.length;++g)S.push(ee.toIso8601(m[g])),h.fromArray(I,g*3,wl),w.push(Jx(wl,s))}else{let I=e.sampleDuration;A.start.clone(Gd),A.isStartIncluded||ee.addSeconds(Gd,I,Gd);let O=A.stop;for(;ee.lessThan(Gd,O);)b.getValue(Gd,wl),S.push(ee.toIso8601(Gd)),w.push(Jx(wl,s)),ee.addSeconds(Gd,I,Gd);A.isStopIncluded&&ee.equals(Gd,O)&&(b.getValue(Gd,wl),S.push(ee.toIso8601(Gd)),w.push(Jx(wl,s)))}let D=o.createElementNS(Wd,"Track");D.appendChild(T);for(let I=0;I<S.length;++I){let O=ln(o,"when",S[I]),B=ln(o,"coord",w[I],Wd);D.appendChild(O),D.appendChild(B)}d&&D.appendChild(Sme(e,n)),x.push(D)}if(x.length===1)i.push(x[0]);else if(x.length>1){let A=o.createElementNS(Wd,"MultiTrack");for(p=0;p<x.length;++p)A.appendChild(x[p]);i.push(A)}if(l(n)&&!d){let A=n instanceof Ec?Eme(e,n):bme(e,n);r.push(A)}let C=t.path;if(l(C)){let A=a.get(C.width),b=C.material;if(l(b)||l(A)){let T=o.createElement("LineStyle");l(A)&&T.appendChild(ln(o,"width",A)),Dj(e,b,T),r.push(T)}}}function bme(e,t){let n=e.kmlDoc,i=e.valueGetter,r=n.createElement("IconStyle"),o=i.getColor(t.color);l(o)&&(r.appendChild(ln(n,"color",o)),r.appendChild(ln(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&r.appendChild(ln(n,"scale",s/Sj)),r}function Eme(e,t){let n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("IconStyle"),s=i.get(t.image);if(l(s)){s=r.texture(s);let p=n.createElement("Icon");p.appendChild(ln(n,"href",s));let g=i.get(t.imageSubRegion);l(g)&&(p.appendChild(ln(n,"x",g.x,Wd)),p.appendChild(ln(n,"y",g.y,Wd)),p.appendChild(ln(n,"w",g.width,Wd)),p.appendChild(ln(n,"h",g.height,Wd))),o.appendChild(p)}let a=i.getColor(t.color);l(a)&&(o.appendChild(ln(n,"color",a)),o.appendChild(ln(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&o.appendChild(ln(n,"scale",c));let u=i.get(t.pixelOffset);if(l(u)){c=y(c,1),W.divideByScalar(u,c,u);let p=i.get(t.width,Sj),g=i.get(t.height,Sj),m=i.get(t.horizontalOrigin,gi.CENTER);m===gi.CENTER?u.x-=p*.5:m===gi.RIGHT&&(u.x-=p);let x=i.get(t.verticalOrigin,vn.CENTER);x===vn.TOP?u.y+=g:x===vn.CENTER&&(u.y+=g*.5);let C=n.createElement("hotSpot");C.setAttribute("x",-u.x),C.setAttribute("y",u.y),C.setAttribute("xunits","pixels"),C.setAttribute("yunits","pixels"),o.appendChild(C)}let f=i.get(t.rotation),d=i.get(t.alignedAxis);return l(f)&&h.equals(h.UNIT_Z,d)&&(f=M.toDegrees(-f),f===0&&(f=360),o.appendChild(ln(n,"heading",f))),o}function ait(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=r.createElement("LineString"),c=r.createElement("altitudeMode"),u=s.get(t.clampToGround,!1),f;u?(a.appendChild(ln(r,"tessellate",!0)),f=r.createTextNode("clampToGround")):f=r.createTextNode("absolute"),c.appendChild(f),a.appendChild(c);let d=t.positions,p=s.get(d),g=ln(r,"coordinates",Jx(p,o));a.appendChild(g);let m=s.get(t.zIndex);u&&l(m)&&a.appendChild(ln(r,"drawOrder",m,Wd)),n.push(a);let x=r.createElement("LineStyle"),C=s.get(t.width);l(C)&&x.appendChild(ln(r,"width",C)),Dj(e,t.material,x),i.push(x)}function cit(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=r.get(t.height,0);n>0&&(o=n);let s=t.coordinates,a=r.get(s),c=[],u=[he.northeast,he.southeast,he.southwest,he.northwest];for(let g=0;g<4;++g)u[g](a,kc),c.push(`${M.toDegrees(kc.longitude)},${M.toDegrees(kc.latitude)},${o}`);let f=ln(i,"coordinates",c.join(" ")),d=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),d.appendChild(p),[d]}function gme(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=[],a=t.length;for(let f=0;f<a;++f)me.fromCartesian(t[f],o,kc),s.push(`${M.toDegrees(kc.longitude)},${M.toDegrees(kc.latitude)},${i?kc.height:n}`);let c=ln(r,"coordinates",s.join(" ")),u=r.createElement("LinearRing");return u.appendChild(c),u}function lit(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=r.get(t.height,0),s=r.get(t.perPositionHeight,!1);!s&&n>0&&(o=n);let a=[],c=t.hierarchy,u=r.get(c),f=Array.isArray(u)?u:u.positions,d=i.createElement("outerBoundaryIs");d.appendChild(gme(e,f,o,s)),a.push(d);let p=u.holes;if(l(p)){let g=p.length;for(let m=0;m<g;++m){let x=i.createElement("innerBoundaryIs");x.appendChild(gme(e,p[m].positions,o,s)),a.push(x)}}return a}function yme(e,t,n,i,r){let o=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof Wh;if(a&&s.getMaterialType(t.material)==="Image"){uit(e,t,r);return}let c=o.createElement("Polygon"),u=s.get(t.extrudedHeight,0);u>0&&c.appendChild(ln(o,"extrude",!0));let f=a?cit(e,t,u):lit(e,t,u),d=f.length;for(let C=0;C<d;++C)c.appendChild(f[C]);let p=o.createElement("altitudeMode");p.appendChild(eC(e,t.heightReference)),c.appendChild(p),n.push(c);let g=o.createElement("PolyStyle"),m=s.get(t.fill,!1);m&&g.appendChild(ln(o,"fill",m)),Dj(e,t.material,g);let x=s.get(t.outline,!1);if(x){g.appendChild(ln(o,"outline",x));let C=o.createElement("LineStyle"),A=s.get(t.outlineWidth,1);C.appendChild(ln(o,"width",A));let b=s.getColor(t.outlineColor,z.BLACK);C.appendChild(ln(o,"color",b)),C.appendChild(ln(o,"colorMode","normal")),i.push(C)}i.push(g)}function uit(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(eC(e,t.heightReference)),s.appendChild(a);let c=r.get(t.height);l(c)&&s.appendChild(ln(i,"altitude",c));let u=r.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(ln(i,"north",M.toDegrees(u.north))),f.appendChild(ln(i,"south",M.toDegrees(u.south))),f.appendChild(ln(i,"east",M.toDegrees(u.east))),f.appendChild(ln(i,"west",M.toDegrees(u.west))),s.appendChild(f);let d=r.get(t.material),p=o.texture(d.image),g=i.createElement("Icon");g.appendChild(ln(i,"href",p)),s.appendChild(g);let m=d.color;l(m)&&s.appendChild(ln(i,"color",Qx(d.color))),n.push(s)}function Sme(e,t){let n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let u=n.createElement("scale");u.appendChild(ln(n,"x",s)),u.appendChild(ln(n,"y",s)),u.appendChild(ln(n,"z",s)),o.appendChild(u)}let a=n.createElement("Link"),c=r.model(t,e.time);return a.appendChild(ln(n,"href",c)),o.appendChild(a),o}function fit(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){Tme(e,t,n,i,r);return}let u=Sme(e,n),f=o.createElement("altitudeMode");f.appendChild(eC(e,n.heightReference)),u.appendChild(f),a.get(c,void 0,wl),me.fromCartesian(wl,s,kc);let d=o.createElement("Location");d.appendChild(ln(o,"longitude",M.toDegrees(kc.longitude))),d.appendChild(ln(o,"latitude",M.toDegrees(kc.latitude))),d.appendChild(ln(o,"altitude",kc.height)),u.appendChild(d),i.push(u)}function Dj(e,t,n){let i=e.kmlDoc,r=e.valueGetter;if(!l(t))return;let o=r.get(t);if(!l(o))return;let s,a=r.getMaterialType(t),c,u;switch(a){case"Image":s=Qx(z.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=Qx(o.color);break;case"PolylineOutline":s=Qx(o.color),c=Qx(o.outlineColor),u=o.outlineWidth,n.appendChild(ln(i,"outerColor",c,Wd)),n.appendChild(ln(i,"outerWidth",u,Wd));break;case"Stripe":s=Qx(o.oddColor);break}l(s)&&(n.appendChild(ln(i,"color",s)),n.appendChild(ln(i,"colorMode","normal")))}function eC(e,t){let n=e.kmlDoc,r=e.valueGetter.get(t,ze.NONE),o;switch(r){case ze.NONE:o=n.createTextNode("absolute");break;case ze.CLAMP_TO_GROUND:o=n.createTextNode("clampToGround");break;case ze.RELATIVE_TO_GROUND:o=n.createTextNode("relativeToGround");break}return o}function Jx(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let r=0;r<n;++r)me.fromCartesian(e[r],t,kc),i.push(`${M.toDegrees(kc.longitude)},${M.toDegrees(kc.latitude)},${kc.height}`);return i.join(" ")}function ln(e,t,n,i){n=y(n,""),typeof n=="boolean"&&(n=n?"1":"0");let r=l(i)?e.createElementNS(i,t):e.createElement(t),o=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return r.appendChild(o),r}function Qx(e){let t="",n=e.toBytes();for(let i=3;i>=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var wme=vj;var mV=Ns(Dme(),1);function pV(e){return h.fromDegrees(e[0],e[1],e[2])}var Pj={"urn:ogc:def:crs:OGC:1.3:CRS84":pV,"EPSG:4326":pV,"urn:ogc:def:crs:EPSG::4326":pV},Pme={},Ime={},Ij=48,Oj,Rj=z.ROYALBLUE,Mj=z.YELLOW,Bj=2,Lj=z.fromBytes(255,255,0,100),Nj=!1,dit={small:24,medium:48,large:64},hit=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function Ome(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||hit.indexOf(i)!==-1)continue;let r=e[i];l(r)&&(typeof r=="object"?n+=`<tr><th>${i}</th><td>${Ome(r)}</td></tr>`:n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function mit(e,t,n){let i;return function(r,o){return l(i)||(i=e(t,n)),i}}function pit(e,t){return new qh(mit(Ome,e,t),!0)}function _V(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Ln();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let r=t.getOrCreateEntity(i),o=e.properties;if(l(o)){r.properties=o;let s,a=o.title;if(l(a))r.name=a,s="title";else{let u=Number.MAX_VALUE;for(let f in o)if(o.hasOwnProperty(f)&&o[f]){let d=f.toLowerCase();if(u>1&&d==="title"){u=1,s=f;break}else u>2&&d==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}l(s)&&(r.name=o[s])}let c=o.description;c!==null&&(r.description=l(c)?new Jn(c):n(o,s))}return r}function Fj(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var Rme={Feature:Bme,FeatureCollection:_it,GeometryCollection:Lme,LineString:Ume,MultiLineString:zme,MultiPoint:Vme,MultiPolygon:Wme,Point:Fme,Polygon:Gme,Topology:jme},Mme={GeometryCollection:Lme,LineString:Ume,MultiLineString:zme,MultiPoint:Vme,MultiPolygon:Wme,Point:Fme,Polygon:Gme,Topology:jme};function Bme(e,t,n,i,r){if(t.geometry===null){_V(t,e._entityCollection,r.describe);return}if(!l(t.geometry))throw new fe("feature.geometry is required.");let o=t.geometry.type,s=Mme[o];if(!l(s))throw new fe(`Unknown geometry type: ${o}`);s(e,t,t.geometry,i,r)}function _it(e,t,n,i,r){let o=t.features;for(let s=0,a=o.length;s<a;s++)Bme(e,o[s],void 0,i,r)}function Lme(e,t,n,i,r){let o=n.geometries;for(let s=0,a=o.length;s<a;s++){let c=o[s],u=c.type,f=Mme[u];if(!l(f))throw new fe(`Unknown geometry type: ${u}`);f(e,t,c,i,r)}}function Nme(e,t,n,i,r){let o=r.markerSymbol,s=r.markerColor,a=r.markerSize,c=t.properties;if(l(c)){let g=c["marker-color"];l(g)&&(s=z.fromCssColorString(g)),a=y(dit[c["marker-size"]],a);let m=c["marker-symbol"];l(m)&&(o=m)}let u;l(o)?o.length===1?u=e._pinBuilder.fromText(o.toUpperCase(),s,a):u=e._pinBuilder.fromMakiIconId(o,s,a):u=e._pinBuilder.fromColor(s,a);let f=new Ec;f.verticalOrigin=new Jn(vn.BOTTOM),i.length===2&&r.clampToGround&&(f.heightReference=ze.CLAMP_TO_GROUND);let d=_V(t,e._entityCollection,r.describe);d.billboard=f,d.position=new hl(n(i));let p=Promise.resolve(u).then(function(g){f.image=new Jn(g)}).catch(function(){f.image=new Jn(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function Fme(e,t,n,i,r){Nme(e,t,i,n.coordinates,r)}function Vme(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)Nme(e,t,i,o[s],r)}function kme(e,t,n,i,r){let o=r.strokeMaterialProperty,s=r.strokeWidthProperty,a=t.properties;if(l(a)){let f=a["stroke-width"];l(f)&&(s=new Jn(f));let d,p=a.stroke;l(p)&&(d=z.fromCssColorString(p));let g=a["stroke-opacity"];l(g)&&g!==1&&(l(d)||(d=o.color.getValue().clone()),d.alpha=g),l(d)&&(o=new Dt(d))}let c=_V(t,e._entityCollection,r.describe),u=new vc;c.polyline=u,u.clampToGround=r.clampToGround,u.material=o,u.width=s,u.positions=new Jn(Fj(i,n)),u.arcType=Kt.RHUMB}function Ume(e,t,n,i,r){kme(e,t,i,n.coordinates,r)}function zme(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)kme(e,t,i,o[s],r)}function Hme(e,t,n,i,r){if(i.length===0||i[0].length===0)return;let o=r.strokeMaterialProperty.color,s=r.fillMaterialProperty,a=r.strokeWidthProperty,c=t.properties;if(l(c)){let g=c["stroke-width"];l(g)&&(a=new Jn(g));let m,x=c.stroke;l(x)&&(m=z.fromCssColorString(x));let C=c["stroke-opacity"];l(C)&&C!==1&&(l(m)||(m=o.getValue().clone()),m.alpha=C),l(m)&&(o=new Jn(m));let A,b=c.fill,T=s.color.getValue();l(b)&&(A=z.fromCssColorString(b),A.alpha=T.alpha),C=c["fill-opacity"],l(C)&&C!==T.alpha&&(l(A)||(A=T.clone()),A.alpha=C),l(A)&&(s=new Dt(A))}let u=new Gh;u.outline=new Jn(!0),u.outlineColor=o,u.outlineWidth=a,u.material=s,u.arcType=Kt.RHUMB;let f=[];for(let g=1,m=i.length;g<m;g++)f.push(new ul(Fj(i[g],n)));let d=i[0];u.hierarchy=new Jn(new ul(Fj(d,n),f)),d[0].length>2?u.perPositionHeight=new Jn(!0):r.clampToGround||(u.height=0);let p=_V(t,e._entityCollection,r.describe);p.polygon=u}function Gme(e,t,n,i,r){Hme(e,t,i,n.coordinates,r)}function Wme(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)Hme(e,t,i,o[s],r)}function jme(e,t,n,i,r){for(let o in n.objects)if(n.objects.hasOwnProperty(o)){let s=mV.feature(n,n.objects[o]),a=Rme[s.type];a(e,s,s,i,r)}}function C0(e){this._name=e,this._changed=new ge,this._error=new ge,this._isLoading=!1,this._loading=new ge,this._entityCollection=new Zs(this),this._promises=[],this._pinBuilder=new X_,this._entityCluster=new bf,this._credit=void 0,this._resourceCredits=[]}C0.load=function(e,t){return new C0().load(e,t)};Object.defineProperties(C0,{markerSize:{get:function(){return Ij},set:function(e){Ij=e}},markerSymbol:{get:function(){return Oj},set:function(e){Oj=e}},markerColor:{get:function(){return Rj},set:function(e){Rj=e}},stroke:{get:function(){return Mj},set:function(e){Mj=e}},strokeWidth:{get:function(){return Bj},set:function(e){Bj=e}},fill:{get:function(){return Lj},set:function(e){Lj=e}},clampToGround:{get:function(){return Nj},set:function(e){Nj=e}},crsNames:{get:function(){return Pj}},crsLinkHrefs:{get:function(){return Pme}},crsLinkTypes:{get:function(){return Ime}}});Object.defineProperties(C0.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});C0.prototype.load=function(e,t){return qme(this,e,t,!0)};C0.prototype.process=function(e,t){return qme(this,e,t,!1)};function qme(e,t,n,i){Jo.setLoading(e,!0),n=y(n,y.EMPTY_OBJECT);let r=n.credit;typeof r=="string"&&(r=new Gt(r)),e._credit=r;let o=t,s=n.sourceUri;if(typeof t=="string"||t instanceof De){t=De.createIfNeeded(t),o=t.fetchJson(),s=y(s,t.getUrlComponent());let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return n={describe:y(n.describe,pit),markerSize:y(n.markerSize,Ij),markerSymbol:y(n.markerSymbol,Oj),markerColor:y(n.markerColor,Rj),strokeWidthProperty:new Jn(y(n.strokeWidth,Bj)),strokeMaterialProperty:new Dt(y(n.stroke,Mj)),fillMaterialProperty:new Dt(y(n.fill,Lj)),clampToGround:y(n.clampToGround,Nj)},Promise.resolve(o).then(function(a){return git(e,a,n,s,i)}).catch(function(a){throw Jo.setLoading(e,!1),e._error.raiseEvent(e,a),a})}C0.prototype.update=function(e){return!0};function git(e,t,n,i,r){let o;l(i)&&(o=W_(i)),l(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));let s=Rme[t.type];if(!l(s))throw new fe(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?pV:null;if(l(a)){if(!l(a.properties))throw new fe("crs.properties is undefined.");let u=a.properties;if(a.type==="name"){if(c=Pj[u.name],!l(c))throw new fe(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=Pme[u.href];if(l(f)||(f=Ime[u.type]),!l(f))throw new fe(`Unable to resolve crs link: ${JSON.stringify(u)}`);c=f(u)}else if(a.type==="EPSG"){if(c=Pj[`EPSG:${u.code}`],!l(c))throw new fe(`Unknown crs EPSG code: ${u.code}`)}else throw new fe(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(u){return r&&e._entityCollection.removeAll(),u!==null&&s(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Jo.setLoading(e,!1),e})})}var gV=C0;var nC=Ns(Ope(),1);var Upe;typeof DOMParser<"u"&&(Upe=new DOMParser);var $rt=new nC.default({stripPrefix:!1,email:!1,replaceFn:function(e,t){if(!t.protocolUrlMatch)return!1}}),XV=32,Rpe=2414016,Mpe=1,Bpe=16093e3,Lpe=.1,Zrt=[null,void 0,"http://www.topografix.com/GPX/1/1"],Dr={gpx:Zrt};function Jrt(e){return new Promise((t,n)=>{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function Xj(e,t){let n=qD(e,"id");return n=l(n)?n:Ln(),t.getOrCreateEntity(n)}function Kj(e){let t=Npe(e,"lon"),n=Npe(e,"lat"),i=WD(e,"ele",Dr.gpx);return h.fromDegrees(t,n,i)}function Npe(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function qD(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function w0(e,t,n){if(!l(e))return;let i=e.childNodes,r=i.length;for(let o=0;o<r;o++){let s=i[o];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function $j(e,t,n){if(!l(e))return;let i=[],r=e.getElementsByTagName(t),o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function WD(e,t,n){let i=w0(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function Dl(e,t,n){let i=w0(e,t,n);if(l(i))return i.textContent.trim()}function zpe(e){let t=new Ec;return t.width=XV,t.height=XV,t.scaleByDistance=new St(Rpe,Mpe,Bpe,Lpe),t.pixelOffsetScaleByDistance=new St(Rpe,Mpe,Bpe,Lpe),t.verticalOrigin=new Jn(vn.BOTTOM),t.image=e,t}function Qrt(){let e=new Hh;return e.translucencyByDistance=new St(3e6,1,5e6,0),e.pixelOffset=new W(17,0),e.horizontalOrigin=gi.LEFT,e.font="16px sans-serif",e.style=$r.FILL_AND_OUTLINE,e}function Hpe(e){let t=new vc;return t.width=4,t.material=new Gx,t.material.color=l(e)?e:z.RED,t.material.outlineWidth=2,t.material.outlineColor=z.BLACK,t}var Fpe={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}},jD;typeof document<"u"&&(jD=document.createElement("div"));function Zj(e,t){let n,i="",r=Object.keys(Fpe),o=r.length;for(n=0;n<o;n++){let f=r[n],d=Fpe[f];d.value=y(Dl(e,d.tag,Dr.gpx),""),l(d.value)&&d.value!==""&&(i=`${i}<p>${d.text}: ${d.value}</p>`)}if(!l(i)||i==="")return;i=$rt.link(i),jD.innerHTML=i;let s=jD.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=z.WHITE,c=z.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${a.toCssColorString()};`,u+=`color:${c.toCssColorString()};`,u+='">',u+=`${jD.innerHTML}</div>`,jD.innerHTML="",u}function Gpe(e,t,n,i){let r=Kj(t),o=Xj(t,n);o.position=r;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,XV);o.billboard=zpe(s);let a=Dl(t,"name",Dr.gpx);o.name=a,o.label=Qrt(),o.label.text=a,o.description=Zj(t,o),i.clampToGround&&(o.billboard.heightReference=ze.CLAMP_TO_GROUND,o.label.heightReference=ze.CLAMP_TO_GROUND)}function eot(e,t,n,i){let r=Xj(t,n);r.description=Zj(t,r);let o=$j(t,"rtept",Dr.gpx),s=new Array(o.length);for(let a=0;a<o.length;a++)Gpe(e,o[a],n,i),s[a]=Kj(o[a]);r.polyline=Hpe(i.routeColor),i.clampToGround&&(r.polyline.clampToGround=!0),r.polyline.positions=s}function tot(e,t,n,i){let r=Xj(t,n);r.description=Zj(t,r);let o=$j(t,"trkseg",Dr.gpx),s=[],a=[],c,u=!0,f=new ba;for(let d=0;d<o.length;d++)c=not(o[d]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let d=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,XV);r.billboard=zpe(d),r.position=f,i.clampToGround&&(r.billboard.heightReference=ze.CLAMP_TO_GROUND),r.availability=new $o,r.availability.addInterval(new Cn({start:a[0],stop:a[a.length-1]}))}r.polyline=Hpe(i.trackColor),r.polyline.positions=s,i.clampToGround&&(r.polyline.clampToGround=!0)}function not(e){let t={positions:[],times:[]},n=$j(e,"trkpt",Dr.gpx),i;for(let r=0;r<n.length;r++){let o=Kj(n[r]);t.positions.push(o),i=Dl(n[r],"time",Dr.gpx),l(i)&&t.times.push(ee.fromIso8601(i))}return t}function iot(e){let t=w0(e,"metadata",Dr.gpx);if(l(t)){let n={name:Dl(t,"name",Dr.gpx),desc:Dl(t,"desc",Dr.gpx),author:rot(t),copyright:sot(t),link:Wpe(t),time:Dl(t,"time",Dr.gpx),keywords:Dl(t,"keywords",Dr.gpx),bounds:aot(t)};if(l(n.name)||l(n.desc)||l(n.author)||l(n.copyright)||l(n.link)||l(n.time)||l(n.keywords)||l(n.bounds))return n}}function rot(e){let t=w0(e,"author",Dr.gpx);if(l(t)){let n={name:Dl(t,"name",Dr.gpx),email:oot(t),link:Wpe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function oot(e){let t=w0(e,"email",Dr.gpx);if(l(t)){let n=Dl(t,"id",Dr.gpx),i=Dl(t,"domain",Dr.gpx);return`${n}@${i}`}}function Wpe(e){let t=w0(e,"link",Dr.gpx);if(l(t)){let n={href:qD(t,"href"),text:Dl(t,"text",Dr.gpx),mimeType:Dl(t,"type",Dr.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function sot(e){let t=w0(e,"copyright",Dr.gpx);if(l(t)){let n={author:qD(t,"author"),year:Dl(t,"year",Dr.gpx),license:Dl(t,"license",Dr.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function aot(e){let t=w0(e,"bounds",Dr.gpx);if(l(t)){let n={minLat:WD(t,"minlat",Dr.gpx),maxLat:WD(t,"maxlat",Dr.gpx),minLon:WD(t,"minlon",Dr.gpx),maxLon:WD(t,"maxlon",Dr.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var Vpe={wpt:Gpe,rte:eot,trk:tot};function cot(e,t,n,i){let r=Object.keys(Vpe),o=r.length;for(let s=0;s<o;s++){let a=r[s],c=Vpe[a],u=t.childNodes,f=u.length;for(let d=0;d<f;d++){let p=u[d];p.localName===a&&Dr.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function kpe(e,t,n){let i=e._entityCollection;i.removeAll();let r=t.documentElement,o=qD(r,"version"),s=qD(r,"creator"),a,c=iot(r);l(c)&&(a=c.name),r.localName==="gpx"?cot(e,r,i,n):console.log(`GPX - Unsupported node: ${r.localName}`);let u,f=i.computeAvailability(),d=f.start,p=f.stop,g=ee.equals(d,ke.MINIMUM_VALUE),m=ee.equals(p,ke.MAXIMUM_VALUE);if(!g||!m){let C;g&&(C=new Date,C.setHours(0,0,0,0),d=ee.fromDate(C)),m&&(C=new Date,C.setHours(24,0,0,0),p=ee.fromDate(C)),u=new fm,u.startTime=d,u.stopTime=p,u.currentTime=ee.clone(d),u.clockRange=jo.LOOP_STOP,u.clockStep=xr.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(ee.secondsDifference(p,d)/60,1),31556900))}let x=!1;return e._name!==a&&(e._name=a,x=!0),e._creator!==s&&(e._creator=s,x=!0),lot(e._metadata,c)&&(e._metadata=c,x=!0),e._version!==o&&(e._version=o,x=!0),u!==e._clock&&(x=!0,e._clock=u),x&&e._changed.raiseEvent(e),Jo.setLoading(e,!1),e}function lot(e,t){return!l(e)&&!l(t)?!1:l(e)&&l(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function uot(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let r=n;if(typeof n=="string"||n instanceof De){n=De.createIfNeeded(n),r=n.fetchBlob();let o=e._resourceCredits,s=n.credits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)o.push(s[c])}}return Promise.resolve(r).then(function(o){return o instanceof Blob?Jrt(o).then(function(s){let a,c;try{a=Upe.parseFromString(s,"application/xml")}catch(u){c=u.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let u=l(c)?c:a.documentElement.firstChild.nodeValue;throw u||(u=a.body.innerText),new fe(u)}return kpe(e,a,i)}):kpe(e,o,i)}).catch(function(o){return e._error.raiseEvent(e,o),console.log(o),Promise.reject(o)})}function mE(){this._changed=new ge,this._error=new ge,this._loading=new ge,this._clock=void 0,this._entityCollection=new Zs,this._entityCluster=new bf,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new X_}mE.load=function(e,t){return new mE().load(e,t)};Object.defineProperties(mE.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});mE.prototype.update=function(e){return!0};mE.prototype.load=function(e,t){if(!l(e))throw new ye("data is required.");t=y(t,y.EMPTY_OBJECT),Jo.setLoading(this,!0);let n=this._name,i=this;return uot(this,this._entityCollection,e,t).then(function(){let r,o=i._entityCollection.computeAvailability(),s=o.start,a=o.stop,c=ee.equals(s,ke.MINIMUM_VALUE),u=ee.equals(a,ke.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=ee.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),a=ee.fromDate(d)),r=new fm,r.startTime=s,r.stopTime=a,r.currentTime=ee.clone(s),r.clockRange=jo.LOOP_STOP,r.clockStep=xr.SYSTEM_CLOCK_MULTIPLIER,r.multiplier=Math.round(Math.min(Math.max(ee.secondsDifference(a,s)/60,1),31556900))}let f=!1;return r!==i._clock&&(i._clock=r,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Jo.setLoading(i,!1),i}).catch(function(r){return Jo.setLoading(i,!1),i._error.raiseEvent(i,r),console.log(r),Promise.reject(r)})};var KV=mE;function fot(e,t){this.position=e,this.headingPitchRoll=t}var $V=fot;function dot(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Pn=dot;function hot(e,t){this.position=e,this.headingPitchRange=t}var ZV=hot;function JV(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new ge,this.tourEnd=new ge,this.entryStart=new ge,this.entryEnd=new ge,this._activeEntries=[]}JV.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};JV.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;qpe.call(this,e,t,function(i){n.playlistIndex=0,i||jpe(n._activeEntries),n.tourEnd.raiseEvent(i)})};JV.prototype.stop=function(){jpe(this._activeEntries)};function jpe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function qpe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let r=mot.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(r,e.scene.camera,t);else{let o=this;i.play(function(){o.entryEnd.raiseEvent(i);let s=o._activeEntries.indexOf(i);s>=0&&o._activeEntries.splice(s,1)}),r(e,t,n)}}else l(n)&&n(!1)}function mot(e,t,n,i){let r=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(r,i),i)n(i);else{let o=this._activeEntries.indexOf(r);o>=0&&this._activeEntries.splice(o,1),this.playlistIndex++,qpe.call(this,e,t,n)}}var QV=JV;function ek(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}ek.prototype.play=function(e,t,n){if(this.activeCamera=t,l(e)&&e!==null){let r=this;this.activeCallback=function(o){delete r.activeCallback,delete r.activeCamera,e(l(o)?!1:o)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let r=new re(this.view.position);t.flyToBoundingSphere(r,i)}};ek.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};ek.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=qo.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),l(e)&&(t=rt(t,e)),t};var tk=ek;function Jj(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}Jj.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};Jj.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var nk=Jj;var n_e={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){let t=e.toLowerCase();return t=jC(t),n_e[t]}},oq;typeof DOMParser<"u"&&(oq=new DOMParser);var pot=new nC.default({stripPrefix:!1,email:!1,replaceFn:function(e){if(!e.protocolUrlMatch)return!1}}),v0=32,Ype=2414016,Xpe=1,Kpe=16093e3,$pe=.1,Zpe=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],Jpe=["http://www.google.com/kml/ext/2.2"],_ot=["http://www.w3.org/2005/Atom"],Ie={kml:Zpe,gx:Jpe,atom:_ot,kmlgx:Zpe.concat(Jpe)},sq={Document:d_e,Folder:Lot,Placemark:Not,NetworkLink:jot,GroundOverlay:Hot,PhotoOverlay:p_e,ScreenOverlay:zot,Tour:Vot};function Am(e){this._dataSource=e,this._deferred=ts(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(Am.prototype,{dataSource:{get:function(){return this._dataSource}}});Am.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};Am.prototype.addPromise=function(e){this._promises.push(e)};Am.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};Am.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=Tu._getTimestamp()),this._process(e)};Am.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=Tu._getTimestamp(),e._process(!0)},0)};Am.prototype._nextNode=function(){let e=this._stack,t=e[e.length-1],n=t.index,i=t.nodes;if(n!==i.length)return++t.index,i[n]};Am.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};Am.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;l(i);){let r=sq[i.localName];if(l(r)&&(Ie.kml.indexOf(i.namespaceURI)!==-1||Ie.gx.indexOf(i.namespaceURI)!==-1)&&(r(t,i,n,this),this._timeoutSet||Tu._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function got(e){let t=e.slice(0,Math.min(4,e.size)),n=ts(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function yot(e){let t=ts(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function i_e(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,r,o;for(let s in t)t.hasOwnProperty(s)&&(r=RegExp(`[< ]${s}:`),o=`xmlns:${s}=`,r.test(e)&&e.indexOf(o)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${o}"${t[s]}"`));return l(n)&&(e=n+i),e}function r_e(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,r,o;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),r=t,t=e.indexOf(i,t+1),t!==-1?(o=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(o+1,e.length),t=e.indexOf("xmlns:",r-1)):t=e.indexOf("xmlns:",r+1);return e}function xot(e,t){return Promise.resolve(e.getData(new ec.TextWriter)).then(function(n){n=i_e(n),n=r_e(n),t.kml=oq.parseFromString(n,"application/xml")})}function Qj(e,t){let n=y(n_e.detectFromFilename(e.filename),"application/octet-stream");return Promise.resolve(e.getData(new ec.Data64URIWriter(n))).then(function(i){t[e.filename]=i})}function Cu(e,t,n,i){let r=i.keys,o=new oi.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],u=c.getAttribute(n),d=new oi.default(u).absoluteTo(o).toString(),p=r.indexOf(d);if(p!==-1){let g=r[p];c.setAttribute(n,i[g]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",g)}}}function Au(e,t,n,i){let r=e.querySelectorAll(t);for(let o=0;o<r.length;o++){let s=r[o],a=s.getAttribute(n),c=aq(a,i);s.setAttribute(n,c.url)}}function o_e(e,t,n){let i=Cs(e,"id");i=l(i)&&i.length!==0?i:Ln(),l(n)&&(i=n+i);let r=t.getById(i);return l(r)&&(i=Ln(),l(n)&&(i=n+i)),r=t.add(new uo({id:i})),l(r.kml)||(r.addProperty("kml"),r.kml=new Kot),r}function YD(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function sk(e,t){if(!l(e))return h.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return h.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),r=parseFloat(n[1]),o=parseFloat(n[2]);return i=isNaN(i)?0:i,r=isNaN(r)?0:r,o=isNaN(o)?0:o,h.fromDegrees(i,r,o,t)}function ik(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,r=new Array(i),o=0;for(let s=0;s<i;s++)r[o++]=sk(n[s],t);return r}function D0(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function Cs(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function vi(e,t,n){if(!l(e))return;let i=e.childNodes,r=i.length;for(let o=0;o<r;o++){let s=i[o];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function Qpe(e,t,n){if(!l(e))return;let i=[],r=e.getElementsByTagNameNS("*",t),o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function qd(e,t,n){if(!l(e))return[];let i=[],r=e.childNodes,o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function ei(e,t,n){let i=vi(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function bn(e,t,n){let i=vi(e,t,n);if(l(i))return i.textContent.trim()}function Yd(e,t,n){let i=vi(e,t,n);if(l(i)){let r=i.textContent.trim();return r==="1"||/^true$/i.test(r)}}function aq(e,t,n){if(!l(e))return;let i;if(l(n)){e=e.replace(/\\/g,"/");let r=n[e];if(l(r))i=new De({url:r});else{let o=new oi.default(t.getUrlComponent()),s=new oi.default(e);r=n[s.absoluteTo(o)],l(r)&&(i=new De({url:r}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var Pl={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function iq(e,t){if(!l(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,r=parseInt(e.substring(4,6),16)/255,o=parseInt(e.substring(6,8),16)/255;return t?(o>0?(Pl.maximumRed=o,Pl.red=void 0):(Pl.maximumRed=void 0,Pl.red=0),r>0?(Pl.maximumGreen=r,Pl.green=void 0):(Pl.maximumGreen=void 0,Pl.green=0),i>0?(Pl.maximumBlue=i,Pl.blue=void 0):(Pl.maximumBlue=void 0,Pl.blue=0),Pl.alpha=n,z.fromRandom(Pl)):new z(o,r,i,n)}function iC(e,t,n){let i=bn(e,t,n);if(!!l(i))return iq(i,bn(e,"colorMode",n)==="random")}function Cot(e){let t=vi(e,"TimeStamp",Ie.kmlgx),n=bn(t,"when",Ie.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=ee.fromIso8601(n),r=new $o;return r.addInterval(new Cn({start:i,stop:ke.MAXIMUM_VALUE})),r}function Aot(e){let t=vi(e,"TimeSpan",Ie.kmlgx);if(!l(t))return;let n,i=vi(t,"begin",Ie.kmlgx),r=l(i)?ee.fromIso8601(i.textContent):void 0,o=vi(t,"end",Ie.kmlgx),s=l(o)?ee.fromIso8601(o.textContent):void 0;if(l(r)&&l(s)){if(ee.lessThan(s,r)){let a=r;r=s,s=a}n=new $o,n.addInterval(new Cn({start:r,stop:s}))}else l(r)?(n=new $o,n.addInterval(new Cn({start:r,stop:ke.MAXIMUM_VALUE}))):l(s)&&(n=new $o,n.addInterval(new Cn({start:ke.MINIMUM_VALUE,stop:s})));return n}function s_e(){let e=new Ec;return e.width=v0,e.height=v0,e.scaleByDistance=new St(Ype,Xpe,Kpe,$pe),e.pixelOffsetScaleByDistance=new St(Ype,Xpe,Kpe,$pe),e}function cq(){let e=new Gh;return e.outline=!0,e.outlineColor=z.WHITE,e}function a_e(){let e=new Hh;return e.translucencyByDistance=new St(3e6,1,5e6,0),e.pixelOffset=new W(17,0),e.horizontalOrigin=gi.LEFT,e.font="16px sans-serif",e.style=$r.FILL_AND_OUTLINE,e}function lq(e,t,n,i,r){let o=bn(e,"href",Ie.kml);if(!l(o)||o.length===0)return;if(o.indexOf("root://icons/palette-")===0){let a=o.charAt(21),c=y(ei(e,"x",Ie.gx),0),u=y(ei(e,"y",Ie.gx),0);c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;o=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=aq(o,n,i);if(r){let a=bn(e,"refreshMode",Ie.kml),c=bn(e,"viewRefreshMode",Ie.kml);a==="onInterval"||a==="onExpire"?Lt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&Lt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let u=y(bn(e,"viewBoundScale",Ie.kml),1),f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",d=y(bn(e,"viewFormat",Ie.kml),f),p=bn(e,"httpQuery",Ie.kml);l(d)&&s.setQueryParameters(Mu(ok(d))),l(p)&&s.setQueryParameters(Mu(ok(p)));let g=t._ellipsoid;return fq(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function Tot(e,t,n,i,r){let o=ei(t,"scale",Ie.kml),s=ei(t,"heading",Ie.kml),a=iC(t,"color",Ie.kml),c=vi(t,"Icon",Ie.kml),u=lq(c,e,i,r,!1);l(c)&&!l(u)&&(u=!1);let f=ei(c,"x",Ie.gx),d=ei(c,"y",Ie.gx),p=ei(c,"w",Ie.gx),g=ei(c,"h",Ie.gx),m=vi(t,"hotSpot",Ie.kml),x=D0(m,"x"),C=D0(m,"y"),A=Cs(m,"xunits"),b=Cs(m,"yunits"),T=n.billboard;l(T)||(T=s_e(),n.billboard=T),T.image=u,T.scale=o,T.color=a,(l(f)||l(d)||l(p)||l(g))&&(T.imageSubRegion=new je(f,d,p,g)),l(s)&&s!==0&&(T.rotation=M.toRadians(-s),T.alignedAxis=h.UNIT_Z),o=y(o,1);let S,w;l(x)&&(A==="pixels"?S=-x*o:A==="insetPixels"?S=(x-v0)*o:A==="fraction"&&(S=-x*v0*o),S+=v0*.5*o),l(C)&&(b==="pixels"?w=C*o:b==="insetPixels"?w=(-C+v0)*o:b==="fraction"&&(w=C*v0*o),w-=v0*.5*o),(l(S)||l(w))&&(T.pixelOffset=new W(S,w))}function rk(e,t,n,i,r){for(let o=0,s=t.childNodes.length;o<s;o++){let a=t.childNodes.item(o);if(a.localName==="IconStyle")Tot(e,a,n,i,r);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=a_e(),n.label=c),c.scale=y(ei(a,"scale",Ie.kml),c.scale),c.fillColor=y(iC(a,"color",Ie.kml),c.fillColor),c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new vc,n.polyline=c),c.width=ei(a,"width",Ie.kml),c.material=iC(a,"color",Ie.kml),l(iC(a,"outerColor",Ie.gx))&&Lt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(ei(a,"outerWidth",Ie.gx))&&Lt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(ei(a,"physicalWidth",Ie.gx))&&Lt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(Yd(a,"labelVisibility",Ie.gx))&&Lt("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=cq(),n.polygon=c),c.material=y(iC(a,"color",Ie.kml),c.material),c.fill=y(Yd(a,"fill",Ie.kml),c.fill),c.outline=y(Yd(a,"outline",Ie.kml),c.outline)}else if(a.localName==="BalloonStyle"){let c=y(iq(bn(a,"bgColor",Ie.kml)),z.WHITE),u=y(iq(bn(a,"textColor",Ie.kml)),z.BLACK),f=bn(a,"text",Ie.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:u,text:f}}else if(a.localName==="ListStyle"){let c=bn(a,"listItemType",Ie.kml);(c==="radioFolder"||c==="checkOffOnly")&&Lt(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function bot(e,t,n,i,r){let o=new uo,s,a=-1,c=t.childNodes,u=c.length;for(let d=0;d<u;d++){let p=c[d];(p.localName==="Style"||p.localName==="StyleMap")&&(a=d)}if(a!==-1){let d=c[a];if(d.localName==="Style")rk(e,d,o,i,r);else{let p=qd(d,"Pair",Ie.kml);for(let g=0;g<p.length;g++){let m=p[g],x=bn(m,"key",Ie.kml);if(x==="normal"){let C=bn(m,"styleUrl",Ie.kml);if(l(C))s=n.getById(C),l(s)||(s=n.getById(`#${C}`)),l(s)&&o.merge(s);else{let A=vi(m,"Style",Ie.kml);rk(e,A,o,i,r)}}else Lt(`kml-styleMap-${x}`,`KML - Unsupported StyleMap key: ${x}`)}}}let f=bn(t,"styleUrl",Ie.kml);if(l(f)){let d=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),g=p[0];d=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}s=n.getById(d),l(s)||(s=n.getById(`#${d}`)),l(s)&&o.merge(s)}return o}function Eot(e,t,n){return t.fetchXML().then(function(i){return c_e(e,i,n,t,!0)})}function c_e(e,t,n,i,r,o){let s,a,c,u,f=Qpe(t,"Style",Ie.kml);if(l(f)){let x=f.length;for(s=0;s<x;s++)u=f[s],a=Cs(u,"id"),l(a)&&(a=`#${a}`,r&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new uo({id:a}),n.add(c),rk(e,u,c,i,o)))}let d=Qpe(t,"StyleMap",Ie.kml);if(l(d)){let x=d.length;for(s=0;s<x;s++){let C=d[s];if(a=Cs(C,"id"),l(a)){let A=qd(C,"Pair",Ie.kml);for(let b=0;b<A.length;b++){let T=A[b],S=bn(T,"key",Ie.kml);if(S==="normal"){if(a=`#${a}`,r&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let w=bn(T,"styleUrl",Ie.kml);if(l(w)){w[0]!=="#"&&(w=`#${w}`),r&&l(i)&&(w=i.getUrlComponent()+w);let D=n.getById(w);l(D)&&c.merge(D)}else u=vi(T,"Style",Ie.kml),rk(e,u,c,i,o)}}else Lt(`kml-styleMap-${S}`,`KML - Unsupported StyleMap key: ${S}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),m=g.length;for(s=0;s<m;s++){let x=g[s].textContent;if(x[0]!=="#"){let C=x.split("#");if(C.length===2){let A=C[0],b=i.getDerivedResource({url:A});p.push(Eot(e,b,n))}}}return p}function uq(e,t,n){let i=new o0(e,t.id,["position"]),r=new Qp(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new vc,t.polyline.positions=new i0([i,r])}function l_e(e,t){return!l(e)&&!l(t)||e==="clampToGround"?ze.CLAMP_TO_GROUND:e==="relativeToGround"?ze.RELATIVE_TO_GROUND:e==="absolute"?ze.NONE:t==="clampToSeaFloor"?(Lt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),ze.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(Lt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),ze.RELATIVE_TO_GROUND):(l(e)?Lt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):Lt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),ze.CLAMP_TO_GROUND)}function Sot(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&Lt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`),new Qp(e))}function wot(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&Lt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`);let r=e.length;for(let o=0;o<r;o++){let s=e[o];i.scaleToGeodeticSurface(s,s)}return e}function ak(e,t,n,i){let r=t.label;l(r)||(r=l(n.label)?n.label.clone():a_e(),t.label=r),r.text=t.name;let o=t.billboard;l(o)||(o=l(n.billboard)?n.billboard.clone():s_e(),t.billboard=o),l(o.image)?o.image.getValue()||(o.image=void 0):o.image=e._pinBuilder.fromColor(z.YELLOW,64);let s=1;l(o.scale)&&(s=o.scale.getValue(),s!==0?r.pixelOffset=new W(s*16+1,0):(r.pixelOffset=void 0,r.horizontalOrigin=void 0)),l(i)&&e._clampToGround&&(o.heightReference=i,r.heightReference=i)}function u_e(e,t){let n=e.path;l(n)||(n=new pg,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function vot(e,t,n,i,r){let o=bn(n,"coordinates",Ie.kml),s=bn(n,"altitudeMode",Ie.kml),a=bn(n,"altitudeMode",Ie.gx),c=Yd(n,"extrude",Ie.kml),u=e._ellipsoid,f=sk(o,u);return i.position=f,ak(e,i,r,l_e(s,a)),c&&YD(s,a)&&uq(t,i,r),!0}function e_e(e,t,n,i,r){let o=vi(n,"coordinates",Ie.kml),s=bn(n,"altitudeMode",Ie.kml),a=bn(n,"altitudeMode",Ie.gx),c=Yd(n,"extrude",Ie.kml),u=Yd(n,"tessellate",Ie.kml),f=YD(s,a),d=ei(n,"drawOrder",Ie.gx),p=e._ellipsoid,g=ik(o,p),m=r.polyline;if(f&&c){let x=new _g;i.wall=x,x.positions=g;let C=r.polygon;l(C)&&(x.fill=C.fill,x.material=C.material),x.outline=!0,l(m)?(x.outlineColor=l(m.material)?m.material.color:z.WHITE,x.outlineWidth=m.width):l(C)&&(x.outlineColor=l(C.material)?C.material.color:z.WHITE)}else if(e._clampToGround&&!f&&u){let x=new vc;x.clampToGround=!0,i.polyline=x,x.positions=g,l(m)?(x.material=l(m.material)?m.material.color.getValue(ke.MINIMUM_VALUE):z.WHITE,x.width=y(m.width,1)):(x.material=z.WHITE,x.width=1),x.zIndex=d}else l(d)&&Lt("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&Lt("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),m=l(m)?m.clone():new vc,i.polyline=m,m.positions=wot(g,s,a,p),(!u||f)&&(m.arcType=Kt.NONE);return!0}function Dot(e,t,n,i,r){let o=vi(n,"outerBoundaryIs",Ie.kml),s=vi(o,"LinearRing",Ie.kml),a=vi(s,"coordinates",Ie.kml),c=e._ellipsoid,u=ik(a,c),f=Yd(n,"extrude",Ie.kml),d=bn(n,"altitudeMode",Ie.kml),p=bn(n,"altitudeMode",Ie.gx),g=YD(d,p),m=l(r.polygon)?r.polygon.clone():cq(),x=r.polyline;if(l(x)&&(m.outlineColor=l(x.material)?x.material.color:z.WHITE,m.outlineWidth=x.width),i.polygon=m,g?(m.perPositionHeight=!0,m.extrudedHeight=f?0:void 0):e._clampToGround||(m.height=0),l(u)){let C=new ul(u),A=qd(n,"innerBoundaryIs",Ie.kml);for(let b=0;b<A.length;b++){s=qd(A[b],"LinearRing",Ie.kml);for(let T=0;T<s.length;T++)a=vi(s[T],"coordinates",Ie.kml),u=ik(a,c),l(u)&&C.holes.push(new ul(u))}m.hierarchy=C}return!0}function Pot(e,t,n,i,r){let o=bn(n,"altitudeMode",Ie.kml),s=bn(n,"altitudeMode",Ie.gx),a=qd(n,"coord",Ie.gx),c=qd(n,"angles",Ie.gx),u=qd(n,"when",Ie.kml),f=Yd(n,"extrude",Ie.kml),d=YD(o,s),p=e._ellipsoid;c.length>0&&Lt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,u.length),m=[],x=[];for(let A=0;A<g;A++){let b=sk(a[A].textContent,p);m.push(b),x.push(ee.fromIso8601(u[A].textContent))}let C=new ba;return C.addSamples(x,m),i.position=C,ak(e,i,r,l_e(o,s)),u_e(i,r),i.availability=new $o,u.length>0&&i.availability.addInterval(new Cn({start:x[0],stop:x[x.length-1]})),d&&f&&uq(t,i,r),!0}function t_e(e,t,n,i,r,o,s,a,c){let u=e[0],f=e[e.length-1],d=new ba;d.addSamples(e,t),n.intervals.addInterval(new Cn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:Sot(d,s,a)})),i.addInterval(new Cn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),r.intervals.addInterval(new Cn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:o}))}function Iot(e,t,n,i,r){let o=Yd(n,"interpolate",Ie.gx),s=qd(n,"Track",Ie.gx),a,c,u,f=!1,d=new c0,p=new $o,g=new Ta,m=e._ellipsoid;for(let x=0,C=s.length;x<C;x++){let A=s[x],b=qd(A,"when",Ie.kml),T=qd(A,"coord",Ie.gx),S=bn(A,"altitudeMode",Ie.kml),w=bn(A,"altitudeMode",Ie.gx),D=YD(S,w),I=Yd(A,"extrude",Ie.kml),O=Math.min(T.length,b.length),B=[];a=[];for(let L=0;L<O;L++){let _=sk(T[L].textContent,m);B.push(_),a.push(ee.fromIso8601(b[L].textContent))}o&&(l(c)&&t_e([c,a[0]],[u,B[0]],g,p,d,!1,"absolute",void 0,!1),c=a[O-1],u=B[B.length-1]),t_e(a,B,g,p,d,D&&I,S,w,!0),f=f||D&&I}return i.availability=p,i.position=g,ak(e,i,r),u_e(i,r),f&&(uq(t,i,r),i.polyline.show=d),!0}var f_e={Point:vot,LineString:e_e,LinearRing:e_e,Polygon:Dot,Track:Pot,MultiTrack:Iot,MultiGeometry:Oot,Model:Rot};function Oot(e,t,n,i,r,o){let s=n.childNodes,a=!1;for(let c=0,u=s.length;c<u;c++){let f=s.item(c),d=f_e[f.localName];if(l(d)){let p=o_e(f,t,o);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,d(e,t,f,p,r)&&(a=!0)}}return a}function Rot(e,t,n,i,r){return Lt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function Mot(e,t){let n=vi(e,"ExtendedData",Ie.kml);if(!l(n))return;l(vi(n,"SchemaData",Ie.kml))&&Lt("kml-schemaData","KML - SchemaData is unsupported"),l(Cs(n,"xmlns:prefix"))&&Lt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},r=qd(n,"Data",Ie.kml);if(l(r)){let o=r.length;for(let s=0;s<o;s++){let a=r[s],c=Cs(a,"name");l(c)&&(i[c]={displayName:bn(a,"displayName",Ie.kml),value:bn(a,"value",Ie.kml)})}}t.kml.extendedData=i}var pr;typeof document<"u"&&(pr=document.createElement("div"));function Bot(e,t,n,i,r){let o,s,a,c=t.kml,u=c.extendedData,f=bn(e,"description",Ie.kml),d=y(t.balloonStyle,n.balloonStyle),p=z.WHITE,g=z.BLACK,m=f;l(d)&&(p=y(d.bgColor,z.WHITE),g=y(d.textColor,z.BLACK),m=y(d.text,f));let x;if(l(m)){if(m=m.replace("$[name]",y(t.name,"")),m=m.replace("$[description]",y(f,"")),m=m.replace("$[address]",y(c.address,"")),m=m.replace("$[Snippet]",y(c.snippet,"")),m=m.replace("$[id]",t.id),m=m.replace("$[geDirections]",""),l(u)){let b=m.match(/\$\[.+?\]/g);if(b!==null)for(o=0;o<b.length;o++){let T=b[o],S=T.substr(2,T.length-3),w=/\/displayName$/.test(S);S=S.replace(/\/displayName$/,""),x=u[S],l(x)&&(x=w?x.displayName:x.value),l(x)&&(m=m.replace(T,y(x,"")))}}}else if(l(u)&&(a=Object.keys(u),a.length>0)){for(m='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',o=0;o<a.length;o++)s=a[o],x=u[s],m+=`<tr><th>${y(x.displayName,s)}</th><td>${y(x.value,"")}</td></tr>`;m+="</tbody></table>"}if(!l(m))return;m=pot.link(m),pr.innerHTML=m;let C=pr.querySelectorAll("a");for(o=0;o<C.length;o++)C[o].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(Cu(pr,"a","href",i),Cu(pr,"link","href",i),Cu(pr,"area","href",i),Cu(pr,"img","src",i),Cu(pr,"iframe","src",i),Cu(pr,"video","src",i),Cu(pr,"audio","src",i),Cu(pr,"source","src",i),Cu(pr,"track","src",i),Cu(pr,"input","src",i),Cu(pr,"embed","src",i),Cu(pr,"script","src",i),Cu(pr,"video","poster",i)),Au(pr,"a","href",r),Au(pr,"link","href",r),Au(pr,"area","href",r),Au(pr,"img","src",r),Au(pr,"iframe","src",r),Au(pr,"video","src",r),Au(pr,"audio","src",r),Au(pr,"source","src",r),Au(pr,"track","src",r),Au(pr,"input","src",r),Au(pr,"embed","src",r),Au(pr,"script","src",r),Au(pr,"video","poster",r);let A='<div class="cesium-infoBox-description-lighter" style="';A+="overflow:auto;",A+="word-wrap:break-word;",A+=`background-color:${p.toCssColorString()};`,A+=`color:${g.toCssColorString()};`,A+='">',A+=`${pr.innerHTML}</div>`,pr.innerHTML="",t.description=A}function ck(e,t,n){let i=n.entityCollection,r=n.parentEntity,o=n.sourceResource,s=n.uriResolver,a=o_e(t,i,n.context),c=a.kml,u=bot(e,t,n.styleCollection,o,s),f=bn(t,"name",Ie.kml);a.name=f,a.parent=r;let d=Aot(t);l(d)||(d=Cot(t)),a.availability=d,hq(a);function p(T){return T?T.show&&p(T.parent):!0}let g=Yd(t,"visibility",Ie.kml);a.show=p(r)&&y(g,!0);let m=vi(t,"author",Ie.atom),x=c.author;x.name=bn(m,"name",Ie.atom),x.uri=bn(m,"uri",Ie.atom),x.email=bn(m,"email",Ie.atom);let C=vi(t,"link",Ie.atom),A=c.link;A.href=Cs(C,"href"),A.hreflang=Cs(C,"hreflang"),A.rel=Cs(C,"rel"),A.type=Cs(C,"type"),A.title=Cs(C,"title"),A.length=Cs(C,"length"),c.address=bn(t,"address",Ie.kml),c.phoneNumber=bn(t,"phoneNumber",Ie.kml),c.snippet=bn(t,"Snippet",Ie.kml),Mot(t,a),Bot(t,a,u,s,o);let b=e._ellipsoid;return m_e(t,a,b),h_e(t,a,b),l(vi(t,"Region",Ie.kml))&&Lt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function d_e(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function Lot(e,t,n,i){let r=ck(e,t,n),o=$e(n);o.parentEntity=r.entity,d_e(e,t,o,i)}function Not(e,t,n,i){let r=ck(e,t,n),o=r.entity,s=r.styleEntity,a=!1,c=t.childNodes;for(let u=0,f=c.length;u<f&&!a;u++){let d=c.item(u),p=f_e[d.localName];l(p)&&(p(e,n.entityCollection,d,o,s,o.id),a=!0)}a||(o.merge(s),ak(e,o,s))}var Fot={FlyTo:Uot,Wait:kot,SoundCue:eq,AnimatedUpdate:eq,TourControl:eq};function Vot(e,t,n,i){let r=bn(t,"name",Ie.kml),o=Cs(t,"id"),s=new QV(r,o),a=vi(t,"Playlist",Ie.gx);if(a){let c=e._ellipsoid,u=a.childNodes;for(let f=0;f<u.length;f++){let d=u[f];if(d.localName){let p=Fot[d.localName];p?p(s,d,c):console.log(`Unknown KML Tour playlist entry type ${d.localName}`)}}}e._kmlTours.push(s)}function eq(e,t){Lt(`KML Tour unsupported node ${t.localName}`)}function kot(e,t){let n=ei(t,"duration",Ie.gx);e.addPlaylistEntry(new nk(n))}function Uot(e,t,n){let i=ei(t,"duration",Ie.gx),r=bn(t,"flyToMode",Ie.gx),o={kml:{}};m_e(t,o,n),h_e(t,o,n);let s=o.kml.lookAt||o.kml.camera,a=new tk(i,r,s);e.addPlaylistEntry(a)}function h_e(e,t,n){let i=vi(e,"Camera",Ie.kml);if(l(i)){let r=y(ei(i,"longitude",Ie.kml),0),o=y(ei(i,"latitude",Ie.kml),0),s=y(ei(i,"altitude",Ie.kml),0),a=y(ei(i,"heading",Ie.kml),0),c=y(ei(i,"tilt",Ie.kml),0),u=y(ei(i,"roll",Ie.kml),0),f=h.fromDegrees(r,o,s,n),d=Yf.fromDegrees(a,c-90,u);t.kml.camera=new $V(f,d)}}function m_e(e,t,n){let i=vi(e,"LookAt",Ie.kml);if(l(i)){let r=y(ei(i,"longitude",Ie.kml),0),o=y(ei(i,"latitude",Ie.kml),0),s=y(ei(i,"altitude",Ie.kml),0),a=ei(i,"heading",Ie.kml),c=ei(i,"tilt",Ie.kml),u=y(ei(i,"range",Ie.kml),0);c=M.toRadians(y(c,0)),a=M.toRadians(y(a,0));let f=new ju(a,c-M.PI_OVER_TWO,u),d=h.fromDegrees(r,o,s,n);t.kml.lookAt=new ZV(d,f)}}function zot(e,t,n,i){let r=n.screenOverlayContainer;if(!l(r))return;let o=n.sourceResource,s=n.uriResolver,a=vi(t,"Icon",Ie.kml),c=lq(a,e,o,s,!1);if(!l(c))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=c.url,u.onload=function(){let f=["position: absolute"],d=vi(t,"screenXY",Ie.kml),p=vi(t,"overlayXY",Ie.kml),g=vi(t,"size",Ie.kml),m,x,C,A,b,T;l(g)&&(m=D0(g,"x"),x=D0(g,"y"),C=Cs(g,"xunits"),A=Cs(g,"yunits"),l(m)&&m!==-1&&m!==0&&(C==="fraction"?b=`width: ${Math.floor(m*100)}%`:C==="pixels"&&(b=`width: ${m}px`),f.push(b)),l(x)&&x!==-1&&x!==0&&(A==="fraction"?T=`height: ${Math.floor(x*100)}%`:A==="pixels"&&(T=`height: ${x}px`),f.push(T))),u.style=f.join(";");let S=0,w=u.height;l(p)&&(m=D0(p,"x"),x=D0(p,"y"),C=Cs(p,"xunits"),A=Cs(p,"yunits"),l(m)&&(C==="fraction"?S=m*u.width:(C==="pixels"||C==="insetPixels")&&(S=m)),l(x)&&(A==="fraction"?w=x*u.height:(A==="pixels"||A==="insetPixels")&&(w=x))),l(d)&&(m=D0(d,"x"),x=D0(d,"y"),C=Cs(d,"xunits"),A=Cs(d,"yunits"),l(m)&&(C==="fraction"?b=`left: calc(${Math.floor(m*100)}% - ${S}px)`:C==="pixels"?b=`left: ${m-S}px`:C==="insetPixels"&&(b=`right: ${m-S}px`),f.push(b)),l(x)&&(A==="fraction"?T=`bottom: calc(${Math.floor(x*100)}% - ${w}px)`:A==="pixels"?T=`bottom: ${x-w}px`:A==="insetPixels"&&(T=`top: ${x-w}px`),f.push(T))),u.style=f.join(";")},r.appendChild(u)}function Hot(e,t,n,i){let o=ck(e,t,n).entity,s,a=!1,c=e._ellipsoid,u=ik(vi(t,"LatLonQuad",Ie.gx),c),f=ei(t,"drawOrder",Ie.kml);if(l(u))s=cq(),s.hierarchy=new ul(u),s.zIndex=f,o.polygon=s,a=!0;else{s=new Wh,s.zIndex=f,o.rectangle=s;let m=vi(t,"LatLonBox",Ie.kml);if(l(m)){let x=ei(m,"west",Ie.kml),C=ei(m,"south",Ie.kml),A=ei(m,"east",Ie.kml),b=ei(m,"north",Ie.kml);l(x)&&(x=M.negativePiToPi(M.toRadians(x))),l(C)&&(C=M.clampToLatitudeRange(M.toRadians(C))),l(A)&&(A=M.negativePiToPi(M.toRadians(A))),l(b)&&(b=M.clampToLatitudeRange(M.toRadians(b))),s.coordinates=new he(x,C,A,b);let T=ei(m,"rotation",Ie.kml);if(l(T)){let S=M.toRadians(T);s.rotation=S,s.stRotation=S}}}let d=vi(t,"Icon",Ie.kml),p=lq(d,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&Lt("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let m=ei(d,"x",Ie.gx),x=ei(d,"y",Ie.gx),C=ei(d,"w",Ie.gx),A=ei(d,"h",Ie.gx);(l(m)||l(x)||l(C)||l(A))&&Lt("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=iC(t,"color",Ie.kml),s.material.transparent=!0}else s.material=iC(t,"color",Ie.kml);let g=bn(t,"altitudeMode",Ie.kml);l(g)?g==="absolute"?(s.height=ei(t,"altitude",Ie.kml),s.zIndex=void 0):g!=="clampToGround"&&Lt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=bn(t,"altitudeMode",Ie.gx),g==="relativeToSeaFloor"?(Lt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=ei(t,"altitude",Ie.kml),s.zIndex=void 0):g==="clampToSeaFloor"?Lt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(g)&&Lt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`))}function p_e(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),Lt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var P0={INTERVAL:0,EXPIRE:1,STOP:2};function ok(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var Got=new he,pE=new me,tq=new W,Wot=new h;function fq(e,t,n,i,r,o){function s(u){return u<-M.PI_OVER_TWO?-M.PI_OVER_TWO:u>M.PI_OVER_TWO?M.PI_OVER_TWO:u}function a(u){return u>M.PI?u-M.TWO_PI:u<-M.PI?u+M.TWO_PI:u}let c=KC(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==te.MORPHING){let u,f;if(r=y(r,Got),l(n)&&(tq.x=n.clientWidth*.5,tq.y=n.clientHeight*.5,u=t.pickEllipsoid(tq,o,Wot)),l(u)?f=o.cartesianToCartographic(u,pE):(f=he.center(r,pE),u=o.cartographicToCartesian(f)),l(i)&&!M.equalsEpsilon(i,1,M.EPSILON9)){let A=r.width*i*.5,b=r.height*i*.5;r=new he(a(f.longitude-A),s(f.latitude-b),a(f.longitude+A),s(f.latitude+b))}c=c.replace("[bboxWest]",M.toDegrees(r.west).toString()),c=c.replace("[bboxSouth]",M.toDegrees(r.south).toString()),c=c.replace("[bboxEast]",M.toDegrees(r.east).toString()),c=c.replace("[bboxNorth]",M.toDegrees(r.north).toString());let d=M.toDegrees(f.longitude).toString(),p=M.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",d),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",M.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",M.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",h.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",d),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),o.cartesianToCartographic(t.positionWC,pE),c=c.replace("[cameraLon]",M.toDegrees(pE.longitude).toString()),c=c.replace("[cameraLat]",M.toDegrees(pE.latitude).toString()),c=c.replace("[cameraAlt]",M.toDegrees(pE.height).toString());let g=t.frustum,m=g.aspectRatio,x="",C="";if(l(m)){let A=M.toDegrees(g.fov);m>1?(x=A,C=A/m):(C=A,x=A*m)}c=c.replace("[horizFov]",x.toString()),c=c.replace("[vertFov]",C.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(Mu(c))}function jot(e,t,n,i){let o=ck(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=vi(t,"Link",Ie.kml);if(l(c)||(c=vi(t,"Url",Ie.kml)),l(c)){let u=bn(c,"href",Ie.kml),f,d;if(l(u)){let p=u;if(u=aq(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{p=u.clone(),f=bn(c,"viewRefreshMode",Ie.kml),d=y(bn(c,"viewBoundScale",Ie.kml),1);let C=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",A=y(bn(c,"viewFormat",Ie.kml),C),b=bn(c,"httpQuery",Ie.kml);l(A)&&u.setQueryParameters(Mu(ok(A))),l(b)&&u.setQueryParameters(Mu(ok(b)));let T=e._ellipsoid;fq(u,e.camera,e.canvas,d,e._lastCameraView.bbox,T)}let g={sourceUri:p,uriResolver:a,context:o.id,screenOverlayContainer:n.screenOverlayContainer},m=new Zs,x=dq(e,m,u,g).then(function(C){let A=e._entityCollection,b=m.values;A.suspendEvents();for(let w=0;w<b.length;w++){let D=b[w];l(D.parent)||(D.parent=o,hq(D)),A.add(D)}A.resumeEvents();let T=bn(c,"refreshMode",Ie.kml),S=y(ei(c,"refreshInterval",Ie.kml),0);if(T==="onInterval"&&S>0||T==="onExpire"||f==="onStop"){let w=vi(C,"NetworkLinkControl",Ie.kml),D=l(w),I=ee.now(),O={id:Ln(),href:u,cookie:{},lastUpdated:I,updating:!1,entity:o,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:I},B=0;if(D&&(O.cookie=Mu(y(bn(w,"cookie",Ie.kml),"")),B=y(ei(w,"minRefreshPeriod",Ie.kml),0)),T==="onInterval")D&&(S=Math.max(B,S)),O.refreshMode=P0.INTERVAL,O.time=S;else if(T==="onExpire"){let L;if(D&&(L=bn(w,"expires",Ie.kml)),l(L))try{let _=ee.fromIso8601(L),E=ee.secondsDifference(_,I);E>0&&E<B&&ee.addSeconds(I,B,_),O.refreshMode=P0.EXPIRE,O.time=_}catch{Lt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else Lt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(O.refreshMode=P0.STOP,O.time=y(ei(c,"viewRefreshTime",Ie.kml),0)):Lt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(O.refreshMode)&&e._networkLinks.set(O.id,O)}else f==="onRegion"&&Lt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion")}).catch(function(C){Lt(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,C)});i.addPromise(x)}}}function qot(e,t,n,i){let r=sq[t.localName];return l(r)?r(e,t,n,i):p_e(e,t,n,i)}function rq(e,t,n,i,r,o,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:vi(a,"Document",Ie.kml),u=bn(c,"name",Ie.kml);l(u)||(u=W_(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new Tu._DeferredLoading(e),d=new Zs(e);return Promise.all(c_e(e,n,d,i,!1,r)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let m=p.childNodes;for(let x=0;x<m.length;x++){let C=m[x];if(l(sq[C.localName])){p=C;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:d,sourceResource:i,uriResolver:r,context:s,screenOverlayContainer:o};return t.suspendEvents(),qot(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}function Yot(e,t,n,i,r){let o=Qt("ThirdParty/Workers/z-worker-pako.js");ec.configure({workerScripts:{deflate:[o,"./pako_deflate.min.js"],inflate:[o,"./pako_inflate.min.js"]}});let s=new ec.ZipReader(new ec.BlobReader(n));return Promise.resolve(s.getEntries()).then(function(a){let c=[],u={},f;for(let d=0;d<a.length;d++){let p=a[d];p.directory||(/\.kml$/i.test(p.filename)&&(!l(f)||!/\//i.test(p.filename))?(l(f)&&c.push(Qj(f,u)),f=p):c.push(Qj(p,u)))}return l(f)&&c.push(xot(f,u)),Promise.all(c).then(function(){if(s.close(),!l(u.kml))throw new fe("KMZ file does not contain a KML document.");return u.keys=Object.keys(u),rq(e,t,u.kml,i,u,r)})})}function dq(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let r=i.sourceUri,o=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof De){n=De.createIfNeeded(n),c=n.fetchBlob(),r=y(r,n.clone());let u=e._resourceCredits,f=n.credits;if(l(f)){let d=f.length;for(let p=0;p<d;p++)u.push(f[p])}}else r=y(r,De.DEFAULT.clone());return r=De.createIfNeeded(r),l(a)&&(a=Pn(a)),Promise.resolve(c).then(function(u){return u instanceof Blob?got(u).then(function(f){return f?Yot(e,t,u,r,a):yot(u).then(function(d){d=i_e(d),d=r_e(d);let p,g;try{p=oq.parseFromString(d,"application/xml")}catch(m){g=m.toString()}if(l(g)||p.body||p.documentElement.tagName==="parsererror"){let m=l(g)?g:p.documentElement.firstChild.nodeValue;throw m||(m=p.body.innerText),new fe(m)}return rq(e,t,p,r,o,a,s)})}):rq(e,t,u,r,o,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}function Tu(e){e=y(e,y.EMPTY_OBJECT);let t=e.camera,n=e.canvas;this._changed=new ge,this._error=new ge,this._loading=new ge,this._refresh=new ge,this._unsupportedNode=new ge,this._clock=void 0,this._entityCollection=new Zs(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new X_,this._networkLinks=new xt,this._entityCluster=new bf,this.canvas=n,this.camera=t,this._lastCameraView={position:l(t)?h.clone(t.positionWC):void 0,direction:l(t)?h.clone(t.directionWC):void 0,up:l(t)?h.clone(t.upWC):void 0,bbox:l(t)?t.computeViewRectangle():he.clone(he.MAX_VALUE)},this._ellipsoid=y(e.ellipsoid,oe.WGS84);let i=e.credit;typeof i=="string"&&(i=new Gt(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}Tu.load=function(e,t){return t=y(t,y.EMPTY_OBJECT),new Tu(t).load(e,t)};Object.defineProperties(Tu.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},refreshEvent:{get:function(){return this._refresh}},unsupportedNodeEvent:{get:function(){return this._unsupportedNode}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}},kmlTours:{get:function(){return this._kmlTours}}});Tu.prototype.load=function(e,t){t=y(t,y.EMPTY_OBJECT),Jo.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=y(t.clampToGround,!1);let i=this;return dq(this,this._entityCollection,e,t).then(function(){let r,o=i._entityCollection.computeAvailability(),s=o.start,a=o.stop,c=ee.equals(s,ke.MINIMUM_VALUE),u=ee.equals(a,ke.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=ee.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),a=ee.fromDate(d)),r=new fm,r.startTime=s,r.stopTime=a,r.currentTime=ee.clone(s),r.clockRange=jo.LOOP_STOP,r.clockStep=xr.SYSTEM_CLOCK_MULTIPLIER,r.multiplier=Math.round(Math.min(Math.max(ee.secondsDifference(a,s)/60,1),31556900))}let f=!1;return r!==i._clock&&(i._clock=r,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Jo.setLoading(i,!1),i}).catch(function(r){return Jo.setLoading(i,!1),i._error.raiseEvent(i,r),console.log(r),Promise.reject(r)})};Tu.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function hq(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function Xot(e,t,n,i,r){return function(o){if(!i.contains(t.id))return;let s=!1,a=vi(o,"NetworkLinkControl",Ie.kml),c=l(a),u=0;if(c){if(l(vi(a,"Update",Ie.kml))){Lt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Mu(y(bn(a,"cookie",Ie.kml),"")),u=y(ei(a,"minRefreshPeriod",Ie.kml),0)}let f=ee.now(),d=t.refreshMode;if(d===P0.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(d===P0.EXPIRE){let I;if(l(a)&&(I=bn(a,"expires",Ie.kml)),l(I))try{let O=ee.fromIso8601(I),B=ee.secondsDifference(O,f);B>0&&B<u&&ee.addSeconds(f,u,O),t.time=O}catch{Lt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else Lt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,g=e._entityCollection,m=n.values;function x(I){g.remove(I);let O=I._children,B=O.length;for(let L=0;L<B;++L)x(O[L])}g.suspendEvents();let C=g.values.slice(),A;for(A=0;A<C.length;++A){let I=C[A];I.parent===p&&(I.parent=void 0,x(I))}for(g.resumeEvents(),g.suspendEvents(),A=0;A<m.length;A++){let I=m[A];l(I.parent)||(I.parent=p,hq(I)),g.add(I)}g.resumeEvents(),s?i.remove(t.id):t.lastUpdated=f;let b=g.computeAvailability(),T=b.start,S=b.stop,w=ee.equals(T,ke.MINIMUM_VALUE),D=ee.equals(S,ke.MAXIMUM_VALUE);if(!w||!D){let I=e._clock;(I.startTime!==T||I.stopTime!==S)&&(I.startTime=T,I.stopTime=S,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,r.getUrlComponent(!0))}}var nq=new xt;Tu.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=ee.now(),i=this;nq.removeAll();function r(f){let d=f._children,p=d.length;for(let g=0;g<p;++g){let m=d[g];nq.set(m.id,m),r(m)}}let o=!1,s=this._lastCameraView,a=this.camera;l(a)&&!(a.positionWC.equalsEpsilon(s.position,M.EPSILON7)&&a.directionWC.equalsEpsilon(s.direction,M.EPSILON7)&&a.upWC.equalsEpsilon(s.up,M.EPSILON7))&&(s.position=h.clone(a.positionWC),s.direction=h.clone(a.directionWC),s.up=h.clone(a.upWC),s.bbox=a.computeViewRectangle(),o=!0);let c=new xt,u=!1;return t.values.forEach(function(f){let d=f.entity;if(!nq.contains(d.id)){if(!f.updating){let p=!1;if(f.refreshMode===P0.INTERVAL?ee.secondsDifference(n,f.lastUpdated)>f.time&&(p=!0):f.refreshMode===P0.EXPIRE?ee.greaterThan(n,f.time)&&(p=!0):f.refreshMode===P0.STOP&&(o&&(f.needsUpdate=!0,f.cameraUpdateTime=n),f.needsUpdate&&ee.secondsDifference(n,f.cameraUpdateTime)>=f.time&&(p=!0)),p){r(d),f.updating=!0;let g=new Zs,m=f.href.clone();m.setQueryParameters(f.cookie);let x=y(i._ellipsoid,oe.WGS84);fq(m,i.camera,i.canvas,f.viewBoundScale,s.bbox,x),dq(i,g,m,{context:d.id}).then(Xot(i,f,g,c,m)).catch(function(C){let A=`NetworkLink ${f.href} refresh failed: ${C}`;console.log(A),i._error.raiseEvent(i,A)}),u=!0}}c.set(f.id,f)}}),u&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function Kot(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}Tu._DeferredLoading=Am;Tu._getTimestamp=Bi;var lk=Tu;function XD(){ye.throwInstantiationError()}XD.prototype.update=ye.throwInstantiationError;XD.prototype.getBoundingSphere=ye.throwInstantiationError;XD.prototype.isDestroyed=ye.throwInstantiationError;XD.prototype.destroy=ye.throwInstantiationError;var __e=XD;var $ot={},g_e=$ot;var _E=`attribute vec4 position;
- attribute vec2 textureCoordinates;
- varying vec2 v_textureCoordinates;
- void main()
- {
- gl_Position = position;
- v_textureCoordinates = textureCoordinates;
- }
- `;function uk(e){this._context=e}var KD,Zot=new Ze({primitiveType:Me.TRIANGLES}),Jot=new li({color:new z(0,0,0,0)});function Qot(e,t){return new ya({context:e,colorTextures:[t],destroyAttachments:!1})}function est(e,t){return Wt.fromCache({context:e,vertexShaderSource:_E,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function tst(e,t){return(!l(KD)||KD.viewport.width!==e||KD.viewport.height!==t)&&(KD=Ve.fromCache({viewport:new je(0,0,e,t)})),KD}uk.prototype.execute=function(e){l(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,r=this._context,o=l(e.vertexArray)?e.vertexArray:r.getViewportQuadVertexArray(),s=l(e.shaderProgram)?e.shaderProgram:est(r,e.fragmentShaderSource),a=Qot(r,t),c=tst(n,i),u=e.uniformMap,f=Jot;f.framebuffer=a,f.renderState=c,f.execute(r);let d=Zot;d.vertexArray=o,d.renderState=c,d.shaderProgram=s,d.uniformMap=u,d.framebuffer=a,d.execute(r),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&o.destroy()),l(e.postExecute)&&e.postExecute(t)};uk.prototype.isDestroyed=function(){return!1};uk.prototype.destroy=function(){return ue(this)};var fk=uk;function nst(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var Hc=nst;function Xd(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(Xd.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});Xd.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};Xd.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new Fe({sources:[t]})),typeof n=="string"&&(n=new Fe({sources:[n]}));let r=t.createCombinedVertexShader(this._context),o=n.createCombinedFragmentShader(this._context),s=r+o+JSON.stringify(i),a;if(l(this._shaders[s]))a=this._shaders[s],delete this._shadersToRelease[s];else{let c=this._context,u=new Wt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:t,vertexShaderText:r,fragmentShaderSource:n,fragmentShaderText:o,attributeLocations:i});a={cache:this,shaderProgram:u,keyword:s,derivedKeywords:[],count:0},u._cachedShader=a,this._shaders[s]=a,++this._numberOfShaders}return++a.count,a.shaderProgram};Xd.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=this._shaders[r];if(l(o)){mq(this,o);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};Xd.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,r=this._shaders[i];if(!!l(r))return r.shaderProgram};Xd.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof o=="string"&&(o=new Fe({sources:[o]})),typeof s=="string"&&(s=new Fe({sources:[s]}));let c=this._context,u=o.createCombinedVertexShader(c),f=s.createCombinedFragmentShader(c),d=new Wt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:o,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),p={cache:this,shaderProgram:d,keyword:r,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),d._cachedShader=p,this._shaders[r]=p,d};function mq(e,t){let n=t.derivedKeywords,i=n.length;for(let r=0;r<i;++r){let o=n[r]+t.keyword,s=e._shaders[o];mq(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}Xd.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];mq(this,n),--this._numberOfShaders}this._shadersToRelease={}};Xd.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};Xd.prototype.isDestroyed=function(){return!1};Xd.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return ue(this)};var dk=Xd;function rC(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(rC.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});rC.prototype.getTexture=function(e){let t=this._textures[e];if(!!l(t))return delete this._texturesToRelease[e],++t.count,t.texture};rC.prototype.addTexture=function(e,t){let n={texture:t,count:1};t.finalDestroy=t.destroy;let i=this;t.destroy=function(){--n.count===0&&(i._texturesToRelease[e]=n)},this._textures[e]=n,++this._numberOfTextures};rC.prototype.destroyReleasedTextures=function(){let e=this._texturesToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];delete this._textures[t],n.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}};rC.prototype.isDestroyed=function(){return!1};rC.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return ue(this)};var hk=rC;function ist(e){e=y(e,y.EMPTY_OBJECT),this.color=z.clone(y(e.color,z.WHITE)),this.intensity=y(e.intensity,2)}var I0=ist;function gE(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new je,this._viewportCartesian4=new se,this._viewportDirty=!1,this._viewportOrthographicMatrix=N.clone(N.IDENTITY),this._viewportTransformation=N.clone(N.IDENTITY),this._model=N.clone(N.IDENTITY),this._view=N.clone(N.IDENTITY),this._inverseView=N.clone(N.IDENTITY),this._projection=N.clone(N.IDENTITY),this._infiniteProjection=N.clone(N.IDENTITY),this._entireFrustum=new W,this._currentFrustum=new W,this._frustumPlanes=new se,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=Q.clone(N.IDENTITY),this._view3DDirty=!0,this._view3D=new N,this._inverseView3DDirty=!0,this._inverseView3D=new N,this._inverseModelDirty=!0,this._inverseModel=new N,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new Q,this._viewRotation=new Q,this._inverseViewRotation=new Q,this._viewRotation3D=new Q,this._inverseViewRotation3D=new Q,this._inverseProjectionDirty=!0,this._inverseProjection=new N,this._modelViewDirty=!0,this._modelView=new N,this._modelView3DDirty=!0,this._modelView3D=new N,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new N,this._inverseModelViewDirty=!0,this._inverseModelView=new N,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new N,this._viewProjectionDirty=!0,this._viewProjection=new N,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new N,this._modelViewProjectionDirty=!0,this._modelViewProjection=new N,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new N,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new N,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new N,this._normalDirty=!0,this._normal=new Q,this._normal3DDirty=!0,this._normal3D=new Q,this._inverseNormalDirty=!0,this._inverseNormal=new Q,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new Q,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new zn,this._cameraPosition=new h,this._sunPositionWC=new h,this._sunPositionColumbusView=new h,this._sunDirectionWC=new h,this._sunDirectionEC=new h,this._moonDirectionEC=new h,this._lightDirectionWC=new h,this._lightDirectionEC=new h,this._lightColor=new h,this._lightColorHdr=new h,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new h,this._cameraRight=new h,this._cameraUp=new h,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new W,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new z,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsDimensions=new W,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(gE.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!je.equals(e,this._viewport)){je.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return y_e(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return y_e(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){N.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,N.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,N.getMatrix3(this.inverseModel,e),Q.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return pq(this),this._view3D}},viewRotation:{get:function(){return pq(this),this._viewRotation}},viewRotation3D:{get:function(){return pq(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return A_e(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return A_e(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return hst(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return mst(this),this._modelView}},modelView3D:{get:function(){return pst(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return Ast(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return _st(this),this._inverseModelView}},inverseModelView3D:{get:function(){return gst(this),this._inverseModelView3D}},viewProjection:{get:function(){return yst(this),this._viewProjection}},inverseViewProjection:{get:function(){return xst(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return Cst(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return Tst(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return bst(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return Est(this),this._modelViewInfiniteProjection}},normal:{get:function(){return Sst(this),this._normal}},normal3D:{get:function(){return wst(this),this._normal3D}},inverseNormal:{get:function(){return vst(this),this._inverseNormal}},inverseNormal3D:{get:function(){return Dst(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return C_e(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return C_e(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsDimensions:{get:function(){return this._specularEnvironmentMapsDimensions}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return y(this._ellipsoid,oe.WGS84)}}});function rst(e,t){N.clone(t,e._view),N.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function ost(e,t){N.clone(t,e._inverseView),N.getMatrix3(t,e._inverseViewRotation)}function sst(e,t){N.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function ast(e,t){N.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function cst(e,t){h.clone(t.positionWC,e._cameraPosition),h.clone(t.directionWC,e._cameraDirection),h.clone(t.rightWC,e._cameraRight),h.clone(t.upWC,e._cameraUp);let n=t.positionCartographic;l(n)?e._eyeHeight=n.height:e._eyeHeight=-e._ellipsoid.maximumRadius,e._encodedCameraPositionMCDirty=!0}var $D=new Q,lst=new me;function ust(e,t){l(yt.computeIcrfToFixedMatrix(t.time,$D))||($D=yt.computeTemeToPseudoFixedMatrix(t.time,$D));let n=Wy.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);Q.multiplyByVector($D,n,n),h.normalize(n,e._sunDirectionWC),n=Q.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=Wy.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),Q.multiplyByVector($D,n,n),Q.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,o=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,lst);i.project(o,e._sunPositionColumbusView)}gE.prototype.updateCamera=function(e){rst(this,e.viewMatrix),ost(this,e.inverseViewMatrix),cst(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==te.SCENE2D&&e.frustum instanceof en};gE.prototype.updateFrustum=function(e){sst(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&ast(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=M.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne,l(e._offCenterFrustum)&&(e=e._offCenterFrustum),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};gE.prototype.updatePass=function(e){this._pass=e};var fst=[],dst=new I0;gE.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===te.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),ust(this,e);let n=y(e.light,dst);n instanceof I0?(this._lightDirectionWC=h.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=h.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=h.normalize(h.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=Q.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,r=h.fromElements(i.red,i.green,i.blue,this._lightColorHdr);r=h.multiplyByScalar(r,n.intensity,r);let o=h.maximumComponent(r);o>1?h.divideByScalar(r,o,this._lightColor):h.clone(r,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=y(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=y(e.sphericalHarmonicCoefficients,fst),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,l(this._specularEnvironmentMaps)&&W.clone(this._specularEnvironmentMaps.dimensions,this._specularEnvironmentMapsDimensions),this._fogDensity=e.fog.density,this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=yt.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let c=t.frustum.fov,u=this._viewport,f;l(c)?u.height>u.width?f=Math.tan(.5*c)*2/u.height:f=Math.tan(.5*c)*2/u.width:f=1/Math.max(u.width,u.height),this._geometricToleranceOverMeter=f*e.maximumScreenSpaceError,z.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function y_e(e){if(e._viewportDirty){let t=e._viewport;N.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),N.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function hst(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==te.SCENE2D&&e._mode!==te.MORPHING&&!e._orthographicIn3D?N.inverse(e._projection,e._inverseProjection):N.clone(N.ZERO,e._inverseProjection))}function mst(e){e._modelViewDirty&&(e._modelViewDirty=!1,N.multiplyTransformation(e._view,e._model,e._modelView))}function pst(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,N.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function _st(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,N.inverse(e.modelView,e._inverseModelView))}function gst(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,N.inverse(e.modelView3D,e._inverseModelView3D))}function yst(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,N.multiply(e._projection,e._view,e._viewProjection))}function xst(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,N.inverse(e.viewProjection,e._inverseViewProjection))}function Cst(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,N.multiply(e._projection,e.modelView,e._modelViewProjection))}function Ast(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function Tst(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,N.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function bst(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,N.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function Est(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,N.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function Sst(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;N.getMatrix3(e.inverseModelView,t),Q.getRotation(t,t),Q.transpose(t,t)}}function wst(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;N.getMatrix3(e.inverseModelView3D,t),Q.getRotation(t,t),Q.transpose(t,t)}}function vst(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,N.getMatrix3(e.inverseModelView,e._inverseNormal),Q.getRotation(e._inverseNormal,e._inverseNormal))}function Dst(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,N.getMatrix3(e.inverseModelView3D,e._inverseNormal3D),Q.getRotation(e._inverseNormal3D,e._inverseNormal3D))}var x_e=new h;function C_e(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,N.multiplyByPoint(e.inverseModel,e._cameraPosition,x_e),zn.fromCartesian(x_e,e._encodedCameraPositionMC))}var Pst=new h,Ist=new h,Ost=new h,Rst=new h,Mst=new me,Bst=new h,Lst=new N;function Nst(e,t,n,i,r,o,s,a){let c=Pst;c.x=e.y,c.y=e.z,c.z=e.x;let u=Ist;u.x=n.y,u.y=n.z,u.z=n.x;let f=Ost;f.x=i.y,f.y=i.z,f.z=i.x;let d=Rst;d.x=t.y,d.y=t.z,d.z=t.x,o===te.SCENE2D&&(c.z=r*.5);let p=s.unproject(c,Mst);p.longitude=M.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=M.clamp(p.latitude,-M.PI_OVER_TWO,M.PI_OVER_TWO);let g=s.ellipsoid,m=g.cartographicToCartesian(p,Bst),x=yt.eastNorthUpToFixedFrame(m,g,Lst);return N.multiplyByPointAsVector(x,u,u),N.multiplyByPointAsVector(x,f,f),N.multiplyByPointAsVector(x,d,d),l(a)||(a=new N),a[0]=u.x,a[1]=f.x,a[2]=-d.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-d.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-d.z,a[11]=0,a[12]=-h.dot(u,m),a[13]=-h.dot(f,m),a[14]=h.dot(d,m),a[15]=1,a}function pq(e){e._view3DDirty&&(e._mode===te.SCENE3D?N.clone(e._view,e._view3D):Nst(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),N.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function A_e(e){e._inverseView3DDirty&&(N.inverseTransformation(e.view3D,e._inverseView3D),N.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var mk=gE;function Fst(e,t){let n="WebGL Error: ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function Vst(e,t,n,i){let r=`${Fst(e,i)}: ${t.name}(`;for(let o=0;o<n.length;++o)o!==0&&(r+=", "),r+=n[o];return r+=");",r}function kst(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new fe(Vst(e,t,n,i))}function Ust(e,t,n){return{get:function(){let i=e[t];return n(e,`get: ${t}`,i),e[t]},set:function(i){e[t]=i,n(e,`set: ${t}`,i)}}}function zst(e,t){if(!l(t))return e;function n(r){return function(){let o=r.apply(e,arguments);return t(e,r,arguments),o}}let i={};for(let r in e){let o=e[r];o instanceof Function?i[r]=n(o):Object.defineProperty(i,r,Ust(e,r,t))}return i}function Vo(e,t){let n=t.length;for(let i=0;i<n;++i){let r=e.getExtension(t[i]);if(r)return r}}function Rf(e,t){if(typeof WebGLRenderingContext>"u")throw new fe("The browser does not support WebGL. Visit http://get.webgl.org.");this._canvas=e,t=$e(t,!0),t=y(t,{}),t.allowTextureFilterAnisotropic=y(t.allowTextureFilterAnisotropic,!0);let n=y(t.webgl,{});n.alpha=y(n.alpha,!1),n.stencil=y(n.stencil,!0);let i=y(t.requestWebgl2,!1)&&typeof WebGL2RenderingContext<"u",r=!1,o,s=t.getWebGLStub;if(l(s))o=s(e,n);else if(i&&(o=e.getContext("webgl2",n)||e.getContext("experimental-webgl2",n)||void 0,l(o)&&(r=!0)),l(o)||(o=e.getContext("webgl",n)||e.getContext("experimental-webgl",n)||void 0),!l(o))throw new fe("The browser supports WebGL, but initialization failed.");this._originalGLContext=o,this._gl=o,this._webgl2=r,this._id=Ln(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new dk(this),this._textureCache=new hk;let a=o;this._stencilBits=a.getParameter(a.STENCIL_BITS),Bt._maximumCombinedTextureImageUnits=a.getParameter(a.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Bt._maximumCubeMapSize=a.getParameter(a.MAX_CUBE_MAP_TEXTURE_SIZE),Bt._maximumFragmentUniformVectors=a.getParameter(a.MAX_FRAGMENT_UNIFORM_VECTORS),Bt._maximumTextureImageUnits=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),Bt._maximumRenderbufferSize=a.getParameter(a.MAX_RENDERBUFFER_SIZE),Bt._maximumTextureSize=a.getParameter(a.MAX_TEXTURE_SIZE),Bt._maximumVaryingVectors=a.getParameter(a.MAX_VARYING_VECTORS),Bt._maximumVertexAttributes=a.getParameter(a.MAX_VERTEX_ATTRIBS),Bt._maximumVertexTextureImageUnits=a.getParameter(a.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Bt._maximumVertexUniformVectors=a.getParameter(a.MAX_VERTEX_UNIFORM_VECTORS),Bt._maximumSamples=this._webgl2?a.getParameter(a.MAX_SAMPLES):0;let c=a.getParameter(a.ALIASED_LINE_WIDTH_RANGE);Bt._minimumAliasedLineWidth=c[0],Bt._maximumAliasedLineWidth=c[1];let u=a.getParameter(a.ALIASED_POINT_SIZE_RANGE);Bt._minimumAliasedPointSize=u[0],Bt._maximumAliasedPointSize=u[1];let f=a.getParameter(a.MAX_VIEWPORT_DIMS);Bt._maximumViewportWidth=f[0],Bt._maximumViewportHeight=f[1];let d=a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT);Bt._highpFloatSupported=d.precision!==0;let p=a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_INT);Bt._highpIntSupported=p.rangeMax!==0,this._antialias=a.getContextAttributes().antialias,this._standardDerivatives=!!Vo(a,["OES_standard_derivatives"]),this._blendMinmax=!!Vo(a,["EXT_blend_minmax"]),this._elementIndexUint=!!Vo(a,["OES_element_index_uint"]),this._depthTexture=!!Vo(a,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Vo(a,["EXT_frag_depth"]),this._debugShaders=Vo(a,["WEBGL_debug_shaders"]),this._textureFloat=!!Vo(a,["OES_texture_float"]),this._textureHalfFloat=!!Vo(a,["OES_texture_half_float"]),this._textureFloatLinear=!!Vo(a,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Vo(a,["OES_texture_half_float_linear"]),this._colorBufferFloat=!!Vo(a,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Vo(a,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Vo(a,["EXT_color_buffer_half_float"]),this._s3tc=!!Vo(a,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Vo(a,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Vo(a,["WEBGL_compressed_texture_astc"]),this._etc=!!Vo(a,["WEBG_compressed_texture_etc"]),this._etc1=!!Vo(a,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Vo(a,["EXT_texture_compression_bptc"]),Ua.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let g=t.allowTextureFilterAnisotropic?Vo(a,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=g,Bt._maximumTextureFilterAnisotropy=l(g)?a.getParameter(g.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let m,x,C,A,b,T,S,w,D,I;if(r){let _=this;m=function(){return _._gl.createVertexArray()},x=function(E){_._gl.bindVertexArray(E)},C=function(E){_._gl.deleteVertexArray(E)},A=function(E,v,P,R,F){a.drawElementsInstanced(E,v,P,R,F)},b=function(E,v,P,R){a.drawArraysInstanced(E,v,P,R)},T=function(E,v){a.vertexAttribDivisor(E,v)},S=function(E){a.drawBuffers(E)}}else w=Vo(a,["OES_vertex_array_object"]),l(w)&&(m=function(){return w.createVertexArrayOES()},x=function(_){w.bindVertexArrayOES(_)},C=function(_){w.deleteVertexArrayOES(_)}),D=Vo(a,["ANGLE_instanced_arrays"]),l(D)&&(A=function(_,E,v,P,R){D.drawElementsInstancedANGLE(_,E,v,P,R)},b=function(_,E,v,P){D.drawArraysInstancedANGLE(_,E,v,P)},T=function(_,E){D.vertexAttribDivisorANGLE(_,E)}),I=Vo(a,["WEBGL_draw_buffers"]),l(I)&&(S=function(_){I.drawBuffersWEBGL(_)});this.glCreateVertexArray=m,this.glBindVertexArray=x,this.glDeleteVertexArray=C,this.glDrawElementsInstanced=A,this.glDrawArraysInstanced=b,this.glVertexAttribDivisor=T,this.glDrawBuffers=S,this._vertexArrayObject=!!w,this._instancedArrays=!!D,this._drawBuffers=!!I,Bt._maximumDrawBuffers=this.drawBuffers?a.getParameter(Z.MAX_DRAW_BUFFERS):1,Bt._maximumColorAttachments=this.drawBuffers?a.getParameter(Z.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new z(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let O=new mk,B=new Hc(this),L=Ve.fromCache();this._defaultPassState=B,this._defaultRenderState=L,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=O,this._currentRenderState=L,this._currentPassState=B,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let _=0;_<Bt._maximumVertexAttributes;_++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options=t,this.cache={},Ve.apply(a,L,B)}var Hst={};Object.defineProperties(Rf.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},textureCache:{get:function(){return this._textureCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=zst(this._originalGLContext,e?kst:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new wt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new wt({context:this,pixelFormat:ct.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new wt({context:this,pixelFormat:ct.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new Sc({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return Hst}}});function T_e(e,t,n,i){let r=e._currentRenderState,o=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ve.partialApply(e._gl,r,t,o,n,i)}var _q;typeof WebGLRenderingContext<"u"&&(_q=[Z.BACK]);function gq(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=_q;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var Gst=new li;Rf.prototype.clear=function(e,t){e=y(e,Gst),t=y(t,this._defaultPassState);let n=this._gl,i=0,r=e.color,o=e.depth,s=e.stencil;l(r)&&(z.equals(this._clearColor,r)||(z.clone(r,this._clearColor),n.clearColor(r.red,r.green,r.blue,r.alpha)),i|=n.COLOR_BUFFER_BIT),l(o)&&(o!==this._clearDepth&&(this._clearDepth=o,n.clearDepth(o)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=y(e.renderState,this._defaultRenderState);T_e(this,a,t,!0);let c=y(e.framebuffer,t.framebuffer);gq(this,c),n.clear(i)};function Wst(e,t,n,i,r){gq(e,t),T_e(e,r,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function jst(e,t,n,i){let r=t._primitiveType,o=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=y(t._modelMatrix,N.IDENTITY),n._setUniforms(i,e._us,e.validateShaderProgram),o._bind();let u=o.indexBuffer;l(u)?(s=s*u.bytesPerIndex,a=y(a,u.numberOfIndices),c===0?e._gl.drawElements(r,a,u.indexDatatype,s):e.glDrawElementsInstanced(r,a,u.indexDatatype,s,c)):(a=y(a,o.numberOfVertices),c===0?e._gl.drawArrays(r,s,a):e.glDrawArraysInstanced(r,s,a,c)),o._unBind()}Rf.prototype.draw=function(e,t,n,i){t=y(t,this._defaultPassState);let r=y(e._framebuffer,t.framebuffer),o=y(e._renderState,this._defaultRenderState);n=y(n,e._shaderProgram),i=y(i,e._uniformMap),Wst(this,r,t,n,o),jst(this,e,n,i)};Rf.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=_q;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i<n;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)};Rf.prototype.readPixels=function(e){let t=this._gl;e=y(e,y.EMPTY_OBJECT);let n=Math.max(y(e.x,0),0),i=Math.max(y(e.y,0),0),r=y(e.width,t.drawingBufferWidth),o=y(e.height,t.drawingBufferHeight),s=e.framebuffer,a=qe.UNSIGNED_BYTE;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype);let c=ct.createTypedArray(ct.RGBA,a,r,o);return gq(this,s),t.readPixels(n,i,r,o,ct.RGBA,qe.toWebGLConstant(a,this),c),c};var b_e={position:0,textureCoordinates:1};Rf.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new ot({attributes:{position:new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Me.TRIANGLES});e=Qn.fromGeometry({context:this,geometry:t,attributeLocations:b_e,bufferUsage:Ne.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Rf.prototype.createViewportQuadCommand=function(e,t){return t=y(t,y.EMPTY_OBJECT),new Ze({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Me.TRIANGLES,renderState:t.renderState,shaderProgram:Wt.fromCache({context:this,vertexShaderSource:_E,fragmentShaderSource:e,attributeLocations:b_e}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Rf.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function yq(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(yq.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});yq.prototype.destroy=function(){delete this._pickObjects[this.key]};Rf.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new fe("Out of unique Pick IDs.");return this._pickObjects[t]=e,new yq(this._pickObjects,t,z.fromRgba(t))};Rf.prototype.isDestroyed=function(){return!1};Rf.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),ue(this)};var pk=Rf;function qst(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},r=[De.createIfNeeded(t.positiveX).fetchImage(i),De.createIfNeeded(t.negativeX).fetchImage(i),De.createIfNeeded(t.positiveY).fetchImage(i),De.createIfNeeded(t.negativeY).fetchImage(i),De.createIfNeeded(t.positiveZ).fetchImage(i),De.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(r).then(function(o){return new Sc({context:e,source:{positiveX:o[0],negativeX:o[1],positiveY:o[2],negativeY:o[3],positiveZ:o[4],negativeZ:o[5]}})})}var _k=qst;function xq(e){e=y(e,y.EMPTY_OBJECT),this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=De.createIfNeeded(e.missingImageUrl),n=this;function i(o){l(o.blob)&&(n._missingImageByteLength=o.blob.size);let s=ch(o);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=o.width,u=e.pixelsToCheck;for(let f=0,d=u.length;a&&f<d;++f){let p=u[f],g=p.x*4+p.y*c;s[g+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function r(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(r)}xq.prototype.isReady=function(){return this._isReady};xq.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=ch(e),r=e.width;for(let o=0,s=t.length;o<s;++o){let a=t[o],c=a.x*4+a.y*r;for(let u=0;u<4;++u){let f=c+u;if(i[f]!==n[f])return!1}}return!0};var gk=xq;function Cq(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}Cq.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let r=i.toLowerCase();t>1&&r==="name"?(t=1,n=i):t>2&&r==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};Cq.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let r in n)if(n.hasOwnProperty(r)){let o=n[r];l(o)&&(typeof o=="object"?i+=`<tr><td>${r}</td><td>${t(o)}</td></tr>`:i+=`<tr><td>${r}</td><td>${o}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var Tm=Cq;function yE(){this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,ye.throwInstantiationError()}Object.defineProperties(yE.prototype,{ready:{get:ye.throwInstantiationError},readyPromise:{get:ye.throwInstantiationError},rectangle:{get:ye.throwInstantiationError},tileWidth:{get:ye.throwInstantiationError},tileHeight:{get:ye.throwInstantiationError},maximumLevel:{get:ye.throwInstantiationError},minimumLevel:{get:ye.throwInstantiationError},tilingScheme:{get:ye.throwInstantiationError},tileDiscardPolicy:{get:ye.throwInstantiationError},errorEvent:{get:ye.throwInstantiationError},credit:{get:ye.throwInstantiationError},proxy:{get:ye.throwInstantiationError},hasAlphaChannel:{get:ye.throwInstantiationError}});yE.prototype.getTileCredits=function(e,t,n){ye.throwInstantiationError()};yE.prototype.requestImage=function(e,t,n,i){ye.throwInstantiationError()};yE.prototype.pickFeatures=function(e,t,n,i,r){ye.throwInstantiationError()};var Yst=/\.ktx2$/i;yE.loadImage=function(e,t){let n=De.createIfNeeded(t);return Yst.test(n.url)?Ua(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Il=yE;function ZD(e){e=y(e,y.EMPTY_OBJECT),this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0;let t=De.createIfNeeded(e.url);t.appendForwardSlash(),l(e.token)&&t.setQueryParameters({token:e.token}),this._resource=t,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new Qi({ellipsoid:e.ellipsoid})),this._useTiles=y(e.usePreCachedTilesIfAvailable,!0),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._layers=e.layers;let n=e.credit;typeof n=="string"&&(n=new Gt(n)),this._credit=n,this.enablePickFeatures=y(e.enablePickFeatures,!0),this._errorEvent=new ge,this._ready=!1;let i=this,r;function o(c){let u=c.tileInfo;if(!l(u))i._useTiles=!1;else{if(i._tileWidth=u.rows,i._tileHeight=u.cols,u.spatialReference.wkid===102100||u.spatialReference.wkid===102113)i._tilingScheme=new is({ellipsoid:e.ellipsoid});else if(c.tileInfo.spatialReference.wkid===4326)i._tilingScheme=new Qi({ellipsoid:e.ellipsoid});else{let f=`Tile spatial reference WKID ${c.tileInfo.spatialReference.wkid} is not supported.`;return r=jn.reportError(r,i,i._errorEvent,f,void 0,void 0,void 0),r.retry?a():Promise.reject(new fe(f))}if(i._maximumLevel=c.tileInfo.lods.length-1,l(c.fullExtent)){if(l(c.fullExtent.spatialReference)&&l(c.fullExtent.spatialReference.wkid))if(c.fullExtent.spatialReference.wkid===102100||c.fullExtent.spatialReference.wkid===102113){let f=new ji,d=c.fullExtent,p=f.unproject(new h(Math.max(d.xmin,-i._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(d.ymin,-i._tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),g=f.unproject(new h(Math.min(d.xmax,i._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(d.ymax,i._tilingScheme.ellipsoid.maximumRadius*Math.PI),0));i._rectangle=new he(p.longitude,p.latitude,g.longitude,g.latitude)}else if(c.fullExtent.spatialReference.wkid===4326)i._rectangle=he.fromDegrees(c.fullExtent.xmin,c.fullExtent.ymin,c.fullExtent.xmax,c.fullExtent.ymax);else{let f=`fullExtent.spatialReference WKID ${c.fullExtent.spatialReference.wkid} is not supported.`;return r=jn.reportError(r,i,i._errorEvent,f,void 0,void 0,void 0),r.retry?a():Promise.reject(new fe(f))}}else i._rectangle=i._tilingScheme.rectangle;l(i._tileDiscardPolicy)||(i._tileDiscardPolicy=new gk({missingImageUrl:E_e(i,0,0,i._maximumLevel).url,pixelsToCheck:[new W(0,0),new W(200,20),new W(20,200),new W(80,110),new W(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),i._useTiles=!0}return l(c.copyrightText)&&c.copyrightText.length>0&&(i._credit=new Gt(c.copyrightText)),i._ready=!0,jn.reportSuccess(r),Promise.resolve(!0)}function s(c){let u=`An error occurred while accessing ${i._resource.url}.`;return r=jn.reportError(r,i,i._errorEvent,u,void 0,void 0,void 0),Promise.reject(new fe(u))}function a(){return i._resource.getDerivedResource({queryParameters:{f:"json"}}).fetchJsonp().then(o).catch(s)}this._useTiles?this._readyPromise=a():(this._ready=!0,this._readyPromise=Promise.resolve(!0))}function E_e(e,t,n,i,r){let o;if(e._useTiles)o=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:r});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Ii?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),o=e._resource.getDerivedResource({url:"export",request:r,queryParameters:c})}return o}Object.defineProperties(ZD.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}});ZD.prototype.getTileCredits=function(e,t,n){};ZD.prototype.requestImage=function(e,t,n,i){return Il.loadImage(this,E_e(this,e,t,n,i))};ZD.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures)return;let o=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof Ii)s=M.toDegrees(i),a=M.toDegrees(r),c="4326";else{let p=this._tilingScheme.projection.project(new me(i,r,0));s=p.x,a=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${o.west},${o.south},${o.east},${o.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let g=[],m=p.results;if(!l(m))return g;for(let x=0;x<m.length;++x){let C=m[x],A=new Tm;if(A.data=C,A.name=C.value,A.properties=C.attributes,A.configureDescriptionFromProperties(C.attributes),C.geometryType==="esriGeometryPoint"&&C.geometry){let b=C.geometry.spatialReference&&C.geometry.spatialReference.wkid?C.geometry.spatialReference.wkid:4326;if(b===4326||b===4283)A.position=me.fromDegrees(C.geometry.x,C.geometry.y,C.geometry.z);else if(b===102100||b===900913||b===3857){let T=new ji;A.position=T.unproject(new h(C.geometry.x,C.geometry.y,C.geometry.z))}}g.push(A)}return g})};var O0=ZD;function oC(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new pi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new W,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(oC.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(!!l(e))return e[e.length-1].getColorTexture(0)}}});function S_e(e){let t=e._framebuffers;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function Xst(e,t){S_e(e);let n=e._width,i=e._height,r=t.halfFloatingPointTexture?qe.HALF_FLOAT:qe.FLOAT,o=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(o);for(let c=0;c<o;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new pi,s[c].update(t,n,i,1,r);let a=s[o-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,r),e._framebuffers=s}function w_e(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function Kst(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function $st(e,t){let n=`uniform sampler2D colorTexture;
- varying vec2 v_textureCoordinates;
- float sampleTexture(vec2 offset) {
- `;return e===0?n+=` vec4 color = texture2D(colorTexture, v_textureCoordinates + offset);
- return czm_luminance(color.rgb);
- `:n+=` return texture2D(colorTexture, v_textureCoordinates + offset).r;
- `,n+=`}
- `,n+=`uniform vec2 colorTextureDimensions;
- uniform vec2 minMaxLuminance;
- uniform sampler2D previousLuminance;
- void main() {
- float color = 0.0;
- float xStep = 1.0 / colorTextureDimensions.x;
- float yStep = 1.0 / colorTextureDimensions.y;
- int count = 0;
- for (int i = 0; i < 3; ++i) {
- for (int j = 0; j < 3; ++j) {
- vec2 offset;
- offset.x = -xStep + float(i) * xStep;
- offset.y = -yStep + float(j) * yStep;
- if (offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0) {
- continue;
- }
- color += sampleTexture(offset);
- ++count;
- }
- }
- if (count > 0) {
- color /= float(count);
- }
- `,e===t-1&&(n+=` float previous = texture2D(previousLuminance, vec2(0.5)).r;
- color = clamp(color, minMaxLuminance.x, minMaxLuminance.y);
- color = previous + (color - previous) / (60.0 * 1.5);
- color = clamp(color, minMaxLuminance.x, minMaxLuminance.y);
- `),n+=` gl_FragColor = vec4(color);
- }
- `,n}function Zst(e,t){w_e(e);let n=e._framebuffers,i=n.length,r=new Array(i);for(let o=0;o<i;++o)r[o]=t.createViewportQuadCommand($st(o,i),{framebuffer:n[o].framebuffer,uniformMap:Kst(e,o)});e._commands=r}oC.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new li({color:new z(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let r=0;r<i;++r)t[r].clear(e,n)};oC.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,Xst(this,e),Zst(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,r=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=r};oC.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r)n[r].execute(e)};oC.prototype.isDestroyed=function(){return!1};oC.prototype.destroy=function(){return S_e(this),w_e(this),ue(this)};var yk=oC;var Jst={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"},xk=Object.freeze(Jst);function JD(e){}JD.prototype.isReady=function(){return!0};JD.prototype.shouldDiscardImage=function(e){return JD.EMPTY_IMAGE===e};var Ck;Object.defineProperties(JD,{EMPTY_IMAGE:{get:function(){return l(Ck)||(Ck=new Image,Ck.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),Ck}}});var QD=JD;function ia(e){e=y(e,y.EMPTY_OBJECT);let t=e.key;this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=1,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,this._key=t,this._resource=De.createIfNeeded(e.url),this._resource.appendForwardSlash(),this._tileProtocol=e.tileProtocol,this._mapStyle=y(e.mapStyle,xk.AERIAL),this._culture=y(e.culture,""),this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new QD),this._proxy=e.proxy,this._credit=new Gt(`<a href="http://www.bing.com"><img src="${ia.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new is({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._errorEvent=new ge,this._ready=!1;let n=this._tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=this._resource.getDerivedResource({url:`REST/v1/Imagery/Metadata/${this._mapStyle}`,queryParameters:{incl:"ImageryProviders",key:this._key,uriScheme:n}}),r=this,o;function s(d){if(d.resourceSets.length!==1)return a();let p=d.resourceSets[0].resources[0];r._tileWidth=p.imageWidth,r._tileHeight=p.imageHeight,r._maximumLevel=p.zoomMax-1,r._imageUrlSubdomains=p.imageUrlSubdomains,r._imageUrlTemplate=p.imageUrl;let g=r._attributionList=p.imageryProviders;g||(g=r._attributionList=[]);for(let m=0,x=g.length;m<x;++m){let C=g[m];if(C.credit instanceof Gt)break;C.credit=new Gt(C.attribution);let A=C.coverageAreas;for(let b=0,T=C.coverageAreas.length;b<T;++b){let S=A[b],w=S.bbox;S.bbox=new he(M.toRadians(w[1]),M.toRadians(w[0]),M.toRadians(w[3]),M.toRadians(w[2]))}}return r._ready=!0,jn.reportSuccess(o),Promise.resolve(!0)}function a(d){let p=`An error occurred while accessing ${i.url}.`;return o=jn.reportError(o,r,r._errorEvent,p,void 0,void 0,void 0),o.retry?u():Promise.reject(new fe(p))}let c=i.url;function u(){let d=i.fetchJsonp("jsonp");return ia._metadataCache[c]=d,d.then(s).catch(a)}let f=ia._metadataCache[c];l(f)?this._readyPromise=f.then(s).catch(a):this._readyPromise=u()}Object.defineProperties(ia.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});var Qst=new he;ia.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,Qst);return nat(this._attributionList,n,i)};ia.prototype.requestImage=function(e,t,n,i){let r=Il.loadImage(this,eat(this,e,t,n,i));if(l(r))return r.catch(function(o){return l(o.blob)&&o.blob.size===0?QD.EMPTY_IMAGE:Promise.reject(o)})};ia.prototype.pickFeatures=function(e,t,n,i,r){};ia.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;(e&o)!==0&&(s|=1),(t&o)!==0&&(s|=2),i+=s}return i};ia.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let r=i;r>=0;--r){let o=1<<r,s=+e[i-r];(s&1)!==0&&(t|=o),(s&2)!==0&&(n|=o)}return{x:t,y:n,level:i}};ia._logoUrl=void 0;Object.defineProperties(ia,{logoUrl:{get:function(){return l(ia._logoUrl)||(ia._logoUrl=Qt("Assets/Images/bing_maps_credit.png")),ia._logoUrl},set:function(e){ia._logoUrl=e}}});function eat(e,t,n,i,r){let o=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:o,request:r,templateValues:{quadkey:ia.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var tat=new he;function nat(e,t,n){++t;let i=[];for(let r=0,o=e.length;r<o;++r){let s=e[r],a=s.coverageAreas,c=!1;for(let u=0,f=s.coverageAreas.length;!c&&u<f;++u){let d=a[u];if(t>=d.zoomMin&&t<=d.zoomMax){let p=he.intersection(n,d.bbox,tat);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}ia._metadataCache={};var Ak=ia;var iat=new h(1,1,1);function Aq(e){e=y(e,iat),this._dimensions=h.clone(e)}Object.defineProperties(Aq.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var rat=new h;Aq.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,rat),i=M.randomBetween(-n.x,n.x),r=M.randomBetween(-n.y,n.y),o=M.randomBetween(-n.z,n.z);e.position=h.fromElements(i,r,o,e.position),e.velocity=h.normalize(e.position,e.velocity)};var v_e=Aq;var Tk=`varying vec2 v_textureCoordinates;
- const float M_PI = 3.141592653589793;
- float vdcRadicalInverse(int i)
- {
- float r;
- float base = 2.0;
- float value = 0.0;
- float invBase = 1.0 / base;
- float invBi = invBase;
- for (int x = 0; x < 100; x++)
- {
- if (i <= 0)
- {
- break;
- }
- r = mod(float(i), base);
- value += r * invBi;
- invBi *= invBase;
- i = int(float(i) * invBase);
- }
- return value;
- }
- vec2 hammersley2D(int i, int N)
- {
- return vec2(float(i) / float(N), vdcRadicalInverse(i));
- }
- vec3 importanceSampleGGX(vec2 xi, float roughness, vec3 N)
- {
- float a = roughness * roughness;
- float phi = 2.0 * M_PI * xi.x;
- float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y));
- float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
- vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);
- vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
- vec3 tangentX = normalize(cross(upVector, N));
- vec3 tangentY = cross(N, tangentX);
- return tangentX * H.x + tangentY * H.y + N * H.z;
- }
- float G1_Smith(float NdotV, float k)
- {
- return NdotV / (NdotV * (1.0 - k) + k);
- }
- float G_Smith(float roughness, float NdotV, float NdotL)
- {
- float k = roughness * roughness / 2.0;
- return G1_Smith(NdotV, k) * G1_Smith(NdotL, k);
- }
- vec2 integrateBrdf(float roughness, float NdotV)
- {
- vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV);
- float A = 0.0;
- float B = 0.0;
- const int NumSamples = 1024;
- for (int i = 0; i < NumSamples; i++)
- {
- vec2 xi = hammersley2D(i, NumSamples);
- vec3 H = importanceSampleGGX(xi, roughness, vec3(0.0, 0.0, 1.0));
- vec3 L = 2.0 * dot(V, H) * H - V;
- float NdotL = clamp(L.z, 0.0, 1.0);
- float NdotH = clamp(H.z, 0.0, 1.0);
- float VdotH = clamp(dot(V, H), 0.0, 1.0);
- if (NdotL > 0.0)
- {
- float G = G_Smith(roughness, NdotV, NdotL);
- float G_Vis = G * VdotH / (NdotH * NdotV);
- float Fc = pow(1.0 - VdotH, 5.0);
- A += (1.0 - Fc) * G_Vis;
- B += Fc * G_Vis;
- }
- }
- return vec2(A, B) / float(NumSamples);
- }
- void main()
- {
- gl_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0);
- }
- `;function e1(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(e1.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function oat(e,t,n){let i=t.createViewportQuadCommand(Tk,{framebuffer:n,renderState:Ve.fromCache({viewport:new je(0,0,256,256)})});e._drawCommand=i}e1.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new wt({context:t,width:256,height:256,pixelFormat:ct.RGBA,pixelDatatype:qe.UNSIGNED_BYTE,sampler:on.NEAREST});this._colorTexture=n;let i=new ya({context:t,colorTextures:[n],destroyAttachments:!1});oat(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};e1.prototype.isDestroyed=function(){return!1};e1.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ue(this)};var bk=e1;var O_e={};function sat(e,t,n){let i,r,o;if(e instanceof bi){let s=Math.tan(.5*e.fovy);return i=e.near,r=e.near*s,o=e.aspectRatio*r,Math.max(t*i/o,n*i/r)}else if(e instanceof cl)return i=e.near,r=e.top,o=e.right,Math.max(t*i/o,n*i/r);return Math.max(t,n)}var aat=new h,D_e=new h;function R_e(e,t,n,i){if(l(i)&&n(.5)>i){let r=n(0),o=n(1),s=n(.5),a=s-r,c=s-o;return function(u){let f=n(u);if(u<=.5){let p=(f-r)/a;return M.lerp(e,-M.PI_OVER_TWO,p)}let d=(f-o)/c;return M.lerp(-M.PI_OVER_TWO,t,1-d)}}return function(r){return M.lerp(e,t,r)}}function bq(e,t,n,i,r){let o=r,s=Math.max(n,i);if(!l(o)){let a=e.position,c=t,u=e.up,f=e.right,d=e.frustum,p=h.subtract(a,c,aat),g=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),D_e)),m=h.magnitude(h.multiplyByScalar(f,h.dot(p,f),D_e));o=Math.min(sat(d,g,m)*.2,1e9)}if(s<o){let u=-Math.pow((o-n)*1e6,.125),f=Math.pow((o-i)*1e6,1/8);return function(d){let p=d*(f-u)+u;return-Math.pow(p,8)/1e6+o}}return function(a){return M.lerp(n,i,a)}}function t1(e,t){return M.equalsEpsilon(e,M.TWO_PI,M.EPSILON11)&&(e=0),t>e+Math.PI?e+=M.TWO_PI:t<e-Math.PI&&(e-=M.TWO_PI),e}var M_e=new h;function cat(e,t,n,i,r,o,s,a){let c=e.camera,u=h.clone(c.position,M_e),f=c.pitch,d=t1(c.heading,i),p=t1(c.roll,o),g=bq(c,n,u.z,n.z,s),m=R_e(f,r,g,a);function x(C){let A=C.time/t;c.setView({orientation:{heading:M.lerp(d,i,A),pitch:m(A),roll:M.lerp(p,o,A)}}),W.lerp(u,n,A,c.position),c.position.z=g(A)}return x}function lat(e,t){e.longitude<t.longitude?e.longitude+=M.TWO_PI:t.longitude+=M.TWO_PI}function uat(e,t){let n=e.longitude-t.longitude;n<-M.PI?e.longitude+=M.TWO_PI:n>M.PI&&(t.longitude+=M.TWO_PI)}var fat=new me,dat=new me;function hat(e,t,n,i,r,o,s,a,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=me.clone(f.positionCartographic,fat),m=f.pitch,x=t1(f.heading,i),C=t1(f.roll,o),A=p.cartesianToCartographic(n,dat);g.longitude=M.zeroToTwoPi(g.longitude),A.longitude=M.zeroToTwoPi(A.longitude);let b=!1;if(l(a)){let D=M.zeroToTwoPi(a),I=Math.min(g.longitude,A.longitude),O=Math.max(g.longitude,A.longitude),B=D>=I&&D<=O;if(l(c)){let L=Math.abs(g.longitude-A.longitude),_=M.TWO_PI-L;(B?L:_)<(B?_:L)*c&&!B&&(b=!0)}else B||(b=!0)}b?lat(g,A):uat(g,A);let T=bq(f,n,g.height,A.height,s),S=R_e(m,r,T,u);function w(){let D=g.longitude,I=A.longitude,O=g.latitude,B=A.latitude;return function(_){let E=_.time/t,v=h.fromRadians(M.lerp(D,I,E),M.lerp(O,B,E),T(E),p);f.setView({destination:v,orientation:{heading:M.lerp(x,i,E),pitch:S(E),roll:M.lerp(C,o,E)}})}}return w()}function mat(e,t,n,i,r,o,s){let a=e.camera,c=h.clone(a.position,M_e),u=t1(a.heading,i),f=a.frustum.right-a.frustum.left,d=bq(a,n,f,n.z,s);function p(g){let m=g.time/t;a.setView({orientation:{heading:M.lerp(u,i,m)}}),W.lerp(c,n,m,a.position);let x=d(m),C=a.frustum,A=C.top/C.right,b=(x-(C.right-C.left))*.5;C.right+=b,C.left-=b,C.top=A*C.right,C.bottom=-C.top}return p}var P_e=new me,pat=new h;function Tq(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function I_e(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}O_e.createTween=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.destination,i=e.mode;if(i===te.MORPHING)return Tq();let r=y(t.convert,!0),o=e.mapProjection,s=o.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,d=t.easingFunction;r&&i!==te.SCENE3D&&(s.cartesianToCartographic(n,P_e),n=o.project(P_e,pat));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let m=t.duration;l(m)||(m=Math.ceil(h.distance(p.position,n)/1e6)+2,m=Math.min(m,3));let x=y(t.heading,0),C=y(t.pitch,-M.PI_OVER_TWO),A=y(t.roll,0),b=e.screenSpaceCameraController;b.enableInputs=!1;let T=I_e(b,t.complete),S=I_e(b,t.cancel),w=p.frustum,D=e.mode===te.SCENE2D;if(D=D&&W.equalsEpsilon(p.position,n,M.EPSILON6),D=D&&M.equalsEpsilon(Math.max(w.right-w.left,w.top-w.bottom),n.z,M.EPSILON6),D=D||e.mode!==te.SCENE2D&&h.equalsEpsilon(n,p.position,M.EPSILON10),D=D&&M.equalsEpsilon(M.negativePiToPi(x),M.negativePiToPi(p.heading),M.EPSILON10)&&M.equalsEpsilon(M.negativePiToPi(C),M.negativePiToPi(p.pitch),M.EPSILON10)&&M.equalsEpsilon(M.negativePiToPi(A),M.negativePiToPi(p.roll),M.EPSILON10),D)return Tq(T,S);let I=new Array(4);if(I[te.SCENE2D]=mat,I[te.SCENE3D]=hat,I[te.COLUMBUS_VIEW]=cat,m<=0)return Tq(function(){I[i](e,1,n,x,C,A,a,c,u,f)({time:1}),typeof T=="function"&&T()},S);let O=I[i](e,m,n,x,C,A,a,c,u,f);if(!l(d)){let B=p.positionCartographic.height,L=i===te.SCENE3D?s.cartesianToCartographic(n).height:n.z;B>L&&B>11500?d=qo.CUBIC_OUT:d=qo.QUINTIC_IN_OUT}return{duration:m,easingFunction:d,startObject:{time:0},stopObject:{time:m},update:O,complete:T,cancel:S}};var Ek=O_e;var _at={ROTATE:0,INFINITE_SCROLL:1},bu=Object.freeze(_at);function Xt(e){this._scene=e,this._transform=N.clone(N.IDENTITY),this._invTransform=N.clone(N.IDENTITY),this._actualTransform=N.clone(N.IDENTITY),this._actualInvTransform=N.clone(N.IDENTITY),this._transformChanged=!1,this.position=new h,this._position=new h,this._positionWC=new h,this._positionCartographic=new me,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new h,this._direction=new h,this._directionWC=new h,this.up=new h,this._up=new h,this._upWC=new h,this.right=new h,this._right=new h,this._rightWC=new h,this.frustum=new bi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=M.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new ge,this._moveEnd=new ge,this._changed=new ge,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this.percentageChanged=.5,this._viewMatrix=new N,this._invViewMatrix=new N,z_e(this),this._mode=te.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new me(Math.PI,M.PI_OVER_TWO)),this._max2Dfrustum=void 0,Q_e(this,Xt.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=h.magnitude(this.position);n+=n*Xt.DEFAULT_VIEW_FACTOR,h.normalize(this.position,this.position),h.multiplyByScalar(this.position,n,this.position)}Xt.TRANSFORM_2D=new N(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);Xt.TRANSFORM_2D_INVERSE=N.inverseTransformation(Xt.TRANSFORM_2D,new N);Xt.DEFAULT_VIEW_RECTANGLE=he.fromDegrees(-95,-20,-70,90);Xt.DEFAULT_VIEW_FACTOR=.5;Xt.DEFAULT_OFFSET=new ju(0,-M.PI_OVER_FOUR,0);function z_e(e){N.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),N.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),N.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function gat(e){if(!l(e._oldPositionWC))e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=h.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=h.magnitude(t),e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Bi()):e.timeSinceMoved=Math.max(Bi()-e._lastMovedTimestamp,0)/1e3}}Xt.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==te.SCENE2D};Xt.prototype._updateCameraChanged=function(){let e=this;if(gat(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%M.TWO_PI;i=i>M.PI?M.TWO_PI-i:i;let r=i/Math.PI;if(r>t&&(e._changed.raiseEvent(r),e._changedHeading=n),e._mode===te.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let u=e.position,f=e._changedPosition,d=e.frustum,p=e._changedFrustum,g=u.x+d.left,m=u.x+d.right,x=f.x+p.left,C=f.x+p.right,A=u.y+d.bottom,b=u.y+d.top,T=f.y+p.bottom,S=f.y+p.top,w=Math.max(g,x),D=Math.min(m,C),I=Math.max(A,T),O=Math.min(b,S),B;if(w>=D||I>=b)B=1;else{let L=p;g<x&&m>C&&A<T&&b>S&&(L=d),B=1-(D-w)*(O-I)/((L.right-L.left)*(L.top-L.bottom))}B>t&&(e._changed.raiseEvent(B),e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection);return}let o=M.acosClamped(h.dot(e.directionWC,e._changedDirection)),s;l(e.frustum.fovy)?s=o/(e.frustum.fovy*.5):s=o;let c=h.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(s>t||c>t)&&(e._changed.raiseEvent(Math.max(s,c)),e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection))};function yat(e){yt.basisTo2D(e._projection,e._transform,e._actualTransform)}var xat=new me,Cat=new h,Sk=new h,Aat=new se,Tat=new se,bat=new se,Eat=new se,Sat=new se;function wat(e){let t=e._projection,n=t.ellipsoid,i=N.getColumn(e._transform,3,Aat),r=n.cartesianToCartographic(i,xat),o=t.project(r,Cat),s=Tat;s.x=o.z,s.y=o.x,s.z=o.y,s.w=1;let a=se.clone(se.UNIT_X,Sat),c=se.add(N.getColumn(e._transform,0,Sk),i,Sk);n.cartesianToCartographic(c,r),t.project(r,o);let u=bat;u.x=o.z,u.y=o.x,u.z=o.y,u.w=0,h.subtract(u,s,u),u.x=0;let f=Eat;if(h.magnitudeSquared(u)>M.EPSILON10)h.cross(a,u,f);else{let d=se.add(N.getColumn(e._transform,1,Sk),i,Sk);n.cartesianToCartographic(d,r),t.project(r,o),f.x=o.z,f.y=o.x,f.z=o.y,f.w=0,h.subtract(f,s,f),f.x=0,h.magnitudeSquared(f)<M.EPSILON10&&(se.clone(se.UNIT_Y,u),se.clone(se.UNIT_Z,f))}h.cross(f,a,u),h.normalize(u,u),h.cross(a,u,f),h.normalize(f,f),N.setColumn(e._actualTransform,0,u,e._actualTransform),N.setColumn(e._actualTransform,1,f,e._actualTransform),N.setColumn(e._actualTransform,2,a,e._actualTransform),N.setColumn(e._actualTransform,3,s,e._actualTransform)}var Eq=new h;function ic(e){let t=e._mode,n=!1,i=0;t===te.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let r=e._position,o=!h.equals(r,e.position)||n;o&&(r=h.clone(e.position,e._position));let s=e._direction,a=!h.equals(s,e.direction);a&&(h.normalize(e.direction,e.direction),s=h.clone(e.direction,e._direction));let c=e._up,u=!h.equals(c,e.up);u&&(h.normalize(e.up,e.up),c=h.clone(e.up,e._up));let f=e._right,d=!h.equals(f,e.right);d&&(h.normalize(e.right,e.right),f=h.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(N.inverseTransformation(e._transform,e._invTransform),e._mode===te.COLUMBUS_VIEW||e._mode===te.SCENE2D?N.equals(N.IDENTITY,e._transform)?N.clone(Xt.TRANSFORM_2D,e._actualTransform):e._mode===te.COLUMBUS_VIEW?yat(e):wat(e):N.clone(e._transform,e._actualTransform),N.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(o||p)if(e._positionWC=N.multiplyByPoint(g,r,e._positionWC),t===te.SCENE3D||t===te.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let m=Eq;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===te.SCENE2D&&(m.z=i),e._projection.unproject(m,e._positionCartographic)}if(a||u||d){let m=h.dot(s,h.cross(c,f,Eq));if(Math.abs(1-m)>M.EPSILON2){let x=1/h.magnitudeSquared(c),C=h.dot(c,s)*x,A=h.multiplyByScalar(s,C,Eq);c=h.normalize(h.subtract(c,A,e._up),e._up),h.clone(c,e.up),f=h.cross(s,c,e._right),h.clone(f,e.right)}}(a||p)&&(e._directionWC=N.multiplyByPointAsVector(g,s,e._directionWC),h.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=N.multiplyByPointAsVector(g,c,e._upWC),h.normalize(e._upWC,e._upWC)),(d||p)&&(e._rightWC=N.multiplyByPointAsVector(g,f,e._rightWC),h.normalize(e._rightWC,e._rightWC)),(o||a||u||d||p)&&z_e(e)}function H_e(e,t){let n;return M.equalsEpsilon(Math.abs(e.z),1,M.EPSILON3)?n=Math.atan2(t.y,t.x)-M.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-M.PI_OVER_TWO,M.TWO_PI-M.zeroToTwoPi(n)}function G_e(e){return M.PI_OVER_TWO-M.acosClamped(e.z)}function W_e(e,t,n){let i=0;return M.equalsEpsilon(Math.abs(e.z),1,M.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=M.zeroToTwoPi(i+M.TWO_PI)),i}var Dk=new N,Pk=new N;Object.defineProperties(Xt.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return ic(this),this._invTransform}},viewMatrix:{get:function(){return ic(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return ic(this),this._invViewMatrix}},positionCartographic:{get:function(){return ic(this),this._positionCartographic}},positionWC:{get:function(){return ic(this),this._positionWC}},directionWC:{get:function(){return ic(this),this._directionWC}},upWC:{get:function(){return ic(this),this._upWC}},rightWC:{get:function(){return ic(this),this._rightWC}},heading:{get:function(){if(this._mode!==te.MORPHING){let e=this._projection.ellipsoid,t=N.clone(this._transform,Dk),n=yt.eastNorthUpToFixedFrame(this.positionWC,e,Pk);this._setTransform(n);let i=H_e(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==te.MORPHING){let e=this._projection.ellipsoid,t=N.clone(this._transform,Dk),n=yt.eastNorthUpToFixedFrame(this.positionWC,e,Pk);this._setTransform(n);let i=G_e(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==te.MORPHING){let e=this._projection.ellipsoid,t=N.clone(this._transform,Dk),n=yt.eastNorthUpToFixedFrame(this.positionWC,e,Pk);this._setTransform(n);let i=W_e(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});Xt.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==te.MORPHING,t=this._mode===te.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,r=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=r*n.right,n.bottom=-n.top}this._mode===te.SCENE2D&&X_e(this,this.position)};var vat=new h,Dat=new h,Pat=new h;Xt.prototype._setTransform=function(e){let t=h.clone(this.positionWC,vat),n=h.clone(this.upWC,Dat),i=h.clone(this.directionWC,Pat);N.clone(e,this._transform),this._transformChanged=!0,ic(this);let r=this._actualInvTransform;N.multiplyByPoint(r,t,this.position),N.multiplyByPointAsVector(r,i,this.direction),N.multiplyByPointAsVector(r,n,this.up),h.cross(this.direction,this.up,this.right),ic(this)};var Iat=new W,Oat=new En,Rat=new h,Mat=new h;function j_e(e){if(!N.equals(N.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=Iat;i.x=t.drawingBufferWidth/2,i.y=t.drawingBufferHeight/2;let r;if(l(n)){let a=e.getPickRay(i,Oat);r=n.pickWorldCoordinates(a,t,!0,Rat)}let o;t.pickPositionSupported&&(o=t.pickPositionWorldCoordinates(i,Mat));let s;if(l(r)||l(o)){let a=l(o)?h.distance(o,e.positionWC):Number.POSITIVE_INFINITY,c=l(r)?h.distance(r,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}Xt.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof en&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=j_e(this)))};var Ik=new h,Pq=new N,Bat=new N,Iq=new Re,Oq=new Q,q_e=new me;function Lat(e,t,n){let i=N.clone(e.transform,Pq),r=yt.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Bat);e._setTransform(r),h.clone(h.ZERO,e.position),n.heading=n.heading-M.PI_OVER_TWO;let o=Re.fromHeadingPitchRoll(n,Iq),s=Q.fromQuaternion(o,Oq);Q.getColumn(s,0,e.direction),Q.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function Nat(e,t,n,i){let r=N.clone(e.transform,Pq);if(e._setTransform(N.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,q_e);t=a.project(c,Ik)}h.clone(t,e.position)}n.heading=n.heading-M.PI_OVER_TWO;let o=Re.fromHeadingPitchRoll(n,Iq),s=Q.fromQuaternion(o,Oq);Q.getColumn(s,0,e.direction),Q.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(r),e._adjustOrthographicFrustum(!0)}function Fat(e,t,n,i){let r=N.clone(e.transform,Pq);if(e._setTransform(N.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,q_e);t=c.project(u,Ik)}W.clone(t,e.position);let o=-t.z*.5,s=-o,a=e.frustum;if(s>o){let c=a.top/a.right;a.right=s,a.left=o,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===bu.ROTATE){n.heading=n.heading-M.PI_OVER_TWO,n.pitch=-M.PI_OVER_TWO,n.roll=0;let o=Re.fromHeadingPitchRoll(n,Iq),s=Q.fromQuaternion(o,Oq);Q.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(r)}var Vat=new h,kat=new h,Uat=new h;function Y_e(e,t,n,i){let r=h.clone(n.direction,Vat),o=h.clone(n.up,kat);if(e._scene.mode===te.SCENE3D){let a=e._projection.ellipsoid,c=yt.eastNorthUpToFixedFrame(t,a,Dk),u=N.inverseTransformation(c,Pk);N.multiplyByPointAsVector(u,r,r),N.multiplyByPointAsVector(u,o,o)}let s=h.cross(r,o,Uat);return i.heading=H_e(r,o),i.pitch=G_e(r),i.roll=W_e(r,o,s),i}var Dq={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},xE=new Yf;Xt.prototype.setView=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.orientation,y.EMPTY_OBJECT),n=this._mode;if(n===te.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=y(e.convert,!0),r=y(e.destination,h.clone(this.positionWC,Ik));l(r)&&l(r.west)&&(r=this.getRectangleCameraCoordinates(r,Ik),i=!1),l(t.direction)&&(t=Y_e(this,r,t,Dq.orientation)),xE.heading=y(t.heading,0),xE.pitch=y(t.pitch,-M.PI_OVER_TWO),xE.roll=y(t.roll,0),n===te.SCENE3D?Lat(this,r,xE):n===te.SCENE2D?Fat(this,r,xE,i):Nat(this,r,xE,i)};var zat=new h;Xt.prototype.flyHome=function(e){let t=this._mode;if(t===te.MORPHING&&this._scene.completeMorph(),t===te.SCENE2D)this.flyTo({destination:Xt.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:N.IDENTITY});else if(t===te.SCENE3D){let n=this.getRectangleCameraCoordinates(Xt.DEFAULT_VIEW_RECTANGLE),i=h.magnitude(n);i+=i*Xt.DEFAULT_VIEW_FACTOR,h.normalize(n,n),h.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:N.IDENTITY})}else if(t===te.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new h(0,-1,1);i=h.multiplyByScalar(h.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(h.normalize(i,zat).z),roll:0},endTransform:N.IDENTITY,convert:!1})}};Xt.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new se),ic(this),N.multiplyByVector(this._actualInvTransform,e,t)};Xt.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),ic(this),N.multiplyByPoint(this._actualInvTransform,e,t)};Xt.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),ic(this),N.multiplyByPointAsVector(this._actualInvTransform,e,t)};Xt.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new se),ic(this),N.multiplyByVector(this._actualTransform,e,t)};Xt.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),ic(this),N.multiplyByPoint(this._actualTransform,e,t)};Xt.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),ic(this),N.multiplyByPointAsVector(this._actualTransform,e,t)};function X_e(e,t){let n=e._scene.mapMode2D===bu.ROTATE,i=e._maxCoord.x,r=e._maxCoord.y,o,s;n?(s=i,o=-s):(s=t.x-i*2,o=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=o),t.y>r&&(t.y=r),t.y<-r&&(t.y=-r)}var B_e=new h;Xt.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,B_e),h.add(n,B_e,n),this._mode===te.SCENE2D&&X_e(this,n),this._adjustOrthographicFrustum(!0)};Xt.prototype.moveForward=function(e){e=y(e,this.defaultMoveAmount),this._mode===te.SCENE2D?Ok(this,e):this.move(this.direction,e)};Xt.prototype.moveBackward=function(e){e=y(e,this.defaultMoveAmount),this._mode===te.SCENE2D?Ok(this,-e):this.move(this.direction,-e)};Xt.prototype.moveUp=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,e)};Xt.prototype.moveDown=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,-e)};Xt.prototype.moveRight=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,e)};Xt.prototype.moveLeft=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,-e)};Xt.prototype.lookLeft=function(e){e=y(e,this.defaultLookAmount),this._mode!==te.SCENE2D&&this.look(this.up,-e)};Xt.prototype.lookRight=function(e){e=y(e,this.defaultLookAmount),this._mode!==te.SCENE2D&&this.look(this.up,e)};Xt.prototype.lookUp=function(e){e=y(e,this.defaultLookAmount),this._mode!==te.SCENE2D&&this.look(this.right,-e)};Xt.prototype.lookDown=function(e){e=y(e,this.defaultLookAmount),this._mode!==te.SCENE2D&&this.look(this.right,e)};var Hat=new Re,Gat=new Q;Xt.prototype.look=function(e,t){let n=y(t,this.defaultLookAmount),i=Re.fromAxisAngle(e,-n,Hat),r=Q.fromQuaternion(i,Gat),o=this.direction,s=this.up,a=this.right;Q.multiplyByVector(r,o,o),Q.multiplyByVector(r,s,s),Q.multiplyByVector(r,a,a)};Xt.prototype.twistLeft=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,e)};Xt.prototype.twistRight=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,-e)};var Wat=new Re,jat=new Q;Xt.prototype.rotate=function(e,t){let n=y(t,this.defaultRotateAmount),i=Re.fromAxisAngle(e,-n,Wat),r=Q.fromQuaternion(i,jat);Q.multiplyByVector(r,this.position,this.position),Q.multiplyByVector(r,this.direction,this.direction),Q.multiplyByVector(r,this.up,this.up),h.cross(this.direction,this.up,this.right),h.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};Xt.prototype.rotateDown=function(e){e=y(e,this.defaultRotateAmount),K_e(this,e)};Xt.prototype.rotateUp=function(e){e=y(e,this.defaultRotateAmount),K_e(this,-e)};var qat=new h,Yat=new h,Xat=new h,L_e=new h;function K_e(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,M.EPSILON2)){let i=h.normalize(n,qat),r=h.equalsEpsilon(i,e.constrainedAxis,M.EPSILON2),o=h.equalsEpsilon(i,h.negate(e.constrainedAxis,L_e),M.EPSILON2);if(!r&&!o){let s=h.normalize(e.constrainedAxis,Yat),a=h.dot(i,s),c=M.acosClamped(a);t>0&&t>c&&(t=c-M.EPSILON4),a=h.dot(i,h.negate(s,L_e)),c=M.acosClamped(a),t<0&&-t>c&&(t=-c+M.EPSILON4);let u=h.cross(s,i,Xat);e.rotate(u,t)}else(r&&t<0||o&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}Xt.prototype.rotateRight=function(e){e=y(e,this.defaultRotateAmount),$_e(this,-e)};Xt.prototype.rotateLeft=function(e){e=y(e,this.defaultRotateAmount),$_e(this,e)};function $_e(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function Ok(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let r=n.top-t,o=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===bu.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),r<=o&&(r=1,o=-1),i=n.right/n.top,n.top=r,n.bottom=o,n.right=n.top*i,n.left=-n.right}else{let r=n.right-t,o=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===bu.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),r<=o&&(r=1,o=-1),i=n.top/n.right,n.right=r,n.left=o,n.top=n.right*i,n.bottom=-n.top}}function Z_e(e,t){e.move(e.direction,t)}Xt.prototype.zoomIn=function(e){e=y(e,this.defaultZoomAmount),this._mode===te.SCENE2D?Ok(this,e):Z_e(this,e)};Xt.prototype.zoomOut=function(e){e=y(e,this.defaultZoomAmount),this._mode===te.SCENE2D?Ok(this,-e):Z_e(this,-e)};Xt.prototype.getMagnitude=function(){if(this._mode===te.SCENE3D)return h.magnitude(this.position);if(this._mode===te.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===te.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var Kat=new N;Xt.prototype.lookAt=function(e,t){let n=yt.eastNorthUpToFixedFrame(e,oe.WGS84,Kat);this.lookAtTransform(n,t)};var $at=new h,Zat=new Re,Jat=new Re,Qat=new Q;function J_e(e,t,n){t=M.clamp(t,-M.PI_OVER_TWO,M.PI_OVER_TWO),e=M.zeroToTwoPi(e)-M.PI_OVER_TWO;let i=Re.fromAxisAngle(h.UNIT_Y,-t,Zat),r=Re.fromAxisAngle(h.UNIT_Z,-e,Jat),o=Re.multiply(r,i,r),s=Q.fromQuaternion(o,Qat),a=h.clone(h.UNIT_X,$at);return Q.multiplyByVector(s,a,a),h.negate(a,a),h.multiplyByScalar(a,n,a),a}Xt.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=J_e(t.heading,t.pitch,t.range):n=t,this._mode===te.SCENE2D){W.clone(W.ZERO,this.position),h.negate(n,this.up),this.up.z=0,h.magnitudeSquared(this.up)<M.EPSILON10&&h.clone(h.UNIT_Y,this.up),h.normalize(this.up,this.up),this._setTransform(N.IDENTITY),h.negate(h.UNIT_Z,this.direction),h.cross(this.direction,this.up,this.right),h.normalize(this.right,this.right);let i=this.frustum,r=i.top/i.right;i.right=h.magnitude(n)*.5,i.left=-i.right,i.top=r*i.right,i.bottom=-i.top,this._setTransform(e);return}h.clone(n,this.position),h.negate(this.position,this.direction),h.normalize(this.direction,this.direction),h.cross(this.direction,h.UNIT_Z,this.right),h.magnitudeSquared(this.right)<M.EPSILON10&&h.clone(h.UNIT_X,this.right),h.normalize(this.right,this.right),h.cross(this.right,this.direction,this.up),h.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var n1=new me,ect=new me,tct=new h,nct=new h,ict=new h,rct=new h,oct=new h,sct=new h,act=new h,Sq=new h,cct={direction:new h,right:new h,up:new h},N_e;function nc(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function Q_e(e,t,n,i){let r=e._projection.ellipsoid,o=i?e:cct,s=t.north,a=t.south,c=t.east,u=t.west;u>c&&(c+=M.TWO_PI);let f=(u+c)*.5,d;if(a<-M.PI_OVER_TWO+M.RADIANS_PER_DEGREE&&s>M.PI_OVER_TWO-M.RADIANS_PER_DEGREE)d=0;else{let B=n1;B.longitude=f,B.latitude=s,B.height=0;let L=ect;L.longitude=f,L.latitude=a,L.height=0;let _=N_e;(!l(_)||_.ellipsoid!==r)&&(N_e=_=new ed(void 0,void 0,r)),_.setEndPoints(B,L),d=_.interpolateUsingFraction(.5,n1).latitude}let p=n1;p.longitude=f,p.latitude=d,p.height=0;let g=r.cartographicToCartesian(p,act),m=n1;m.longitude=c,m.latitude=s;let x=r.cartographicToCartesian(m,tct);m.longitude=u;let C=r.cartographicToCartesian(m,ict);m.longitude=f;let A=r.cartographicToCartesian(m,oct);m.latitude=a;let b=r.cartographicToCartesian(m,sct);m.longitude=c;let T=r.cartographicToCartesian(m,rct);m.longitude=u;let S=r.cartographicToCartesian(m,nct);h.subtract(C,g,C),h.subtract(T,g,T),h.subtract(x,g,x),h.subtract(S,g,S),h.subtract(A,g,A),h.subtract(b,g,b);let w=r.geodeticSurfaceNormal(g,o.direction);h.negate(w,w);let D=h.cross(w,h.UNIT_Z,o.right);h.normalize(D,D);let I=h.cross(D,w,o.up),O;if(e.frustum instanceof en){let B=Math.max(h.distance(x,C),h.distance(T,S)),L=Math.max(h.distance(x,T),h.distance(C,S)),_,E,v=e.frustum._offCenterFrustum.right/e.frustum._offCenterFrustum.top,P=L*v;B>P?(_=B,E=_/v):(E=L,_=P),O=Math.max(_,E)}else{let B=Math.tan(e.frustum.fovy*.5),L=e.frustum.aspectRatio*B;if(O=Math.max(nc(w,I,C,B),nc(w,I,T,B),nc(w,I,x,B),nc(w,I,S,B),nc(w,I,A,B),nc(w,I,b,B),nc(w,D,C,L),nc(w,D,T,L),nc(w,D,x,L),nc(w,D,S,L),nc(w,D,A,L),nc(w,D,b,L)),a<0&&s>0){let _=n1;_.longitude=u,_.latitude=0,_.height=0;let E=r.cartographicToCartesian(_,Sq);h.subtract(E,g,E),O=Math.max(O,nc(w,I,E,B),nc(w,D,E,L)),_.longitude=c,E=r.cartographicToCartesian(_,Sq),h.subtract(E,g,E),O=Math.max(O,nc(w,I,E,B),nc(w,D,E,L))}}return h.add(g,h.multiplyByScalar(w,-O,Sq),n)}var lct=new me,uct=new h,fct=new h;function dct(e,t,n){let i=e._projection;t.west>t.east&&(t=he.MAX_VALUE);let r=e._actualTransform,o=e._actualInvTransform,s=lct;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,uct);N.multiplyByPoint(r,a,a),N.multiplyByPoint(o,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,fct);if(N.multiplyByPoint(r,c,c),N.multiplyByPoint(o,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-c.x)/f,(a.y-c.y)/u)*.5}else{let u=a.x-c.x,f=a.y-c.y;n.z=Math.max(u,f)}return n}var hct=new me,mct=new h,pct=new h;function _ct(e,t,n){let i=e._projection,r=t.east;t.west>t.east&&(e._scene.mapMode2D===bu.INFINITE_SCROLL?r+=M.TWO_PI:(t=he.MAX_VALUE,r=t.east));let o=hct;o.longitude=r,o.latitude=t.north;let s=i.project(o,mct);o.longitude=t.west,o.latitude=t.south;let a=i.project(o,pct),c=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,d,p=e.frustum.right/e.frustum.top,g=u*p;return c>g?(f=c,d=f/p):(d=u,f=g),u=Math.max(2*f,2*d),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,o=i.unproject(n,o),o.height=u,n=i.project(o,n),n}Xt.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new h),n===te.SCENE3D)return Q_e(this,e,t);if(n===te.COLUMBUS_VIEW)return dct(this,e,t);if(n===te.SCENE2D)return _ct(this,e,t)};var gct=new En;function yct(e,t,n,i){n=y(n,oe.WGS84);let r=e.getPickRay(t,gct),o=er.rayEllipsoid(r,n);if(!o)return;let s=o.start>0?o.start:o.stop;return En.getPoint(r,s,i)}var xct=new En;function Cct(e,t,n,i){let o=e.getPickRay(t,xct).origin;o=h.fromElements(o.y,o.z,0,o);let s=n.unproject(o);if(!(s.latitude<-M.PI_OVER_TWO||s.latitude>M.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var Act=new En;function Tct(e,t,n,i){let r=e.getPickRay(t,Act),o=-r.origin.x/r.direction.x;En.getPoint(r,o,i);let s=n.unproject(new h(i.y,i.z,0));if(!(s.latitude<-M.PI_OVER_TWO||s.latitude>M.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}Xt.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new h),t=y(t,oe.WGS84),this._mode===te.SCENE3D)n=yct(this,e,t,n);else if(this._mode===te.SCENE2D)n=Cct(this,e,this._projection,n);else if(this._mode===te.COLUMBUS_VIEW)n=Tct(this,e,this._projection,n);else return;return n}};var bct=new h,Ect=new h,Sct=new h;function wct(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,u=2/r*t.x-1,f=2/o*(o-t.y)-1,d=e.positionWC;h.clone(d,n.origin);let p=h.multiplyByScalar(e.directionWC,c,bct);h.add(d,p,p);let g=h.multiplyByScalar(e.rightWC,u*c*a,Ect),m=h.multiplyByScalar(e.upWC,f*c*s,Sct),x=h.add(p,g,n.direction);return h.add(x,m,x),h.subtract(x,d,x),h.normalize(x,x),n}var wk=new h;function vct(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,s=e.frustum;l(s._offCenterFrustum)&&(s=s._offCenterFrustum);let a=2/r*t.x-1;a*=(s.right-s.left)*.5;let c=2/o*(o-t.y)-1;c*=(s.top-s.bottom)*.5;let u=n.origin;return h.clone(e.position,u),h.multiplyByScalar(e.right,a,wk),h.add(wk,u,u),h.multiplyByScalar(e.up,c,wk),h.add(wk,u,u),h.clone(e.directionWC,n.direction),(e._mode===te.COLUMBUS_VIEW||e._mode===te.SCENE2D)&&h.fromElements(n.origin.z,n.origin.x,n.origin.y,n.origin),n}Xt.prototype.getPickRay=function(e,t){l(t)||(t=new En);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?wct(this,e,t):vct(this,e,t)};var Dct=new h,Pct=new h;Xt.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,Dct),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),Pct);return Math.max(0,h.magnitude(n)-e.radius)};var Ict=new W;Xt.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),r=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,Ict);return Math.max(r.x,r.y)};function Oct(e,t,n,i,r,o){let s=h.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>r?s.z-=n.z-r:n.z<-r&&(s.z+=-r-n.z);function a(c){let u=h.lerp(t,s,c.time,new h);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:qo.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:o,update:a}}var Rct=new h,F_e=new h,Mct=new h,Bct=new h;function Lct(e,t){let n=e.position,i=e.direction,r=e.worldToCameraCoordinatesVector(h.UNIT_X,Rct),o=-h.dot(r,n)/h.dot(r,i),s=h.add(n,h.multiplyByScalar(i,o,F_e),F_e);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,Mct);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=h.magnitude(h.subtract(n,s,Bct)),f=c*u,d=a*u,p=e._maxCoord.x,g=e._maxCoord.y,m=Math.max(f-p,p),x=Math.max(d-g,g);if(n.z<-m||n.z>m||n.y<-x||n.y>x){let C=s.y<-m||s.y>m,A=s.z<-x||s.z>x;if(C||A)return Oct(e,n,s,m,x,t)}}Xt.prototype.createCorrectPositionTween=function(e){if(this._mode===te.COLUMBUS_VIEW)return Lct(this,e)};var Nct=new h,Ms={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};Xt.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};Xt.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=Ms.destination,e.orientation.heading=Ms.heading,e.orientation.pitch=Ms.pitch,e.orientation.roll=Ms.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};Xt.prototype.flyTo=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.destination;if(this._mode===te.MORPHING)return;this.cancelFlight();let i=y(e.orientation,y.EMPTY_OBJECT);if(l(i.direction)&&(i=Y_e(this,t,i,Dq.orientation)),l(e.duration)&&e.duration<=0){let f=Dq;f.destination=e.destination,f.orientation.heading=i.heading,f.orientation.pitch=i.pitch,f.orientation.roll=i.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let r=l(t.west);r&&(t=this.getRectangleCameraCoordinates(t,Nct));let o=this,s;Ms.destination=t,Ms.heading=i.heading,Ms.pitch=i.pitch,Ms.roll=i.roll,Ms.duration=e.duration,Ms.complete=function(){s===o._currentFlight&&(o._currentFlight=void 0),l(e.complete)&&e.complete()},Ms.cancel=e.cancel,Ms.endTransform=e.endTransform,Ms.convert=r?!1:e.convert,Ms.maximumHeight=e.maximumHeight,Ms.pitchAdjustHeight=e.pitchAdjustHeight,Ms.flyOverLongitude=e.flyOverLongitude,Ms.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Ms.easingFunction=e.easingFunction;let a=this._scene,c=Ek.createTween(a,Ms);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==te.SCENE2D&&(l(u)||(u=Xt.clone(this)),u.setView({destination:t,orientation:i}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function Fct(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),r=n.aspectRatio*i;return Math.max(t/r,t/i)}function Vct(e,t){let n=e.frustum;l(n._offCenterFrustum)&&(n=n._offCenterFrustum);let i,r,o=n.right/n.top,s=t*o;return t>s?(i=t,r=i/o):(r=t,i=s),Math.max(i,r)*1.5}var kct=100;function ege(e,t,n){n=ju.clone(l(n)?n:Xt.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,r=e._scene.screenSpaceCameraController.maximumZoomDistance,o=n.range;if(!l(o)||o===0){let s=t.radius;s===0?n.range=kct:e.frustum instanceof en||e._mode===te.SCENE2D?n.range=Vct(e,s):n.range=Fct(e,s),n.range=M.clamp(n.range,i,r)}return n}Xt.prototype.viewBoundingSphere=function(e,t){t=ege(this,e,t),this.lookAt(e.center,t)};var Uct=new N,zct=new h,Hct=new h,Gct=new h,Wct=new h,jct=new se,qct=new Re,Yct=new Q;Xt.prototype.flyToBoundingSphere=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=this._mode===te.SCENE2D||this._mode===te.COLUMBUS_VIEW;this._setTransform(N.IDENTITY);let i=ege(this,e,t.offset),r;n?r=h.multiplyByScalar(h.UNIT_Z,i.range,zct):r=J_e(i.heading,i.pitch,i.range);let o=yt.eastNorthUpToFixedFrame(e.center,oe.WGS84,Uct);N.multiplyByPoint(o,r,r);let s,a;if(!n){if(s=h.subtract(e.center,r,Hct),h.normalize(s,s),a=N.multiplyByPointAsVector(o,h.UNIT_Z,Gct),1-Math.abs(h.dot(s,a))<M.EPSILON6){let u=Re.fromAxisAngle(s,i.heading,qct),f=Q.fromQuaternion(u,Yct);h.fromCartesian4(N.getColumn(o,1,jct),a),Q.multiplyByVector(f,a,a)}let c=h.cross(s,a,Wct);h.cross(c,s,a),h.normalize(a,a)}this.flyTo({destination:r,orientation:{direction:s,up:a},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var V_e=new h,k_e=new h,wq=new h,U_e=new h,i1=[new h,new h,new h,new h];function Xct(e,t){let n=t.radii,i=e.positionWC,r=h.multiplyComponents(t.oneOverRadii,i,V_e),o=h.magnitude(r),s=h.normalize(r,k_e),a,c;h.equalsEpsilon(s,h.UNIT_Z,M.EPSILON10)?(a=new h(0,1,0),c=new h(0,0,1)):(a=h.normalize(h.cross(h.UNIT_Z,s,wq),wq),c=h.normalize(h.cross(s,a,U_e),U_e));let u=Math.sqrt(h.magnitudeSquared(r)-1),f=h.multiplyByScalar(s,1/o,V_e),d=u/o,p=h.multiplyByScalar(a,d,k_e),g=h.multiplyByScalar(c,d,wq),m=h.add(f,g,i1[0]);h.subtract(m,p,m),h.multiplyComponents(n,m,m);let x=h.subtract(f,g,i1[1]);h.subtract(x,p,x),h.multiplyComponents(n,x,x);let C=h.subtract(f,g,i1[2]);h.add(C,p,C),h.multiplyComponents(n,C,C);let A=h.add(f,g,i1[3]);return h.add(A,p,A),h.multiplyComponents(n,A,A),i1}var vq=new W,Kct=new h,R0=[new me,new me,new me,new me];function vk(e,t,n,i,r,o){vq.x=e,vq.y=t;let s=i.pickEllipsoid(vq,r,Kct);return l(s)?(R0[n]=r.cartesianToCartographic(s,R0[n]),1):(R0[n]=r.cartesianToCartographic(o[n],R0[n]),0)}Xt.prototype.computeViewRectangle=function(e,t){e=y(e,oe.WGS84);let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new re(h.ZERO,e.maximumRadius);if(n.computeVisibility(i)===Jt.OUTSIDE)return;let o=this._scene.canvas,s=o.clientWidth,a=o.clientHeight,c=0,u=Xct(this,e);if(c+=vk(0,0,0,this,e,u),c+=vk(0,a,1,this,e,u),c+=vk(s,a,2,this,e,u),c+=vk(s,0,3,this,e,u),c<2)return he.MAX_VALUE;t=he.fromCartographicArray(R0,t);let f=0,d=R0[3].longitude;for(let p=0;p<4;++p){let g=R0[p].longitude,m=Math.abs(g-d);m>M.PI?f+=M.TWO_PI-m:f+=m,d=g}return M.equalsEpsilon(Math.abs(f),M.TWO_PI,M.EPSILON9)&&(t.west=-M.PI,t.east=M.PI,R0[0].latitude>=0?t.north=M.PI_OVER_TWO:t.south=-M.PI_OVER_TWO),t};Xt.prototype.switchToPerspectiveFrustum=function(){if(this._mode===te.SCENE2D||this.frustum instanceof bi)return;let e=this._scene;this.frustum=new bi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=M.toRadians(60)};Xt.prototype.switchToOrthographicFrustum=function(){if(this._mode===te.SCENE2D||this.frustum instanceof en)return;let e=j_e(this),t=this._scene;this.frustum=new en,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};Xt.clone=function(e,t){return l(t)||(t=new Xt(e._scene)),h.clone(e.position,t.position),h.clone(e.direction,t.direction),h.clone(e.up,t.up),h.clone(e.right,t.right),N.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var _r=Xt;var $ct={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},ki=Object.freeze($ct);function rc(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function Zct(e,t){W.clone(e.distance.startPosition,t.distance.startPosition),W.clone(e.distance.endPosition,t.distance.endPosition),W.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),W.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function tge(e,t,n){let i=rc(ki.PINCH,t),r=e._update,o=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;r[i]=!0,o[i]=!1,s[i]=new W;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new W,endPosition:new W},u.angleAndHeight={startPosition:new W,endPosition:new W},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,o[i]=!0,a[i]=new Date,W.lerp(f.position1,f.position2,.5,s[i])},_n.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),o[i]=!1,c[i]=new Date},_n.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(o[i]){r[i]?(Zct(f,u),r[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(W.clone(f.distance.endPosition,u.distance.endPosition),W.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let d=u.angleAndHeight.endPosition.x,p=u.prevAngle,g=Math.PI*2;for(;d>=p+Math.PI;)d-=g;for(;d<p-Math.PI;)d+=g;u.angleAndHeight.endPosition.x=-d*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},_n.PINCH_MOVE,t)}function nge(e,t){let n=rc(ki.WHEEL,t),i=e._update;i[n]=!0;let r=e._movement[n];l(r)||(r=e._movement[n]={}),r.startPosition=new W,r.endPosition=new W,e._eventHandler.setInputAction(function(o){let s=15*M.toRadians(o);i[n]?(W.clone(W.ZERO,r.startPosition),r.endPosition.x=0,r.endPosition.y=s,i[n]=!1):r.endPosition.y=r.endPosition.y+s},_n.WHEEL,t)}function CE(e,t,n){let i=rc(n,t),r=e._isDown,o=e._eventStartPosition,s=e._pressTime,a=e._releaseTime;r[i]=!1,o[i]=new W;let c=e._lastMovement[i];l(c)||(c=e._lastMovement[i]={startPosition:new W,endPosition:new W,valid:!1});let u,f;n===ki.LEFT_DRAG?(u=_n.LEFT_DOWN,f=_n.LEFT_UP):n===ki.RIGHT_DRAG?(u=_n.RIGHT_DOWN,f=_n.RIGHT_UP):n===ki.MIDDLE_DRAG&&(u=_n.MIDDLE_DOWN,f=_n.MIDDLE_UP),e._eventHandler.setInputAction(function(d){e._buttonsDown++,c.valid=!1,r[i]=!0,s[i]=new Date,W.clone(d.position,o[i])},u,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,a[i]=new Date},f,t)}function ige(e,t){W.clone(e.startPosition,t.startPosition),W.clone(e.endPosition,t.endPosition)}function rge(e,t){let n=e._update,i=e._movement,r=e._lastMovement,o=e._isDown;for(let s in ki)if(ki.hasOwnProperty(s)){let a=ki[s];if(l(a)){let c=rc(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new W,endPosition:new W,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new W,endPosition:new W})}}e._eventHandler.setInputAction(function(s){for(let a in ki)if(ki.hasOwnProperty(a)){let c=ki[a];if(l(c)){let u=rc(c,t);o[u]&&(n[u]?(ige(i[u],r[u]),r[u].valid=!0,ige(s,i[u]),n[u]=!1):W.clone(s.endPosition,i[u].endPosition))}}W.clone(s.endPosition,e._currentMousePosition)},_n.MOUSE_MOVE,t)}function Mf(e){this._eventHandler=new Ku(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new W,nge(this,void 0),tge(this,void 0,e),CE(this,void 0,ki.LEFT_DRAG),CE(this,void 0,ki.RIGHT_DRAG),CE(this,void 0,ki.MIDDLE_DRAG),rge(this,void 0);for(let t in ha)if(ha.hasOwnProperty(t)){let n=ha[t];l(n)&&(nge(this,n),tge(this,n,e),CE(this,n,ki.LEFT_DRAG),CE(this,n,ki.RIGHT_DRAG),CE(this,n,ki.MIDDLE_DRAG),rge(this,n))}}Object.defineProperties(Mf.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[rc(ki.WHEEL)]||!this._update[rc(ki.WHEEL,ha.SHIFT)]||!this._update[rc(ki.WHEEL,ha.CTRL)]||!this._update[rc(ki.WHEEL,ha.ALT)];return this._buttonsDown>0||e}}});Mf.prototype.isMoving=function(e,t){let n=rc(e,t);return!this._update[n]};Mf.prototype.getMovement=function(e,t){let n=rc(e,t);return this._movement[n]};Mf.prototype.getLastMovement=function(e,t){let n=rc(e,t),i=this._lastMovement[n];if(i.valid)return i};Mf.prototype.isButtonDown=function(e,t){let n=rc(e,t);return this._isDown[n]};Mf.prototype.getStartMousePosition=function(e,t){if(e===ki.WHEEL)return this._currentMousePosition;let n=rc(e,t);return this._eventStartPosition[n]};Mf.prototype.getButtonPressTime=function(e,t){let n=rc(e,t);return this._pressTime[n]};Mf.prototype.getButtonReleaseTime=function(e,t){let n=rc(e,t);return this._releaseTime[n]};Mf.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Mf.prototype.isDestroyed=function(){return!1};Mf.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),ue(this)};var Rk=Mf;function n_(){this.featurePropertiesDirty=!1}Object.defineProperties(n_.prototype,{featuresLength:{get:function(){ye.throwInstantiationError()}},pointsLength:{get:function(){ye.throwInstantiationError()}},trianglesLength:{get:function(){ye.throwInstantiationError()}},geometryByteLength:{get:function(){ye.throwInstantiationError()}},texturesByteLength:{get:function(){ye.throwInstantiationError()}},batchTableByteLength:{get:function(){ye.throwInstantiationError()}},innerContents:{get:function(){ye.throwInstantiationError()}},readyPromise:{get:function(){ye.throwInstantiationError()}},tileset:{get:function(){ye.throwInstantiationError()}},tile:{get:function(){ye.throwInstantiationError()}},url:{get:function(){ye.throwInstantiationError()}},batchTable:{get:function(){ye.throwInstantiationError()}},metadata:{get:function(){ye.throwInstantiationError()},set:function(e){ye.throwInstantiationError()}},group:{get:function(){ye.throwInstantiationError()},set:function(e){ye.throwInstantiationError()}}});n_.prototype.hasProperty=function(e,t){ye.throwInstantiationError()};n_.prototype.getFeature=function(e){ye.throwInstantiationError()};n_.prototype.applyDebugSettings=function(e,t){ye.throwInstantiationError()};n_.prototype.applyStyle=function(e){ye.throwInstantiationError()};n_.prototype.update=function(e,t){ye.throwInstantiationError()};n_.prototype.isDestroyed=function(){ye.throwInstantiationError()};n_.prototype.destroy=function(){ye.throwInstantiationError()};var oge=n_;function Jct(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var Kd=Jct;function AE(e,t){this._conditionsExpression=$e(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,elt(this,t)}Object.defineProperties(AE.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function Qct(e,t){this.condition=e,this.expression=t}function elt(e,t){let n=[],i=e._conditions;if(!l(i))return;let r=i.length;for(let o=0;o<r;++o){let s=i[o],a=String(s[0]),c=String(s[1]);n.push(new Qct(new ud(a,t),new ud(c,t)))}e._runtimeConditions=n}AE.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.condition.evaluate(e))return o.expression.evaluate(e,t)}};AE.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.condition.evaluate(e))return o.expression.evaluateColor(e,t)}};AE.prototype.getShaderFunction=function(e,t,n,i){let r=this._runtimeConditions;if(!l(r)||r.length===0)return;let o="",s=r.length;for(let a=0;a<s;++a){let c=r[a],u=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);o+=` ${a===0?"if":"else if"} (${u})
- {
- return ${f};
- }
- `}return o=`${i} ${e}
- {
- ${o} return ${i}(1.0);
- }
- `,o};AE.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let r=t[i];e.push.apply(e,r.condition.getVariables()),e.push.apply(e,r.expression.getVariables())}return e=e.filter(function(i,r,o){return o.indexOf(i)===r}),e};var Mk=AE;function M0(e){if(this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,typeof e=="string"||e instanceof De){let t=De.createIfNeeded(e),n=this;this._readyPromise=t.fetchJson(e).then(function(i){return sge(n,i),n})}else sge(this,e),this._readyPromise=Promise.resolve(this)}function sge(e,t){t=y($e(t,!0),e._style),e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin;let n={};if(l(t.meta)){let i=t.defines,r=y(t.meta,y.EMPTY_OBJECT);for(let o in r)r.hasOwnProperty(o)&&(n[o]=new ud(r[o],i))}e._meta=n,e._ready=!0}function Qr(e,t){let n=y(e._style,y.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new ud(String(t));if(typeof t=="string")return new ud(t,n);if(l(t.conditions))return new Mk(t,n)}else return;return t}function eo(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return $e(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(M0.prototype,{style:{get:function(){return this._style}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},show:{get:function(){return this._show},set:function(e){this._show=Qr(this,e),this._style.show=eo(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=Qr(this,e),this._style.color=eo(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=Qr(this,e),this._style.pointSize=eo(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=Qr(this,e),this._style.pointOutlineColor=eo(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=Qr(this,e),this._style.pointOutlineWidth=eo(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=Qr(this,e),this._style.labelColor=eo(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=Qr(this,e),this._style.labelOutlineColor=eo(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=Qr(this,e),this._style.labelOutlineWidth=eo(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=Qr(this,e),this._style.font=eo(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=Qr(this,e),this._style.labelStyle=eo(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=Qr(this,e),this._style.labelText=eo(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=Qr(this,e),this._style.backgroundColor=eo(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=Qr(this,e),this._style.backgroundPadding=eo(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=Qr(this,e),this._style.backgroundEnabled=eo(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=Qr(this,e),this._style.scaleByDistance=eo(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=Qr(this,e),this._style.translucencyByDistance=eo(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Qr(this,e),this._style.distanceDisplayCondition=eo(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=Qr(this,e),this._style.heightOffset=eo(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=Qr(this,e),this._style.anchorLineEnabled=eo(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=Qr(this,e),this._style.anchorLineColor=eo(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=Qr(this,e),this._style.image=eo(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=Qr(this,e),this._style.disableDepthTestDistance=eo(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=Qr(this,e),this._style.horizontalOrigin=eo(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=Qr(this,e),this._style.verticalOrigin=eo(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=Qr(this,e),this._style.labelHorizontalOrigin=eo(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=Qr(this,e),this._style.labelVerticalOrigin=eo(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});M0.fromUrl=function(e){return De.createIfNeeded(e).fetchJson(e).then(function(n){return new M0(n)})};M0.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};M0.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};M0.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};M0.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&e.push.apply(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var TE=M0;function Rq(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(Rq.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});Rq.prototype.emit=function(e){let t=M.randomBetween(0,M.TWO_PI),n=M.randomBetween(0,this._radius),i=n*Math.cos(t),r=n*Math.sin(t),o=0;e.position=h.fromElements(i,r,o,e.position),e.velocity=h.clone(h.UNIT_Z,e.velocity)};var Bk=Rq;var Mq={CUMULUS:0};Mq.validate=function(e){return e===Mq.CUMULUS};var r1=Object.freeze(Mq);var Lk=`uniform sampler2D u_noiseTexture;
- uniform vec3 u_noiseTextureDimensions;
- uniform float u_noiseDetail;
- varying vec2 v_offset;
- varying vec3 v_maximumSize;
- varying vec4 v_color;
- varying float v_slice;
- varying float v_brightness;
- float wrap(float value, float rangeLength) {
- if(value < 0.0) {
- float absValue = abs(value);
- float modValue = mod(absValue, rangeLength);
- return mod(rangeLength - modValue, rangeLength);
- }
- return mod(value, rangeLength);
- }
- vec3 wrapVec(vec3 value, float rangeLength) {
- return vec3(wrap(value.x, rangeLength),
- wrap(value.y, rangeLength),
- wrap(value.z, rangeLength));
- }
- float textureSliceWidth = u_noiseTextureDimensions.x;
- float noiseTextureRows = u_noiseTextureDimensions.y;
- float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
- float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth;
- vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared,
- inverseNoiseTextureRows / textureSliceWidth);
- vec2 voxelToUV(vec3 voxelIndex) {
- vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth);
- float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows);
- float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows);
- float xPixelCoord = wrappedIndex.x + column * textureSliceWidth;
- float yPixelCoord = wrappedIndex.y + row * textureSliceWidth;
- return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions;
- }
- vec4 lerpSamplesX(vec3 voxelIndex, float x) {
- vec2 uv0 = voxelToUV(voxelIndex);
- vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0));
- vec4 sample0 = texture2D(u_noiseTexture, uv0);
- vec4 sample1 = texture2D(u_noiseTexture, uv1);
- return mix(sample0, sample1, x);
- }
- vec4 sampleNoiseTexture(vec3 position) {
- vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0);
- vec3 lerpValue = fract(recenteredPos);
- vec3 voxelIndex = floor(recenteredPos);
- vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x);
- vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x);
- vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x);
- vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x);
- vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y);
- vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y);
- return mix(yLerp0, yLerp1, lerpValue.z);
- }
- bool intersectSphere(vec3 origin, vec3 dir, float slice,
- out vec3 point, out vec3 normal) {
- float A = dot(dir, dir);
- float B = dot(origin, dir);
- float C = dot(origin, origin) - 0.25;
- float discriminant = (B * B) - (A * C);
- if(discriminant < 0.0) {
- return false;
- }
- float root = sqrt(discriminant);
- float t = (-B - root) / A;
- if(t < 0.0) {
- t = (-B + root) / A;
- }
- point = origin + t * dir;
- if(slice >= 0.0) {
- point.z = (slice / 2.0) - 0.5;
- if(length(point) > 0.5) {
- return false;
- }
- }
- normal = normalize(point);
- point -= czm_epsilon2 * normal;
- return true;
- }
- bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice,
- out vec3 point, out vec3 normal) {
- if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) {
- return false;
- }
- vec3 o = (origin - center) / scale;
- vec3 d = dir / scale;
- vec3 p, n;
- bool intersected = intersectSphere(o, d, slice, p, n);
- if(intersected) {
- point = (p * scale) + center;
- normal = n;
- }
- return intersected;
- }
- vec2 phaseShift2D(vec2 p, vec2 freq) {
- return (czm_pi / 2.0) * sin(freq.yx * p.yx);
- }
- vec2 phaseShift3D(vec3 p, vec2 freq) {
- return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z));
- }
- const float T0 = 0.6;
- const float k = 0.1;
- const float C0 = 0.8;
- const float FX0 = 0.6;
- const float FY0 = 0.6;
- const int octaves = 5;
- float T(vec3 point) {
- vec2 sum = vec2(0.0);
- float Ci = C0;
- vec2 FXY = vec2(FX0, FY0);
- vec2 PXY = vec2(0.0);
- for(int i = 1; i <= octaves; i++) {
- PXY = phaseShift3D(point, FXY);
- Ci *= 0.707;
- FXY *= 2.0;
- vec2 sinTerm = sin(FXY * point.xy + PXY);
- sum += Ci * sinTerm + vec2(T0);
- }
- return k * sum.x * sum.y;
- }
- const float a = 0.5;
- const float t = 0.4;
- const float s = 0.25;
- float I(float Id, float Is, float It) {
- return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a;
- }
- const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7));
- vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice,
- float brightness) {
- vec3 cloudPoint, cloudNormal;
- if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice,
- cloudPoint, cloudNormal)) {
- return vec4(0.0);
- }
- float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0);
- float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0);
- float It = T(cloudPoint);
- float intensity = I(Id, Is, It);
- vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0));
- vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint);
- float W = noise.x;
- float W2 = noise.y;
- float W3 = noise.z;
- float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0);
- float TR = pow(ndDot, 3.0) - W;
- TR *= 1.3;
- float minusDot = 0.5 - ndDot;
- TR -= min(minusDot * W2, 0.0);
- TR -= 0.8 * (minusDot + 0.25) * W3;
- float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR);
- shading = clamp(shading + 0.2, 0.3, 1.0);
- vec3 finalColor = mix(vec3(0.5), shading * color, 1.15);
- return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color;
- }
- void main() {
- #ifdef DEBUG_BILLBOARDS
- gl_FragColor = vec4(0.0, 0.5, 0.5, 1.0);
- #endif
- vec2 coordinate = v_maximumSize.xy * v_offset;
- vec3 ellipsoidScale = 0.82 * v_maximumSize;
- vec3 ellipsoidCenter = vec3(0.0);
- float zOffset = max(ellipsoidScale.z - 10.0, 0.0);
- vec3 eye = vec3(0, 0, -10.0 - zOffset);
- vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye);
- vec3 rayOrigin = eye;
- #ifdef DEBUG_ELLIPSOIDS
- vec3 point, normal;
- if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice,
- point, normal)) {
- gl_FragColor = v_brightness * v_color;
- }
- #else
- #ifndef DEBUG_BILLBOARDS
- vec4 cloud = drawCloud(rayOrigin, rayDir,
- ellipsoidCenter, ellipsoidScale, v_slice, v_brightness);
- if(cloud.w < 0.01) {
- discard;
- }
- gl_FragColor = cloud;
- #endif
- #endif
- }
- `;var Nk=`#ifdef INSTANCED
- attribute vec2 direction;
- #endif
- attribute vec4 positionHighAndScaleX;
- attribute vec4 positionLowAndScaleY;
- attribute vec4 packedAttribute0;
- attribute vec4 packedAttribute1;
- attribute vec4 color;
- varying vec2 v_offset;
- varying vec3 v_maximumSize;
- varying vec4 v_color;
- varying float v_slice;
- varying float v_brightness;
- void main() {
- vec3 positionHigh = positionHighAndScaleX.xyz;
- vec3 positionLow = positionLowAndScaleY.xyz;
- vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w);
- float show = packedAttribute0.x;
- float brightness = packedAttribute0.y;
- vec2 coordinates = packedAttribute0.wz;
- vec3 maximumSize = packedAttribute1.xyz;
- float slice = packedAttribute1.w;
- #ifdef INSTANCED
- vec2 dir = direction;
- #else
- vec2 dir = coordinates;
- #endif
- vec2 offset = dir - vec2(0.5, 0.5);
- vec2 scaledOffset = scale * offset;
- vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
- vec4 positionEC = czm_modelViewRelativeToEye * p;
- positionEC.xy += scaledOffset;
- positionEC.xyz *= show;
- gl_Position = czm_projection * positionEC;
- v_offset = offset;
- v_maximumSize = maximumSize;
- v_color = color;
- v_slice = slice;
- v_brightness = brightness;
- }
- `;var Fk=`uniform vec3 u_noiseTextureDimensions;
- uniform float u_noiseDetail;
- uniform vec3 u_noiseOffset;
- varying vec2 v_position;
- float textureSliceWidth = u_noiseTextureDimensions.x;
- float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
- float wrap(float value, float rangeLength) {
- if(value < 0.0) {
- float absValue = abs(value);
- float modValue = mod(absValue, rangeLength);
- return mod(rangeLength - modValue, rangeLength);
- }
- return mod(value, rangeLength);
- }
- vec3 wrapVec(vec3 value, float rangeLength) {
- return vec3(wrap(value.x, rangeLength),
- wrap(value.y, rangeLength),
- wrap(value.z, rangeLength));
- }
- vec3 random3(vec3 p) {
- float dot1 = dot(p, vec3(127.1, 311.7, 932.8));
- float dot2 = dot(p, vec3(269.5, 183.3, 421.4));
- return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2));
- }
- vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) {
- vec3 cell = centerCell + offset;
- cell = wrapVec(cell, textureSliceWidth / u_noiseDetail);
- cell += floor(u_noiseOffset / u_noiseDetail);
- vec3 p = offset + random3(cell);
- return p;
- }
- float worleyNoise(vec3 p, float freq) {
- vec3 centerCell = floor(p * freq);
- vec3 pointInCell = fract(p * freq);
- float shortestDistance = 1000.0;
- for(float z = -1.0; z <= 1.0; z++) {
- for(float y = -1.0; y <= 1.0; y++) {
- for(float x = -1.0; x <= 1.0; x++) {
- vec3 offset = vec3(x, y, z);
- vec3 point = getWorleyCellPoint(centerCell, offset, freq);
- float distance = length(pointInCell - point);
- if(distance < shortestDistance) {
- shortestDistance = distance;
- }
- }
- }
- }
- return shortestDistance;
- }
- const float MAX_FBM_ITERATIONS = 10.0;
- float worleyFBMNoise(vec3 p, float octaves, float scale) {
- float noise = 0.0;
- float freq = 1.0;
- float persistence = 0.625;
- for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) {
- if(i >= octaves) {
- break;
- }
- noise += worleyNoise(p * scale, freq * scale) * persistence;
- persistence *= 0.5;
- freq *= 2.0;
- }
- return noise;
- }
- void main() {
- float x = mod(v_position.x, textureSliceWidth);
- float y = mod(v_position.y, textureSliceWidth);
- float sliceRow = floor(v_position.y / textureSliceWidth);
- float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth;
- vec3 position = vec3(x, y, z);
- position /= u_noiseDetail;
- float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0);
- float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0);
- float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0);
- gl_FragColor = vec4(worley0, worley1, worley2, 1.0);
- }
- `;var Vk=`uniform vec3 u_noiseTextureDimensions;
- attribute vec2 position;
- varying vec2 v_position;
- void main()
- {
- gl_Position = vec4(position, 0.1, 1.0);
- float textureSliceWidth = u_noiseTextureDimensions.x;
- float noiseTextureRows = u_noiseTextureDimensions.y;
- float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
- vec2 transformedPos = (position * 0.5) + vec2(0.5);
- transformedPos *= textureSliceWidth;
- transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows;
- transformedPos.y *= noiseTextureRows;
- v_position = transformedPos;
- }
- `;function $d(e,t){if(e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._position=h.clone(y(e.position,h.ZERO)),!l(e.scale)&&l(e.maximumSize))this._maximumSize=h.clone(e.maximumSize),this._scale=new W(this._maximumSize.x,this._maximumSize.y);else{this._scale=W.clone(y(e.scale,new W(20,12)));let n=new h(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=h.clone(y(e.maximumSize,n))}this._slice=y(e.slice,-1),this._color=z.clone(y(e.color,z.WHITE)),this._brightness=y(e.brightness,1),this._cloudCollection=t,this._index=-1}var tlt=$d.SHOW_INDEX=0,nlt=$d.POSITION_INDEX=1,ilt=$d.SCALE_INDEX=2,rlt=$d.MAXIMUM_SIZE_INDEX=3,olt=$d.SLICE_INDEX=4,slt=$d.BRIGHTNESS_INDEX=5,alt=$d.COLOR_INDEX=6;$d.NUMBER_OF_PROPERTIES=7;function sC(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties($d.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,sC(this,tlt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),sC(this,nlt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;W.equals(t,e)||(W.clone(e,t),sC(this,ilt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),sC(this,rlt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),sC(this,alt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,sC(this,olt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,sC(this,slt))}}});$d.prototype._destroy=function(){this._cloudCollection=void 0};var Bf=$d;var Eu,kk=new h,clt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},llt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},ult=Bf.SHOW_INDEX,flt=Bf.POSITION_INDEX,dlt=Bf.SCALE_INDEX,hlt=Bf.MAXIMUM_SIZE_INDEX,mlt=Bf.SLICE_INDEX,plt=Bf.BRIGHTNESS_INDEX,_lt=Bf.NUMBER_OF_PROPERTIES,glt=Bf.COLOR_INDEX;function Zd(e){e=y(e,y.EMPTY_OBJECT),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(_lt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=y(e.noiseDetail,16),this.noiseOffset=h.clone(y(e.noiseOffset,h.ZERO)),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:age(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=y(e.show,!0),this._colorCommands=[],this.debugBillboards=y(e.debugBillboards,!1),this._compiledDebugBillboards=!1,this.debugEllipsoids=y(e.debugEllipsoids,!1),this._compiledDebugEllipsoids=!1}function age(e){return function(){return kk.x=e._textureSliceWidth,kk.y=e._noiseTextureRows,kk.z=1/e._noiseTextureRows,kk}}Object.defineProperties(Zd.prototype,{length:{get:function(){return Lq(this),this._clouds.length}}});function cge(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Zd.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.cloudType,r1.CUMULUS),n;return t===r1.CUMULUS&&(n=new Bf(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};Zd.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Zd.prototype.removeAll=function(){cge(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function Lq(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];l(s)&&(n._index=o++,t.push(s))}e._clouds=t}}Zd.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};Zd.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};Zd.prototype.get=function(e){return Lq(this),this._clouds[e]};var ylt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),xlt=new Uint16Array([0,1,2,0,2,3]);function Clt(e){let t=at.createVertexBuffer({context:e,typedArray:ylt,usage:Ne.STATIC_DRAW}),n=at.createIndexBuffer({context:e,typedArray:xlt,usage:Ne.STATIC_DRAW,indexDatatype:Le.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:K.FLOAT}];return new Qn({context:e,attributes:i,indexBuffer:n})}var Nq;function Alt(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,r=new Uint16Array(i);for(let o=0,s=0;o<i;o+=6,s+=4)r[o]=s,r[o+1]=s+1,r[o+2]=s+2,r[o+3]=s,r[o+4]=s+2,r[o+5]=s+3;return n=at.createIndexBuffer({context:e,typedArray:r,usage:Ne.STATIC_DRAW,indexDatatype:Le.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function Tlt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=at.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ne.STATIC_DRAW,indexDatatype:Le.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function blt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=at.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Ne.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function Elt(e,t,n){let i=[{index:Eu.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:Ne.STATIC_DRAW},{index:Eu.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:Ne.STATIC_DRAW},{index:Eu.packedAttribute0,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:Ne.STATIC_DRAW},{index:Eu.packedAttribute1,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:Ne.STATIC_DRAW},{index:Eu.color,componentsPerAttribute:4,componentDatatype:K.UNSIGNED_BYTE,normalize:!0,usage:Ne.STATIC_DRAW}];n&&i.push({index:Eu.direction,componentsPerAttribute:2,componentDatatype:K.FLOAT,vertexBuffer:blt(e)});let r=n?t:4*t;return new Ng(e,i,r,n)}var Bq=new zn;function lge(e,t,n,i){let r,o=n[Eu.positionHighAndScaleX],s=n[Eu.positionLowAndScaleY],a=i.position;zn.fromCartesian(a,Bq);let c=i.scale,u=Bq.high,f=Bq.low;e._instanced?(r=i._index,o(r,u.x,u.y,u.z,c.x),s(r,f.x,f.y,f.z,c.y)):(r=i._index*4,o(r+0,u.x,u.y,u.z,c.x),o(r+1,u.x,u.y,u.z,c.x),o(r+2,u.x,u.y,u.z,c.x),o(r+3,u.x,u.y,u.z,c.x),s(r+0,f.x,f.y,f.z,c.y),s(r+1,f.x,f.y,f.z,c.y),s(r+2,f.x,f.y,f.z,c.y),s(r+3,f.x,f.y,f.z,c.y))}function uge(e,t,n,i){let r,o=n[Eu.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(r=i._index,o(r,s,a,0,0)):(r=i._index*4,o(r+0,s,a,0,0),o(r+1,s,a,1,0),o(r+2,s,a,1,1),o(r+3,s,a,0,1))}function fge(e,t,n,i){let r,o=n[Eu.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(r=i._index,o(r,s.x,s.y,s.z,a)):(r=i._index*4,o(r+0,s.x,s.y,s.z,a),o(r+1,s.x,s.y,s.z,a),o(r+2,s.x,s.y,s.z,a),o(r+3,s.x,s.y,s.z,a))}function dge(e,t,n,i){let r,o=n[Eu.color],s=i.color,a=z.floatToByte(s.red),c=z.floatToByte(s.green),u=z.floatToByte(s.blue),f=z.floatToByte(s.alpha);e._instanced?(r=i._index,o(r,a,c,u,f)):(r=i._index*4,o(r+0,a,c,u,f),o(r+1,a,c,u,f),o(r+2,a,c,u,f),o(r+3,a,c,u,f))}function Slt(e,t,n,i){lge(e,t,n,i),uge(e,t,n,i),fge(e,t,n,i),dge(e,t,n,i)}function wlt(e,t,n,i){let r=e,o=r._textureSliceWidth,s=r._noiseTextureRows,a=t.context;r._vaNoise=Clt(a),r._spNoise=Wt.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=r.noiseDetail,u=r.noiseOffset;r._noiseTexture=new wt({context:a,width:o*o/s,height:o*s,pixelDatatype:qe.UNSIGNED_BYTE,pixelFormat:ct.RGBA,sampler:new on({wrapS:mn.REPEAT,wrapT:mn.REPEAT,minificationFilter:It.NEAREST,magnificationFilter:Xi.NEAREST})});let f=new cd({vertexArray:r._vaNoise,shaderProgram:r._spNoise,outputTexture:r._noiseTexture,uniformMap:{u_noiseTextureDimensions:age(r),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(d){r._ready=!0,r._loading=!1}});t.commandList.push(f),r._loading=!0}function vlt(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let r=e._clouds,o=r.length;if(o>0){n._vaf=Elt(i,o,n._instanced);let s=n._vaf.writers,a;for(a=0;a<o;++a){let c=r[a];Slt(e,t,s,c)}n._vaf.commit(Nq(i))}}var Dlt=[];function Plt(e,t){let n=t.context,i=e,o=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=Dlt;u.length=0,(c[flt]||c[dlt])&&u.push(lge),(c[ult]||c[plt])&&u.push(uge),(c[hlt]||c[mlt])&&u.push(fge),c[glt]&&u.push(dge);let f=u.length,d=i._vaf.writers,p,g,m;if(a/o>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,d,g);i._vaf.commit(Nq(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,d,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function Ilt(e,t,n,i){let r=t.context,o=e,s=new Fe({defines:[],sources:[n]});o._instanced&&s.defines.push("INSTANCED");let a=new Fe({defines:[],sources:[i]});o.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),o.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),o._sp=Wt.replaceCache({context:r,shaderProgram:o._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:Eu}),o._rs=Ve.fromCache({depthTest:{enabled:!0,func:Z.LESS},depthMask:!1,blending:hn.ALPHA_BLEND}),o._spCreated=!0,o._compiledDebugBillboards=o.debugBillboards,o._compiledDebugEllipsoids=o.debugEllipsoids}function Olt(e,t){let n=e,i=t.passes,r=n._uniforms,o=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let u=0;u<c;u++){let f=s[u];l(f)||(f=s[u]=new Ze),f.pass=Ce.TRANSLUCENT,f.owner=e,f.uniformMap=r,f.count=a[u].indicesCount,f.vertexArray=a[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),o.push(f)}}}Zd.prototype.update=function(e){if(Lq(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&wlt(this,e,Vk,Fk),this._instanced=e.context.instancedArrays,Eu=this._instanced?llt:clt,Nq=this._instanced?Tlt:Alt;let i=this._clouds.length,r=this._cloudsToUpdate,o=this._cloudsToUpdateIndex;this._createVertexArray?vlt(this,e):o>0&&Plt(this,e),o>i*1.5&&(r.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&Ilt(this,e,Nk,Lk),Olt(this,e))};Zd.prototype.isDestroyed=function(){return!1};Zd.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),cge(this._clouds),ue(this)};var hge=Zd;function Fq(e,t){let n=t.terrainProvider,i=t.mapProjection,r=i.ellipsoid,o,s=t.camera.getRectangleCameraCoordinates(e);return t.mode===te.SCENE3D?o=r.cartesianToCartographic(s):o=i.unproject(s),l(n)?n.readyPromise.then(function(){let a=n.availability;if(!l(a)||t.mode===te.SCENE2D)return o;let c=[he.center(e),he.southeast(e),he.southwest(e),he.northeast(e),he.northwest(e)];return Fq._sampleTerrainMostDetailed(n,c).then(function(u){let f=u.reduce(function(p,g){return Math.max(g.height,p)},-Number.MAX_VALUE),d=o;return d.height+=f,d})}):Promise.resolve(o)}Fq._sampleTerrainMostDetailed=dT;var bE=Fq;var Rlt=M.toRadians(30);function Vq(e){this._angle=y(e,Rlt)}Object.defineProperties(Vq.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});Vq.prototype.emit=function(e){let t=Math.tan(this._angle),n=M.randomBetween(0,M.TWO_PI),i=M.randomBetween(0,t),r=i*Math.cos(n),o=i*Math.sin(n),s=1;e.velocity=h.fromElements(r,o,s,e.velocity),h.normalize(e.velocity,e.velocity),e.position=h.clone(h.ZERO,e.position)};var mge=Vq;var Mlt=new z,Blt=new z,Llt=new z,Nlt=new z,pge=new se,o1=new Uint8Array(4);function _ge(e,t,n,i){let r=t.height===n.height?0:(e-t.height)/(n.height-t.height);return z.lerp(t.color,n.color,r,i)}function Uk(e,t){return{height:e,color:z.clone(t)}}function gge(e){return e=e.filter(function(t,n,i){let r=n>0,o=n<i.length-1,s=r?t.height===i[n-1].height:!0,a=o?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let r=n>0,o=n<i.length-1,s=r?z.equals(t.color,i[n-1].color):!1,a=o?z.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let r=n>0,o=r?z.equals(t.color,i[n-1].color):!1,s=r?t.height===i[n-1].height:!0;return!o||!s}),e}function Flt(e){let t,n,i=[],r=e.length;for(t=0;t<r;t++){let o=e[t],s=o.entries,a=s.length,c=[];for(n=0;n<a;n++){let g=s[n],m=M.clamp(g.height,Ol._minimumHeight,Ol._maximumHeight),x=z.clone(g.color,Mlt);x.red*=x.alpha,x.green*=x.alpha,x.blue*=x.alpha,c.push(Uk(m,x))}let u=!0,f=!0;for(n=0;n<a-1;n++){let g=c[n+0],m=c[n+1];u=u&&g.height<=m.height,f=f&&g.height>=m.height}f?c=c.reverse():u||By(c,function(g,m){return M.sign(g.height-m.height)});let d=y(o.extendDownwards,!1),p=y(o.extendUpwards,!1);c.length===1&&!d&&!p&&(d=!0,p=!0),d&&c.splice(0,0,Uk(Ol._minimumHeight,c[0].color)),p&&c.splice(c.length,0,Uk(Ol._maximumHeight,c[c.length-1].color)),c=gge(c),i.push(c)}return i}function Vlt(e){let t=Flt(e),n=[],i=[],r;function o(u,f){n.push(Uk(u,f))}function s(u,f,d){let p=z.multiplyByScalar(d,1-f.alpha,Nlt);p=z.add(p,f,p),o(u,p)}let a=t.length;for(r=0;r<a;r++){let u=t[r],f=0,d=0;i=n,n=[];let p=u.length,g=i.length;for(;f<p||d<g;){let m=f<p?u[f]:void 0,x=f>0?u[f-1]:void 0,C=f<p-1?u[f+1]:void 0,A=d<g?i[d]:void 0,b=d>0?i[d-1]:void 0,T=d<g-1?i[d+1]:void 0;if(l(m)&&l(A)&&m.height===A.height){let S=l(T)&&A.height===T.height,w=!l(b),D=!l(T),I=l(C)&&m.height===C.height,O=!l(x),B=!l(C);S?I?(s(m.height,m.color,A.color),s(m.height,C.color,T.color)):O?(o(m.height,A.color),s(m.height,m.color,T.color)):B?(s(m.height,m.color,A.color),o(m.height,T.color)):(s(m.height,m.color,A.color),s(m.height,m.color,T.color)):w?I?(o(m.height,m.color),s(m.height,C.color,A.color)):B?(o(m.height,m.color),o(m.height,A.color)):(O||o(m.height,m.color),s(m.height,m.color,A.color)):D?I?(s(m.height,m.color,A.color),o(m.height,C.color)):O?(o(m.height,A.color),o(m.height,m.color)):B?s(m.height,m.color,A.color):(s(m.height,m.color,A.color),o(m.height,m.color)):I?(s(m.height,m.color,A.color),s(m.height,C.color,A.color)):O?(o(m.height,A.color),s(m.height,m.color,A.color)):B?(s(m.height,m.color,A.color),o(m.height,A.color)):s(m.height,m.color,A.color),f+=I?2:1,d+=S?2:1}else if(l(m)&&l(A)&&l(b)&&m.height<A.height){let S=_ge(m.height,b,A,Llt);l(x)?l(C)?s(m.height,m.color,S):(s(m.height,m.color,S),o(m.height,S)):(o(m.height,S),s(m.height,m.color,S)),f++}else if(l(A)&&l(m)&&l(x)&&A.height<m.height){let S=_ge(A.height,x,m,Blt);l(b)?l(T)?s(A.height,S,A.color):(s(A.height,S,A.color),o(A.height,S)):(o(A.height,S),s(A.height,S,A.color)),d++}else l(m)&&(!l(A)||m.height<A.height)?(l(A)&&!l(b)&&!l(C)?(o(m.height,m.color),o(m.height,Ol._emptyColor),o(A.height,Ol._emptyColor)):(!l(A)&&l(b)&&!l(x)&&(o(b.height,Ol._emptyColor),o(m.height,Ol._emptyColor)),o(m.height,m.color)),f++):l(A)&&(!l(m)||A.height<m.height)&&(o(A.height,A.color),d++)}}return gge(n)}function Ol(e){e=y(e,y.EMPTY_OBJECT);let t=e.scene,n=e.layers,i=Vlt(n),r=i.length,o,s,a,c;if(!Ol._useFloatTexture(t.context))for(a=qe.UNSIGNED_BYTE,c=ct.RGBA,s=new Uint8Array(r*4),o=0;o<r;o++)se.packFloat(i[o].height,pge),se.pack(pge,s,o*4);else for(a=qe.FLOAT,c=ct.LUMINANCE,s=new Float32Array(r),o=0;o<r;o++)s[o]=i[o].height;let f=wt.create({context:t.context,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new on({wrapS:mn.CLAMP_TO_EDGE,wrapT:mn.CLAMP_TO_EDGE,minificationFilter:It.NEAREST,magnificationFilter:Xi.NEAREST})}),d=new Uint8Array(r*4);for(o=0;o<r;o++)i[o].color.toBytes(o1),d[o*4+0]=o1[0],d[o*4+1]=o1[1],d[o*4+2]=o1[2],d[o*4+3]=o1[3];let p=wt.create({context:t.context,pixelFormat:ct.RGBA,pixelDatatype:qe.UNSIGNED_BYTE,source:{arrayBufferView:d,width:r,height:1},sampler:new on({wrapS:mn.CLAMP_TO_EDGE,wrapT:mn.CLAMP_TO_EDGE,minificationFilter:It.LINEAR,magnificationFilter:Xi.LINEAR})});return cr.fromType("ElevationBand",{heights:f,colors:p})}Ol._useFloatTexture=function(e){return e.floatingPointTexture};Ol._maximumHeight=5906376425472;Ol._minimumHeight=-5906376425472;Ol._emptyColor=new z(0,0,0,0);var yge=Ol;function klt(e){e=rt(e,{url:Dh.fromAssetId(96188)});let t=new Cf(e),n=e.style;if(!l(n)){let i=y(e.defaultColor,z.WHITE).toCssColorString();n=new TE({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var xge=klt;function Ult(e){e=y(e,y.EMPTY_OBJECT);let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,r=N.clone(y(e.modelMatrix,N.IDENTITY)),o=y(e.length,1e4);if(l(i.normal)&&t.push(new pt({geometry:Bn.createLineSegmentsForVectors(n,"normal",o),attributes:{color:new Ot(1,0,0,1)},modelMatrix:r})),l(i.tangent)&&t.push(new pt({geometry:Bn.createLineSegmentsForVectors(n,"tangent",o),attributes:{color:new Ot(0,1,0,1)},modelMatrix:r})),l(i.bitangent)&&t.push(new pt({geometry:Bn.createLineSegmentsForVectors(n,"bitangent",o),attributes:{color:new Ot(0,0,1,1)},modelMatrix:r})),t.length>0)return new Tn({asynchronous:!1,geometryInstances:t,appearance:new rn({flat:!0,translucent:!1})})}var Cge=Ult;var Age=/{[^}]+}/g,Tge={x:Wlt,y:qlt,z:Klt,s:$lt,reverseX:jlt,reverseY:Ylt,reverseZ:Xlt,westDegrees:Zlt,southDegrees:Jlt,eastDegrees:Qlt,northDegrees:eut,westProjected:tut,southProjected:nut,eastProjected:iut,northProjected:rut,width:out,height:sut},zlt=rt(Tge,{i:aut,j:cut,reverseI:lut,reverseJ:uut,longitudeDegrees:dut,latitudeDegrees:hut,longitudeProjected:mut,latitudeProjected:put,format:gut});function wE(e){this._errorEvent=new ge,this._resource=void 0,this._urlSchemeZeroPadding=void 0,this._pickFeaturesResource=void 0,this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._minimumLevel=void 0,this._tilingScheme=void 0,this._rectangle=void 0,this._tileDiscardPolicy=void 0,this._credit=void 0,this._hasAlphaChannel=void 0,this._readyPromise=void 0,this._tags=void 0,this._pickFeaturesTags=void 0,this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,this.enablePickFeatures=!0,this.reinitialize(e)}Object.defineProperties(wE.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return l(this._resource)}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}});wE.prototype.reinitialize=function(e){let t=this;t._readyPromise=Promise.resolve(e).then(function(n){let i=n.customTags,r=rt(Tge,i),o=rt(zlt,i),s=De.createIfNeeded(n.url),a=De.createIfNeeded(n.pickFeaturesUrl);t.enablePickFeatures=y(n.enablePickFeatures,t.enablePickFeatures),t._urlSchemeZeroPadding=y(n.urlSchemeZeroPadding,t.urlSchemeZeroPadding),t._tileDiscardPolicy=n.tileDiscardPolicy,t._getFeatureInfoFormats=n.getFeatureInfoFormats,t._subdomains=n.subdomains,Array.isArray(t._subdomains)?t._subdomains=t._subdomains.slice():l(t._subdomains)&&t._subdomains.length>0?t._subdomains=t._subdomains.split(""):t._subdomains=["a","b","c"],t._tileWidth=y(n.tileWidth,256),t._tileHeight=y(n.tileHeight,256),t._minimumLevel=y(n.minimumLevel,0),t._maximumLevel=n.maximumLevel,t._tilingScheme=y(n.tilingScheme,new is({ellipsoid:n.ellipsoid})),t._rectangle=y(n.rectangle,t._tilingScheme.rectangle),t._rectangle=he.intersection(t._rectangle,t._tilingScheme.rectangle),t._hasAlphaChannel=y(n.hasAlphaChannel,!0);let c=n.credit;return typeof c=="string"&&(c=new Gt(c)),t._credit=c,t._resource=s,t._tags=r,t._pickFeaturesResource=a,t._pickFeaturesTags=o,!0})};wE.prototype.getTileCredits=function(e,t,n){};wE.prototype.requestImage=function(e,t,n,i){return Il.loadImage(this,Hlt(this,e,t,n,i))};wE.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let o=0,s=this;function a(u,f){return u.callback(f)}function c(){if(o>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[o],f=Glt(s,e,t,n,i,r,u.format);return++o,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(c)}return c()};var zk=!1,Su=new he,Hk=!1,s1=new he;function Hlt(e,t,n,i,r){zk=!1,Hk=!1;let o=e._resource,s=o.getUrlComponent(!0),a=e._tags,c={},u=s.match(Age);return l(u)&&u.forEach(function(f){let d=f.substring(1,f.length-1);l(a[d])&&(c[d]=a[d](e,t,n,i))}),o.getDerivedResource({request:r,templateValues:c})}var kq=!1,SE=new W,Uq=!1;function Glt(e,t,n,i,r,o,s){zk=!1,Hk=!1,kq=!1,Uq=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match(Age);return l(d)&&d.forEach(function(p){let g=p.substring(1,p.length-1);l(u[g])&&(f[g]=u[g](e,t,n,i,r,o,s))}),a.getDerivedResource({templateValues:f})}function vE(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let r=i.length;r>1&&(n=n.length>=r?n:new Array(r-n.toString().length+1).join("0")+n)}}return n}function Wlt(e,t,n,i){return vE(e,"{x}",t)}function jlt(e,t,n,i){let r=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return vE(e,"{reverseX}",r)}function qlt(e,t,n,i){return vE(e,"{y}",n)}function Ylt(e,t,n,i){let r=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return vE(e,"{reverseY}",r)}function Xlt(e,t,n,i){let r=e.maximumLevel,o=l(r)&&i<r?r-i-1:i;return vE(e,"{reverseZ}",o)}function Klt(e,t,n,i){return vE(e,"{z}",i)}function $lt(e,t,n,i){let r=(t+n+i)%e._subdomains.length;return e._subdomains[r]}function Gk(e,t,n,i){zk||(e.tilingScheme.tileXYToRectangle(t,n,i,Su),Su.west=M.toDegrees(Su.west),Su.south=M.toDegrees(Su.south),Su.east=M.toDegrees(Su.east),Su.north=M.toDegrees(Su.north),zk=!0)}function Zlt(e,t,n,i){return Gk(e,t,n,i),Su.west}function Jlt(e,t,n,i){return Gk(e,t,n,i),Su.south}function Qlt(e,t,n,i){return Gk(e,t,n,i),Su.east}function eut(e,t,n,i){return Gk(e,t,n,i),Su.north}function Wk(e,t,n,i){Hk||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,s1),Hk=!0)}function tut(e,t,n,i){return Wk(e,t,n,i),s1.west}function nut(e,t,n,i){return Wk(e,t,n,i),s1.south}function iut(e,t,n,i){return Wk(e,t,n,i),s1.east}function rut(e,t,n,i){return Wk(e,t,n,i),s1.north}function out(e,t,n,i){return e.tileWidth}function sut(e,t,n,i){return e.tileHeight}function aut(e,t,n,i,r,o,s){return jk(e,t,n,i,r,o),SE.x}function cut(e,t,n,i,r,o,s){return jk(e,t,n,i,r,o),SE.y}function lut(e,t,n,i,r,o,s){return jk(e,t,n,i,r,o),e.tileWidth-SE.x-1}function uut(e,t,n,i,r,o,s){return jk(e,t,n,i,r,o),e.tileHeight-SE.y-1}var fut=new he,EE=new h;function jk(e,t,n,i,r,o,s){if(kq)return;zq(e,t,n,i,r,o);let a=EE,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,fut);SE.x=e.tileWidth*(a.x-c.west)/c.width|0,SE.y=e.tileHeight*(c.north-a.y)/c.height|0,kq=!0}function dut(e,t,n,i,r,o,s){return M.toDegrees(r)}function hut(e,t,n,i,r,o,s){return M.toDegrees(o)}function mut(e,t,n,i,r,o,s){return zq(e,t,n,i,r,o),EE.x}function put(e,t,n,i,r,o,s){return zq(e,t,n,i,r,o),EE.y}var _ut=new me;function zq(e,t,n,i,r,o,s){if(!Uq){if(e.tilingScheme.projection instanceof Ii)EE.x=M.toDegrees(r),EE.y=M.toDegrees(o);else{let a=_ut;a.longitude=r,a.latitude=o,e.tilingScheme.projection.project(a,EE)}Uq=!0}}function gut(e,t,n,i,r,o,s){return s}var oc=wE;function aC(e){e=y(e,y.EMPTY_OBJECT),this._tmsResource=void 0,this._xmlResource=void 0,this._options=e,this._metadataError=void 0,this._metadataSuccess=this._metadataSuccess.bind(this),this._metadataFailure=this._metadataFailure.bind(this),this._requestMetadata=this._requestMetadata.bind(this);let t,n=this,i=Promise.resolve(e.url).then(function(r){return t=De.createIfNeeded(r),t.appendForwardSlash(),n._tmsResource=t,n._xmlResource=t.getDerivedResource({url:"tilemapresource.xml"}),n._requestMetadata()}).catch(r=>Promise.reject(r));oc.call(this,i),this._promise=i}l(Object.create)&&(aC.prototype=Object.create(oc.prototype),aC.prototype.constructor=aC);aC.prototype._requestMetadata=function(){return this._xmlResource.fetchXML().then(this._metadataSuccess).catch(e=>e instanceof Bm?this._metadataFailure():Promise.reject(e))};function bge(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function Ege(e,t,n){let i=e.positionToTileXY(he.southwest(t),n),r=e.positionToTileXY(he.northeast(t),n);return(Math.abs(r.x-i.x)+1)*(Math.abs(r.y-i.y)+1)>4?0:n}aC.prototype._metadataSuccess=function(e){let t=/tileformat/i,n=/tileset/i,i=/tilesets/i,r=/boundingbox/i,o,s,a,c=[],u=this._xmlResource,f=this._metadataError,d=this._requestMetadata,p=e.childNodes[0].childNodes;for(let O=0;O<p.length;O++)if(t.test(p.item(O).nodeName))o=p.item(O);else if(i.test(p.item(O).nodeName)){a=p.item(O);let B=p.item(O).childNodes;for(let L=0;L<B.length;L++)n.test(B.item(L).nodeName)&&c.push(B.item(L))}else r.test(p.item(O).nodeName)&&(s=p.item(O));let g;if(!l(a)||!l(s))return g=`Unable to find expected tilesets or bbox attributes in ${u.url}.`,f=jn.reportError(f,this,this.errorEvent,g),f.retry?(this._metadataError=f,d()):Promise.reject(new fe(g));let m=this._options,x=y(m.fileExtension,o.getAttribute("extension")),C=y(m.tileWidth,parseInt(o.getAttribute("width"),10)),A=y(m.tileHeight,parseInt(o.getAttribute("height"),10)),b=y(m.minimumLevel,parseInt(c[0].getAttribute("order"),10)),T=y(m.maximumLevel,parseInt(c[c.length-1].getAttribute("order"),10)),S=a.getAttribute("profile"),w=m.tilingScheme;if(!l(w))if(S==="geodetic"||S==="global-geodetic")w=new Qi({ellipsoid:m.ellipsoid});else if(S==="mercator"||S==="global-mercator")w=new is({ellipsoid:m.ellipsoid});else return g=`${u.url}specifies an unsupported profile attribute, ${S}.`,f=jn.reportError(f,this,this.errorEvent,g),f.retry?(this._metadataError=f,d()):Promise.reject(new fe(g));let D=he.clone(m.rectangle);if(!l(D)){let O,B,L,_;y(m.flipXY,!1)?(L=new W(parseFloat(s.getAttribute("miny")),parseFloat(s.getAttribute("minx"))),_=new W(parseFloat(s.getAttribute("maxy")),parseFloat(s.getAttribute("maxx")))):(L=new W(parseFloat(s.getAttribute("minx")),parseFloat(s.getAttribute("miny"))),_=new W(parseFloat(s.getAttribute("maxx")),parseFloat(s.getAttribute("maxy"))));let v=S==="geodetic"||S==="mercator";if(w.projection instanceof Ii||v)O=me.fromDegrees(L.x,L.y),B=me.fromDegrees(_.x,_.y);else{let P=w.projection;O=P.unproject(L),B=P.unproject(_)}D=new he(O.longitude,O.latitude,B.longitude,B.latitude)}D=bge(D,w),b=Ege(w,D,b);let I=this._tmsResource.getDerivedResource({url:`{z}/{x}/{reverseY}.${x}`});return Promise.resolve({url:I,tilingScheme:w,rectangle:D,tileWidth:C,tileHeight:A,minimumLevel:b,maximumLevel:T,tileDiscardPolicy:m.tileDiscardPolicy,credit:m.credit})};aC.prototype._metadataFailure=function(){let e=this._options,t=y(e.fileExtension,"png"),n=y(e.tileWidth,256),i=y(e.tileHeight,256),r=e.maximumLevel,o=l(e.tilingScheme)?e.tilingScheme:new is({ellipsoid:e.ellipsoid}),s=y(e.rectangle,o.rectangle);s=bge(s,o);let a=Ege(o,s,e.minimumLevel),c=this._tmsResource.getDerivedResource({url:`{z}/{x}/{reverseY}.${t}`});return Promise.resolve({url:c,tilingScheme:o,rectangle:s,tileWidth:n,tileHeight:i,minimumLevel:a,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit})};var cC=aC;function Lf(e){e=y(e,{}),this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=1.9,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0;let t=e.url,n=y(e.path,"/default_map"),i=De.createIfNeeded(t).getDerivedResource({url:n[0]==="/"?n.substring(1):n});i.appendForwardSlash(),this._resource=i,this._url=t,this._path=n,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new Gt(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Lf.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new ge,this._ready=!1;let r=i.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),o=this,s;function a(f){let d;try{d=JSON.parse(f)}catch{d=JSON.parse(f.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let p;for(let m=0;m<d.layers.length;m++)if(d.layers[m].id===o._channel){p=d.layers[m];break}let g;if(!l(p))return g=`Could not find layer with channel (id) of ${o._channel}.`,s=jn.reportError(s,o,o._errorEvent,g),s.retry?u():Promise.reject(new fe(g));if(!l(p.version))return g=`Could not find a version in channel (id) ${o._channel}.`,s=jn.reportError(s,o,o._errorEvent,g),s.retry?u():Promise.reject(new fe(g));if(o._version=p.version,l(d.projection)&&d.projection==="flat")o._tilingScheme=new Qi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new he(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:e.ellipsoid});else if(!l(d.projection)||d.projection==="mercator")o._tilingScheme=new is({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid});else return g=`Unsupported projection ${d.projection}.`,s=jn.reportError(s,o,o._errorEvent,g),s.retry?u():Promise.reject(new fe(g));return o._ready=!0,jn.reportSuccess(s),Promise.resolve(!0)}function c(f){let d=y(f.message,`An error occurred while accessing ${r.url}.`);return s=jn.reportError(s,o,o._errorEvent,d),Promise.reject(new fe(d))}function u(){return r.fetchText().then(a).catch(c)}this._readyPromise=u()}Object.defineProperties(Lf.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});Lf.prototype.getTileCredits=function(e,t,n){};Lf.prototype.requestImage=function(e,t,n,i){let r=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return Il.loadImage(this,r)};Lf.prototype.pickFeatures=function(e,t,n,i,r){};Lf._logoUrl=void 0;Object.defineProperties(Lf,{logoUrl:{get:function(){return l(Lf._logoUrl)||(Lf._logoUrl=Qt("Assets/Images/google_earth_credit.png")),Lf._logoUrl},set:function(e){Lf._logoUrl=e}}});var qk=Lf;var yut=/\/$/,Sge=new Gt('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function DE(e){e=y(e,y.EMPTY_OBJECT);let t=e.mapId,n=e.accessToken;this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0;let i=De.createIfNeeded(y(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=n;let r=y(e.format,"png");/\./.test(r)||(r=`.${r}`),this._format=r;let o=i.getUrlComponent();yut.test(o)||(o+="/"),o+=`${t}/{z}/{x}/{y}${this._format}`,i.url=o,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new Gt(s))):s=Sge,this._resource=i,this._imageryProvider=new oc({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(DE.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return this._imageryProvider.ready}},readyPromise:{get:function(){return this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});DE.prototype.getTileCredits=function(e,t,n){};DE.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};DE.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};DE._defaultCredit=Sge;var Yk=DE;function a1(e){e=y(e,y.EMPTY_OBJECT),this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0;let t=De.createIfNeeded(e.url),n=y(e.rectangle,he.MAX_VALUE),i=new Qi({rectangle:n,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=i,this._resource=t,this._image=void 0,this._texture=void 0,this._tileWidth=0,this._tileHeight=0,this._errorEvent=new ge,this._ready=!1;let r=e.credit;typeof r=="string"&&(r=new Gt(r)),this._credit=r;let o=this,s;function a(f){return o._image=f,o._tileWidth=f.width,o._tileHeight=f.height,o._ready=!0,jn.reportSuccess(o._errorEvent),Promise.resolve(!0)}function c(f){let d=`Failed to load image ${t.url}.`;return s=jn.reportError(s,o,o._errorEvent,d,0,0,0),s.retry?u():Promise.reject(new fe(d))}function u(){return Il.loadImage(null,t).then(a).catch(c)}this._readyPromise=u()}Object.defineProperties(a1.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});a1.prototype.getTileCredits=function(e,t,n){};a1.prototype.requestImage=function(e,t,n,i){if(!!l(this._image))return Promise.resolve(this._image)};a1.prototype.pickFeatures=function(e,t,n,i,r){};var Xk=a1;function xut(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=Cut:e==="xml"?n=Eut:(e==="html"||e==="text")&&(n=wge)),this.callback=n}function Cut(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let r=n[i],o=new Tm;if(o.data=r,o.properties=r.properties,o.configureNameFromProperties(r.properties),o.configureDescriptionFromProperties(r.properties),l(r.geometry)&&r.geometry.type==="Point"){let s=r.geometry.coordinates[0],a=r.geometry.coordinates[1];o.position=me.fromDegrees(s,a)}t.push(o)}return t}var Hq="http://www.mapinfo.com/mxp",Aut="http://www.esri.com/wms",Tut="http://www.opengis.net/wfs",but="http://www.opengis.net/gml";function Eut(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===Hq)return Sut(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Aut)return wut(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===Tut)return vut(e);if(t.localName==="ServiceExceptionReport")throw new fe(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Dut(e):Put(e)}function Sut(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Hq,"Feature");for(let r=0;r<i.length;++r){let o=i[r],s={},a=o.getElementsByTagNameNS(Hq,"Val");for(let u=0;u<a.length;++u){let f=a[u];if(f.hasAttribute("ref")){let d=f.getAttribute("ref"),p=f.textContent.trim();s[d]=p}}let c=new Tm;c.data=o,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function wut(e){let t=e.documentElement,n=[],i,r=t.getElementsByTagNameNS("*","FIELDS");if(r.length>0)for(let o=0;o<r.length;++o){let s=r[o];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let u=a[c];i[u.name]=u.value}n.push(Kk(s,i))}else{let o=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<o.length;++s){let a=o[s];i={};let c=a.childNodes;for(let u=0;u<c.length;++u){let f=c[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(Kk(a,i))}}return n}function vut(e){let t=[],i=e.documentElement.getElementsByTagNameNS(but,"featureMember");for(let r=0;r<i.length;++r){let o=i[r],s={};Gq(o,s),t.push(Kk(o,s))}return t}function Dut(e){let t=[],n,i=e.documentElement.childNodes;for(let o=0;o<i.length;o++)if(i[o].nodeType===Node.ELEMENT_NODE){n=i[o];break}if(!l(n))throw new fe("Unable to find first child of the feature info xml document");let r=n.childNodes;for(let o=0;o<r.length;++o){let s=r[o];if(s.nodeType===Node.ELEMENT_NODE){let a={};Gq(s,a),t.push(Kk(s,a))}}return t}function Gq(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let r=e.childNodes[i];r.nodeType===Node.ELEMENT_NODE&&(n=!1),!(r.localName==="Point"||r.localName==="LineString"||r.localName==="Polygon"||r.localName==="boundedBy")&&r.hasChildNodes()&&Gq(r,t)&&(t[r.localName]=r.textContent)}return n}function Kk(e,t){let n=new Tm;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Put(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let r=new Tm;return r.data=e,r.description=n.innerHTML,[r]}var Iut=/<body>\s*<\/body>/im,Out=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Rut=/<title>([\s\S]*)<\/title>/im;function wge(e){if(Iut.test(e)||Out.test(e))return;let t,n=Rut.exec(e);n&&n.length>1&&(t=n[1]);let i=new Tm;return i.name=t,i.description=e,i.data=e,[i]}var PE=xut;function c1(e){e=y(e,y.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(c1.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});c1.prototype.getFromCache=function(e,t,n,i){let r=vge(e,t,n),o,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[r])){let a=s[r];o=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[r]}return o};c1.prototype.checkApproachingInterval=function(e,t,n,i){let r=vge(e,t,n),o=this._tilesRequestedForInterval,s=Dge(this),a={key:r,priorityFunction:i.priorityFunction};(!l(s)||!Pge(this,a,s))&&o.push(a),o.length>=512&&o.splice(0,256)};c1.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),r=this._currentIntervalIndex;if(i!==r){let s=this._tileCache[r];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[r],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let o=Dge(this);if(l(o)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=Pge(this,c,o),a||s.push(c)}}};function vge(e,t,n){return`${e}-${t}-${n}`}function Mut(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function Dge(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,r=n.canAnimate&&n.shouldAnimate,o=n.multiplier;if(!r&&o!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return o>0?(s=ee.secondsDifference(c.stop,i),++a):(s=ee.secondsDifference(c.start,i),--a),s/=o,a>=0&&s<=5?t.get(a):void 0}function Pge(e,t,n){let i=e._times.indexOf(n.start),r=e._tileCache,o=r[i];l(o)||(o=r[i]={});let s=t.key;if(l(o[s]))return!0;let a=Mut(s),c=new oo({throttle:!1,throttleByServer:!0,type:ro.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(u)?(o[s]={promise:u,request:c},!0):!1}var IE=c1;var But=[3034,3035,3042,3043,3044],Lut=[4471,4559];function Jd(e){if(e=y(e,y.EMPTY_OBJECT),l(e.times)&&!l(e.clock))throw new ye("options.times was specified, so options.clock is required.");this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=y(e.getFeatureInfoUrl,e.url);let t=De.createIfNeeded(e.url),n=De.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(Jd.DefaultParameters,!0),n.setQueryParameters(Jd.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(Ige(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(Ige(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new IE({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return Oge(i,s,a,c,u,f)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let r={};if(r.layers=e.layers,r.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",r.width="{width}",r.height="{height}",parseFloat(t.queryParameters.version)>=1.3){r.crs=y(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof ji?"EPSG:3857":"CRS:84");let s=r.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!Lut.includes(a)||But.includes(a))&&(r.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else r.srs=y(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof ji?"EPSG:3857":"EPSG:4326");t.setQueryParameters(r,!0),n.setQueryParameters(r,!0);let o={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(o.i="{i}",o.j="{j}"):(o.x="{i}",o.y="{j}"),n.setQueryParameters(o,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new oc({url:t,pickFeaturesUrl:n,tilingScheme:y(e.tilingScheme,new Qi({ellipsoid:e.ellipsoid})),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:y(e.getFeatureInfoFormats,Jd.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures})}function Oge(e,t,n,i,r,o){let s=l(o)?o.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,r)}function Nut(e,t,n,i,r,o,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,r,o)}Object.defineProperties(Jd.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},ready:{get:function(){return this._tileProvider.ready}},readyPromise:{get:function(){return this._tileProvider.readyPromise}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});Jd.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Jd.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,s;return l(o)&&(s=o.currentInterval,r=o.getFromCache(e,t,n,i)),l(r)||(r=Oge(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};Jd.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return Nut(this,e,t,n,i,r,s)};Jd.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});Jd.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});Jd.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new PE("json","application/json")),Object.freeze(new PE("xml","text/xml")),Object.freeze(new PE("text","text/html"))]);function Ige(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var $k=Jd;var Fut=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function l1(e){e=y(e,y.EMPTY_OBJECT),this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0;let t=De.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,r=t.url,o=r.match(/{/g);if(!l(o)||o.length===1&&/{s}/.test(r))t.setQueryParameters(Fut),this._useKvp=!0;else{let d={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(d),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=y(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new is({ellipsoid:e.ellipsoid}),this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;let s=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new IE({clock:e.clock,times:e.times,requestImageFunction:function(d,p,g,m,x){return Rge(s,d,p,g,m,x)},reloadFunction:function(){l(s._reload)&&s._reload()}})),this._readyPromise=Promise.resolve(!0);let a=this._tilingScheme.positionToTileXY(he.southwest(this._rectangle),this._minimumLevel),c=this._tilingScheme.positionToTileXY(he.northeast(this._rectangle),this._minimumLevel),u=(Math.abs(c.x-a.x)+1)*(Math.abs(c.y-a.y)+1);this._errorEvent=new ge;let f=e.credit;this._credit=typeof f=="string"?new Gt(f):f,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():l(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function Rge(e,t,n,i,r,o){let s=e._tileMatrixLabels,a=l(s)?s[i]:i.toString(),c=e._subdomains,u=e._dimensions,f=l(o)?o.data:void 0,d,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({request:r}),d.setTemplateValues(p),l(u)&&d.setTemplateValues(u),l(f)&&d.setTemplateValues(f);else{let g={};g.tilematrix=a,g.layer=e._layer,g.style=e._style,g.tilerow=n,g.tilecol=t,g.tilematrixset=e._tileMatrixSetID,g.format=e._format,l(u)&&(g=rt(g,u)),l(f)&&(g=rt(g,f)),p={s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({queryParameters:g,request:r}),d.setTemplateValues(p)}return Il.loadImage(e,d)}Object.defineProperties(l1.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},ready:{value:!0},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}}});l1.prototype.getTileCredits=function(e,t,n){};l1.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,s;return l(o)&&(s=o.currentInterval,r=o.getFromCache(e,t,n,i)),l(r)||(r=Rge(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};l1.prototype.pickFeatures=function(e,t,n,i,r){};var Zk=l1;function i_(e){return function(t){return new e(t)}}var Vut={ARCGIS_MAPSERVER:i_(O0),BING:i_(Ak),GOOGLE_EARTH:i_(qk),MAPBOX:i_(Yk),SINGLE_TILE:i_(Xk),TMS:i_(cC),URL_TEMPLATE:i_(oc),WMS:i_($k),WMTS:i_(Zk)};function B0(e){e=y(e,y.EMPTY_OBJECT);let t=e.assetId;this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,this._ready=!1,this._tileCredits=void 0,this._errorEvent=new ge;let n=this,i=Dh._createEndpointResource(t,e),r=e.assetId.toString()+e.accessToken+e.server,o=B0._endpointCache[r];l(o)||(o=i.fetchJson(),B0._endpointCache[r]=o),this._readyPromise=o.then(function(s){if(s.type!=="IMAGERY")return Promise.reject(new fe(`Cesium ion asset ${t} is not an imagery asset.`));let a,c=s.externalType;if(!l(c))a=new cC({url:new Dh(s,i)});else{let u=Vut[c];if(!l(u))return Promise.reject(new fe(`Unrecognized Cesium ion imagery type: ${c}`));a=u(s.options)}return n._tileCredits=Dh.getCreditsFromEndpoint(s,i),a.errorEvent.addEventListener(function(u){u.provider=n,n._errorEvent.raiseEvent(u)}),n._imageryProvider=a,a.readyPromise.then(function(){return n._ready=!0,!0})})}Object.defineProperties(B0.prototype,{ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel},proxy:{get:function(){}}}});B0.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};B0.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};B0.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};B0._endpointCache={};var L0=B0;var kut={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},N0=Object.freeze(kut);function Uut(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.style,N0.AERIAL);return new L0({assetId:t})}var F0=Uut;var Mge=576,zut=100,u1="#ffffff",Wq="#48b";function Fge(e,t){this.credit=e,this.count=y(t,1)}function Hut(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i];if(Gt.equals(r,t))return!0}return!1}function Gut(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;Gt.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var Vge="cesium-credit-delimiter";function Bge(e){let t=document.createElement("span");return t.textContent=e,t.className=Vge,t}function Lge(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function Nge(e,t,n,i){let r=e.childNodes,o=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(o=s,l(n)&&(o*=2,s>0)){let u=o-1;if(r.length<=u)e.appendChild(Bge(n));else{let f=r[u];f.className!==Vge&&e.replaceChild(Bge(n),f)}}let c=a.element;if(r.length<=o)e.appendChild(Lge(c,i));else{let u=r[o];u._creditId!==a._id&&e.replaceChild(Lge(c,i),u)}}}for(++o;o<r.length;)e.removeChild(r[o])}function Wut(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<Mge?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=Mge&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function sc(e,t){let n=`${e} {`;for(let i in t)t.hasOwnProperty(i)&&(n+=`${i}: ${t[i]}; `);return n+=` }
- `,n}function jut(){let e="";e+=sc(".cesium-credit-lightbox-overlay",{display:"none","z-index":"1",position:"absolute",top:"0",left:"0",width:"100%",height:"100%","background-color":"rgba(80, 80, 80, 0.8)"}),e+=sc(".cesium-credit-lightbox",{"background-color":"#303336",color:u1,position:"relative","min-height":`${zut}px`,margin:"auto"}),e+=sc(".cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited",{color:u1}),e+=sc(".cesium-credit-lightbox > ul > li a:hover",{color:Wq}),e+=sc(".cesium-credit-lightbox.cesium-credit-lightbox-expanded",{border:"1px solid #444","border-radius":"5px","max-width":"370px"}),e+=sc(".cesium-credit-lightbox.cesium-credit-lightbox-mobile",{height:"100%",width:"100%"}),e+=sc(".cesium-credit-lightbox-title",{padding:"20px 20px 0 20px"}),e+=sc(".cesium-credit-lightbox-close",{"font-size":"18pt",cursor:"pointer",position:"absolute",top:"0",right:"6px",color:u1}),e+=sc(".cesium-credit-lightbox-close:hover",{color:Wq}),e+=sc(".cesium-credit-lightbox > ul",{margin:"0",padding:"12px 20px 12px 40px","font-size":"13px"}),e+=sc(".cesium-credit-lightbox > ul > li",{"padding-bottom":"6px"}),e+=sc(".cesium-credit-lightbox > ul > li *",{padding:"0",margin:"0"}),e+=sc(".cesium-credit-expand-link",{"padding-left":"5px",cursor:"pointer","text-decoration":"underline",color:u1}),e+=sc(".cesium-credit-expand-link:hover",{color:Wq}),e+=sc(".cesium-credit-text",{color:u1}),e+=sc(".cesium-credit-textContainer *, .cesium-credit-logoContainer *",{display:"inline"});let t=document.head,n=document.createElement("style");n.innerHTML=e,t.insertBefore(n,t.firstChild)}function vo(e,t,n){let i=this;n=y(n,document.body);let r=document.createElement("div");r.className="cesium-credit-lightbox-overlay",n.appendChild(r);let o=document.createElement("div");o.className="cesium-credit-lightbox",r.appendChild(o);function s(m){o.contains(m.target)||i.hideLightbox()}r.addEventListener("click",s,!1);let a=document.createElement("div");a.className="cesium-credit-lightbox-title",a.textContent="Data provided by:",o.appendChild(a);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="×",c.className="cesium-credit-lightbox-close",o.appendChild(c);let u=document.createElement("ul");o.appendChild(u);let f=document.createElement("div");f.className="cesium-credit-logoContainer",f.style.display="inline",e.appendChild(f);let d=document.createElement("div");d.className="cesium-credit-textContainer",d.style.display="inline",e.appendChild(d);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),jut();let g=Gt.clone(vo.cesiumCredit);this._delimiter=y(t," \u2022 "),this._screenContainer=d,this._cesiumCreditContainer=f,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=o,this._creditList=u,this._lightbox=r,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._defaultCredits=[],this._cesiumCredit=g,this._previousCesiumCredit=void 0,this._currentCesiumCredit=g,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new xt,lightboxCredits:new xt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function kge(e,t,n,i){i=y(i,1);let r=t.get(n.id);if(l(r))r.count<Number.MAX_VALUE&&(r.count+=i);else{let o=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<o.length?(r=o[s],r.credit=n,r.count=i):(r=new Fge(n,i),o.push(r)),++e._creditDisplayElementPoolIndex,t.set(n.id,r)}}vo.prototype.addCredit=function(e){if(e._isIon){l(this._defaultCredit)||(this._defaultCredit=Gt.clone(Uge())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,kge(this,t,e)};vo.prototype.addDefaultCredit=function(e){let t=this._defaultCredits;Hut(t,e)||t.push(e)};vo.prototype.removeDefaultCredit=function(e){let t=this._defaultCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};vo.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};vo.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};vo.prototype.update=function(){this._expanded&&Wut(this)};vo.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits;t.removeAll();let n=this._defaultCredits;for(let i=0;i<n.length;++i){let r=n[i];kge(this,t,r,Number.MAX_VALUE)}e.lightboxCredits.removeAll(),Gt.equals(vo.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Gt.clone(vo.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};vo.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;Nge(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",Nge(this._creditList,t,void 0,"li"),Gut(this)};vo.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),ue(this)};vo.prototype.isDestroyed=function(){return!1};vo._cesiumCredit=void 0;vo._cesiumCreditInitialized=!1;var Jk;function Uge(){if(!l(Jk)){let e=Qt("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new oi.default(e).path()),Jk=new Gt(`<a href="https://cesium.com/" target="_blank"><img src="${e}" title="Cesium ion"/></a>`,!0)}return vo._cesiumCreditInitialized||(vo._cesiumCredit=Jk,vo._cesiumCreditInitialized=!0),Jk}Object.defineProperties(vo,{cesiumCredit:{get:function(){return Uge(),vo._cesiumCredit},set:function(e){vo._cesiumCredit=e,vo._cesiumCreditInitialized=!0}}});vo.CreditDisplayElement=Fge;var Qk=vo;function f1(e){e=y(e,y.EMPTY_OBJECT);let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=y(e.glslDatatype,"vec3"),r=`v_${t}`,o;if(t==="normal"||t==="tangent"||t==="bitangent")o=`vec4 getColor() { return vec4((${r} + vec3(1.0)) * 0.5, 1.0); }
- `;else switch(t==="st"&&(i="vec2"),i){case"float":o=`vec4 getColor() { return vec4(vec3(${r}), 1.0); }
- `;break;case"vec2":o=`vec4 getColor() { return vec4(${r}, 0.0, 1.0); }
- `;break;case"vec3":o=`vec4 getColor() { return vec4(${r}, 1.0); }
- `;break;case"vec4":o=`vec4 getColor() { return ${r}; }
- `;break}let s=`attribute vec3 position3DHigh;
- attribute vec3 position3DLow;
- attribute float batchId;
- ${n?"":`attribute ${i} ${t};
- `}varying ${i} ${r};
- void main()
- {
- vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);
- ${n?`${r} = czm_batchTable_${t}(batchId);
- `:`${r} = ${t};
- `}gl_Position = czm_modelViewProjectionRelativeToEye * p;
- }`,a=`varying ${i} ${r};
- ${o}
- void main()
- {
- gl_FragColor = getColor();
- }`;this.material=void 0,this.translucent=y(e.translucent,!1),this._vertexShaderSource=y(e.vertexShaderSource,s),this._fragmentShaderSource=y(e.fragmentShaderSource,a),this._renderState=ar.getDefaultRenderState(!1,!1,e.renderState),this._closed=y(e.closed,!1),this._attributeName=t,this._glslDatatype=i}Object.defineProperties(f1.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});f1.prototype.getFragmentShaderSource=ar.prototype.getFragmentShaderSource;f1.prototype.isTranslucent=ar.prototype.isTranslucent;f1.prototype.getRenderState=ar.prototype.getRenderState;var zge=f1;function eU(e){e=y(e,y.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=y(e.color,z.CYAN),this._updateOnChange=y(e.updateOnChange,!0),this.show=y(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var qut=new h,Yut=new Q,Xut=new Re,Kut=new bi,$ut=new cl,Zut=new en,Jut=new Xo,Qut=new z,eft=[1,1e5];eU.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,r;if(this._updateOnChange){for(r=t.length,i=0;i<r;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let o=this._camera,s=o.frustum,a;s instanceof bi?a=Kut:s instanceof cl?a=$ut:s instanceof en?a=Zut:a=Jut,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=eft,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=o.positionWC,d=o.directionWC,p=o.upWC,g=o.rightWC;g=h.negate(g,qut);let m=Yut;Q.setColumn(m,0,g,m),Q.setColumn(m,1,p,m),Q.setColumn(m,2,d,m);let x=Re.fromRotationMatrix(m,Xut);for(t.length=n.length=c,i=0;i<c;++i)a.near=u[i],a.far=u[i+1],t[i]=new Tn({geometryInstances:new pt({geometry:new GA({origin:f,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Ot.fromColor(z.fromAlpha(this._color,.1,Qut))},id:this.id,pickPrimitive:this}),appearance:new rn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Tn({geometryInstances:new pt({geometry:new oO({origin:f,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Ot.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})}for(r=t.length,i=0;i<r;++i)n[i].update(e),t[i].update(e)};eU.prototype.isDestroyed=function(){return!1};eU.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return ue(this)};var r_=eU;function Hge(){this._cachedShowFrustumsShaders={}}function tft(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function nft(e,t){let n=e.context,i=t,r=i.fragmentShaderSource.clone(),o=[];r.sources=r.sources.map(function(f){f=Fe.replaceMain(f,"czm_Debug_main");let d=/gl_FragData\[(\d+)\]/g,p;for(;(p=d.exec(f))!==null;)o.indexOf(p[1])===-1&&o.push(p[1]);return f});let s=o.length,a="";a+=`uniform vec3 debugShowCommandsColor;
- `,a+=`uniform vec3 debugShowFrustumsColor;
- `,a+=`void main()
- {
- czm_Debug_main();
- `;let c;if(s>0)for(c=0;c<s;++c)a+=` gl_FragData[${o[c]}].rgb *= debugShowCommandsColor;
- `,a+=` gl_FragData[${o[c]}].rgb *= debugShowFrustumsColor;
- `;else a+=` gl_FragColor.rgb *= debugShowCommandsColor;
- `,a+=` gl_FragColor.rgb *= debugShowFrustumsColor;
- `;a+="}",r.sources.push(a);let u=tft(i);return Wt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:r,attributeLocations:u})}var d1=new z;function ift(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=z.fromRandom()),t._debugColor):z.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(d1.red=t.debugOverlappingFrustums&1<<0?1:0,d1.green=t.debugOverlappingFrustums&1<<1?1:0,d1.blue=t.debugOverlappingFrustums&1<<2?1:0,d1.alpha=1,d1):z.WHITE}),n}var rft=new Ze;Hge.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,r=this._cachedShowFrustumsShaders[i];l(r)||(r=nft(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=r);let o=Ze.shallowClone(t,rft);o.shaderProgram=r,o.uniformMap=ift(e,t),o.execute(e.context,n)};var tU=Hge;function nU(e){e=y(e,y.EMPTY_OBJECT),this.length=y(e.length,1e7),this._length=void 0,this.width=y(e.width,2),this._width=void 0,this.show=y(e.show,!0),this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this._modelMatrix=new N,this.id=e.id,this._id=void 0,this._primitive=void 0}nU.prototype.update=function(e){if(!!this.show){if(!l(this._primitive)||!N.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=N.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new pt({geometry:new Z_({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:os.VERTEX_FORMAT,colors:[z.RED,z.RED],arcType:Kt.NONE}),modelMatrix:N.multiplyByUniformScale(this.modelMatrix,this.length,new N),id:this.id,pickPrimitive:this}),n=new pt({geometry:new Z_({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:os.VERTEX_FORMAT,colors:[z.GREEN,z.GREEN],arcType:Kt.NONE}),modelMatrix:N.multiplyByUniformScale(this.modelMatrix,this.length,new N),id:this.id,pickPrimitive:this}),i=new pt({geometry:new Z_({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:os.VERTEX_FORMAT,colors:[z.BLUE,z.BLUE],arcType:Kt.NONE}),modelMatrix:N.multiplyByUniformScale(this.modelMatrix,this.length,new N),id:this.id,pickPrimitive:this});this._primitive=new Tn({geometryInstances:[t,n,i],appearance:new os,asynchronous:!1})}this._primitive.update(e)}};nU.prototype.isDestroyed=function(){return!1};nU.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var iU=nU;var rU=`varying vec4 positionEC;
- void main()
- {
- vec3 position;
- vec3 direction;
- if (czm_orthographicIn3D == 1.0)
- {
- vec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw;
- vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y);
- vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x);
- position = vec3(mix(minPlane, maxPlane, uv), 0.0);
- direction = vec3(0.0, 0.0, -1.0);
- }
- else
- {
- position = vec3(0.0);
- direction = normalize(positionEC.xyz);
- }
- czm_ray ray = czm_ray(position, direction);
- vec3 ellipsoid_center = czm_view[3].xyz;
- czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);
- if (!czm_isEmpty(intersection))
- {
- gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
- }
- else
- {
- discard;
- }
- czm_writeLogDepth();
- }
- `;var oU=`attribute vec4 position;
- varying vec4 positionEC;
- void main()
- {
- positionEC = czm_modelView * position;
- gl_Position = czm_projection * positionEC;
- czm_vertexLogDepth();
- }
- `;function m1(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=y(e,0)}var h1=Et.supportsTypedArrays()?new Float32Array(12):[],Gge=new h,Wge=new h,jq=new h,jge=new h,sU=new h;function oft(e,t){let n=e.radii,i=t.camera,r,o,s;if(i.frustum instanceof en)r=h.ZERO,o=i.rightWC,s=i.upWC;else{let d=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,d,Gge),g=h.normalize(p,Wge),m=h.normalize(h.cross(h.UNIT_Z,p,jq),jq),x=h.normalize(h.cross(g,m,jge),jge),C=h.magnitude(p),A=Math.sqrt(C*C-1);r=h.multiplyByScalar(g,1/C,Gge);let b=A/C;o=h.multiplyByScalar(m,b,Wge),s=h.multiplyByScalar(x,b,jq)}let a=h.add(r,s,sU);h.subtract(a,o,a),h.multiplyComponents(n,a,a),h.pack(a,h1,0);let c=h.subtract(r,s,sU);h.subtract(c,o,c),h.multiplyComponents(n,c,c),h.pack(c,h1,3);let u=h.add(r,s,sU);h.add(u,o,u),h.multiplyComponents(n,u,u),h.pack(u,h1,6);let f=h.subtract(r,s,sU);return h.add(f,o,f),h.multiplyComponents(n,f,f),h.pack(f,h1,9),h1}m1.prototype.update=function(e){if(this._mode=e.mode,e.mode!==te.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new oe(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),r=e.useLogDepth;if(l(this._command)||(this._rs=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new Ze({renderState:this._rs,boundingVolume:new re(h.ZERO,i.maximumRadius),pass:Ce.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==r){this._useLogDepth=r;let s=new Fe({sources:[oU]}),a=new Fe({sources:[rU]});if(r){let c=`#ifdef GL_EXT_frag_depth
- #extension GL_EXT_frag_depth : enable
- #endif
- `;a.sources.push(c),a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")}this._sp=Wt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let o=oft(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(o);else{let s=new ot({attributes:{position:new Ee({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:o})},indices:[0,1,2,2,1,3],primitiveType:Me.TRIANGLES});this._va=Qn.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Ne.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};m1.prototype.execute=function(e,t){this._mode===te.SCENE3D&&this._command.execute(e,t)};m1.prototype.isDestroyed=function(){return!1};m1.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var aU=m1;function p1(){}var sft=/\bgl_FragDepthEXT\b/,aft=/\bdiscard\b/;function cft(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(!l(n)){let i=t._attributeLocations,r=t.fragmentShaderSource,o,s=!1,a=r.sources,c=a.length;for(o=0;o<c;++o)if(sft.test(a[o])||aft.test(a[o])){s=!0;break}let u=!1,f=r.defines;for(c=f.length,o=0;o<c;++o)if(f[o]==="LOG_DEPTH"){u=!0;break}let d;!s&&!u?(d=`void main()
- {
- gl_FragColor = vec4(1.0);
- }
- `,r=new Fe({sources:[d]})):!s&&u&&(d=`#ifdef GL_EXT_frag_depth
- #extension GL_EXT_frag_depth : enable
- #endif
- void main()
- {
- gl_FragColor = vec4(1.0);
- czm_writeLogDepth();
- }
- `,r=new Fe({defines:["LOG_DEPTH"],sources:[d]})),n=e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:i})}return n}function lft(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(!l(i)){let r=Ve.getState(t);r.depthMask=!0,r.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i=Ve.fromCache(r),n[t.id]=i}return i}p1.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let r,o;return l(i.depthOnlyCommand)&&(r=i.depthOnlyCommand.shaderProgram,o=i.depthOnlyCommand.renderState),i.depthOnlyCommand=Ze.shallowClone(t,i.depthOnlyCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=cft(n,t.shaderProgram),i.depthOnlyCommand.renderState=lft(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=r,i.depthOnlyCommand.renderState=o),i};var uft=/\s+czm_writeLogDepth\(/,fft=/\s+czm_vertexLogDepth\(/,dft=/\s*#extension\s+GL_EXT_frag_depth\s*:\s*enable/;function hft(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(!l(n)){let i=t._attributeLocations,r=t.vertexShaderSource.clone(),o=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("LOG_DEPTH");let s,a,c=!1,u=r.sources,f=u.length;for(s=0;s<f;++s)if(fft.test(u[s])){c=!0;break}if(!c){for(s=0;s<f;++s)u[s]=Fe.replaceMain(u[s],"czm_log_depth_main");a=`
- void main()
- {
- czm_log_depth_main();
- czm_vertexLogDepth();
- }
- `,u.push(a)}for(u=o.sources,f=u.length,c=!1,s=0;s<f;++s)uft.test(u[s])&&(c=!0);o.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(c=!0);let d=!0;for(s=0;s<f;++s)dft.test(u[s])&&(d=!1);let p="";if(d&&(p+=`#ifdef GL_EXT_frag_depth
- #extension GL_EXT_frag_depth : enable
- #endif
- `),!c){for(s=0;s<f;s++)u[s]=Fe.replaceMain(u[s],"czm_log_depth_main");p+=`
- void main()
- {
- czm_log_depth_main();
- czm_writeLogDepth();
- }
- `}u.push(p),n=e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:o,attributeLocations:i})}return n}p1.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i;return l(n.command)&&(i=n.command.shaderProgram),n.command=Ze.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=hft(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function mft(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(!l(i)){let r=t._attributeLocations,o=t.fragmentShaderSource,s=o.sources,a=s.length,c=`void main()
- {
- czm_non_pick_main();
- if (gl_FragColor.a == 0.0) {
- discard;
- }
- gl_FragColor = ${n};
- }
- `,u=new Array(a+1);for(let f=0;f<a;++f)u[f]=Fe.replaceMain(s[f],"czm_non_pick_main");u[a]=c,o=new Fe({sources:u,defines:o.defines}),i=e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:r})}return i}function pft(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(!l(i)){let r=Ve.getState(t);r.blending.enabled=!1,r.depthMask=!0,i=Ve.fromCache(r),n[t.id]=i}return i}p1.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let r,o;return l(i.pickCommand)&&(r=i.pickCommand.shaderProgram,o=i.pickCommand.renderState),i.pickCommand=Ze.shallowClone(t,i.pickCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=mft(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=pft(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=r,i.pickCommand.renderState=o),i};function _ft(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(!l(n)){let i=t._attributeLocations,r=t.vertexShaderSource.clone(),o=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),n=e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:r,fragmentShaderSource:o,attributeLocations:i})}return n}p1.createHdrCommand=function(e,t,n){l(n)||(n={});let i;return l(n.command)&&(i=n.command.shaderProgram),n.command=Ze.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=_ft(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var V0=p1;function cU(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let r=i.alpha;if(!l(r)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=M.toRadians(r),t._beta=M.toRadians(i.beta),t._gamma=M.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var gft=new Re,qge=new Re,yft=new Q;function xft(e,t,n,i){let r=e.direction,o=e.right,s=e.up,a=Re.fromAxisAngle(r,n,qge),c=Re.fromAxisAngle(o,i,gft),u=Re.multiply(c,a,c),f=Re.fromAxisAngle(s,t,qge);Re.multiply(f,u,u);let d=Q.fromQuaternion(u,yft);Q.multiplyByVector(d,o,o),Q.multiplyByVector(d,s,s),Q.multiplyByVector(d,r,r)}cU.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;xft(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};cU.prototype.isDestroyed=function(){return!1};cU.prototype.destroy=function(){return this._removeListener(),ue(this)};var lU=cU;function Cft(e){this.direction=h.clone(e.direction),this.color=z.clone(y(e.color,z.WHITE)),this.intensity=y(e.intensity,1)}var Yge=Cft;var _1=`#ifdef WRITE_DEPTH
- #ifdef GL_EXT_frag_depth
- #extension GL_EXT_frag_depth : enable
- #endif
- #endif
- uniform vec3 u_radii;
- uniform vec3 u_oneOverEllipsoidRadiiSquared;
- varying vec3 v_positionEC;
- vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)
- {
- vec3 positionEC = czm_pointAlongRay(ray, intersection);
- vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;
- vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));
- vec3 sphericalNormal = normalize(positionMC / u_radii);
- vec3 normalMC = geodeticNormal * side;
- vec3 normalEC = normalize(czm_normal * normalMC);
- vec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal);
- vec3 positionToEyeEC = -positionEC;
- czm_materialInput materialInput;
- materialInput.s = st.s;
- materialInput.st = st;
- materialInput.str = (positionMC + u_radii) / u_radii;
- materialInput.normalEC = normalEC;
- materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);
- materialInput.positionToEyeEC = positionToEyeEC;
- czm_material material = czm_getMaterial(materialInput);
- #ifdef ONLY_SUN_LIGHTING
- return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC);
- #else
- return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
- #endif
- }
- void main()
- {
- float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;
- vec3 direction = normalize(v_positionEC);
- vec3 ellipsoidCenter = czm_modelView[3].xyz;
- float t1 = -1.0;
- float t2 = -1.0;
- float b = -2.0 * dot(direction, ellipsoidCenter);
- float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;
- float discriminant = b * b - 4.0 * c;
- if (discriminant >= 0.0) {
- t1 = (-b - sqrt(discriminant)) * 0.5;
- t2 = (-b + sqrt(discriminant)) * 0.5;
- }
- if (t1 < 0.0 && t2 < 0.0) {
- discard;
- }
- float t = min(t1, t2);
- if (t < 0.0) {
- t = 0.0;
- }
- czm_ray ray = czm_ray(t * direction, direction);
- vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z);
- czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii);
- if (czm_isEmpty(intersection))
- {
- discard;
- }
- vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);
- vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);
- gl_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);
- gl_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);
- #ifdef WRITE_DEPTH
- #ifdef GL_EXT_frag_depth
- t = (intersection.start != 0.0) ? intersection.start : intersection.stop;
- vec3 positionEC = czm_pointAlongRay(ray, t);
- vec4 positionCC = czm_projection * vec4(positionEC, 1.0);
- #ifdef LOG_DEPTH
- czm_writeLogDepth(1.0 + positionCC.w);
- #else
- float z = positionCC.z / positionCC.w;
- float n = czm_depthRange.near;
- float f = czm_depthRange.far;
- gl_FragDepthEXT = (z * (f - n) + f + n) * 0.5;
- #endif
- #endif
- #endif
- }
- `;var g1=`attribute vec3 position;
- uniform vec3 u_radii;
- varying vec3 v_positionEC;
- void main()
- {
- vec4 p = vec4(u_radii * position, 1.0);
- v_positionEC = (czm_modelView * p).xyz;
- gl_Position = czm_modelViewProjection * p;
- gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);
- czm_vertexLogDepth();
- }
- `;var qq={position:0};function uU(e){e=y(e,y.EMPTY_OBJECT),this.center=h.clone(y(e.center,h.ZERO)),this._center=new h,this.radii=h.clone(e.radii),this._radii=new h,this._oneOverEllipsoidRadiiSquared=new h,this._boundingSphere=new re,this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this._modelMatrix=new N,this._computedModelMatrix=new N,this.show=y(e.show,!0),this.material=y(e.material,cr.fromType(cr.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.onlySunLighting=y(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=y(e.depthTestEnabled,!0),this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new Ze({owner:y(e._owner,this)}),this._pickCommand=new Ze({owner:y(e._owner,this),pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function Aft(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Vl.createGeometry(Vl.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Pe.POSITION_ONLY}));return t=Qn.fromGeometry({context:e,geometry:n,attributeLocations:qq,bufferUsage:Ne.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}var Xge=`#ifdef GL_EXT_frag_depth
- #extension GL_EXT_frag_depth : enable
- #endif
- `;uU.prototype.update=function(e){if(!this.show||e.mode!==te.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=Ve.fromCache({cull:{enabled:!0,face:Yi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?hn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=Aft(t));let r=!1,o=this.radii;if(!h.equals(this._radii,o)){h.clone(o,this._radii);let x=this._oneOverEllipsoidRadiiSquared;x.x=1/(o.x*o.x),x.y=1/(o.y*o.y),x.z=1/(o.z*o.z),r=!0}(!N.equals(this.modelMatrix,this._modelMatrix)||!h.equals(this.center,this._center))&&(N.clone(this.modelMatrix,this._modelMatrix),h.clone(this.center,this._center),N.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),r=!0),r&&(h.clone(h.ZERO,this._boundingSphere.center),this._boundingSphere.radius=h.maximumComponent(o),re.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(s||a||i||u)&&(d=new Fe({sources:[g1]}),p=new Fe({sources:[this.material.shaderSource,_1]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH"),p.sources.push(Xge)),this._sp=Wt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:qq}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=rt(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let g=e.commandList,m=e.passes;if(m.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?Ce.TRANSLUCENT:Ce.OPAQUE,g.push(f)),m.pick){let x=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||u)&&(d=new Fe({sources:[g1]}),p=new Fe({sources:[this.material.shaderSource,_1],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH"),p.sources.push(Xge)),this._pickSP=Wt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:qq}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._pickSP,x.uniformMap=rt(rt(this._uniforms,this._pickUniforms),this.material._uniforms),x.executeInClosestFrustum=n),x.boundingVolume=this._boundingSphere,x.modelMatrix=this._computedModelMatrix,x.pass=n?Ce.TRANSLUCENT:Ce.OPAQUE,g.push(x)}};uU.prototype.isDestroyed=function(){return!1};uU.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var fU=uU;var dU=`varying vec3 v_positionMC;
- varying vec3 v_positionEC;
- varying vec2 v_st;
- void main()
- {
- czm_materialInput materialInput;
- vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));
- #ifdef FACE_FORWARD
- normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
- #endif
- materialInput.s = v_st.s;
- materialInput.st = v_st;
- materialInput.str = vec3(v_st, 0.0);
- materialInput.normalEC = normalEC;
- materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);
- vec3 positionToEyeEC = -v_positionEC;
- materialInput.positionToEyeEC = positionToEyeEC;
- czm_material material = czm_getMaterial(materialInput);
- #ifdef FLAT
- gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);
- #else
- gl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
- #endif
- }
- `;var hU=`attribute vec3 position3DHigh;
- attribute vec3 position3DLow;
- attribute vec2 st;
- attribute float batchId;
- varying vec3 v_positionMC;
- varying vec3 v_positionEC;
- varying vec2 v_st;
- void main()
- {
- vec4 p = czm_computePosition();
- v_positionMC = position3DHigh + position3DLow;
- v_positionEC = (czm_modelViewRelativeToEye * p).xyz;
- v_st = st;
- gl_Position = czm_modelViewProjectionRelativeToEye * p;
- }
- `;function lC(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.aboveGround,!1);this.material=l(e.material)?e.material:cr.fromType(cr.ColorType),this.translucent=y(e.translucent,!0),this._vertexShaderSource=y(e.vertexShaderSource,hU),this._fragmentShaderSource=y(e.fragmentShaderSource,dU),this._renderState=ar.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,n),this._aboveGround=n}Object.defineProperties(lC.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return lC.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});lC.VERTEX_FORMAT=Pe.POSITION_AND_ST;lC.prototype.getFragmentShaderSource=ar.prototype.getFragmentShaderSource;lC.prototype.isTranslucent=ar.prototype.isTranslucent;lC.prototype.getRenderState=ar.prototype.getRenderState;var Kge=lC;function $ge(){this.enabled=!0,this.renderable=!0,this.density=2e-4,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}var mU=[359.393,800.749,1275.6501,2151.1192,3141.7763,4777.5198,6281.2493,12364.307,15900.765,49889.0549,78026.8259,99260.7344,120036.3873,151011.0158,156091.1953,203849.3112,274866.9803,319916.3149,493552.0528,628733.5874],bm=[2e-5,2e-4,1e-4,7e-5,5e-5,4e-5,3e-5,19e-6,1e-5,85e-7,62e-7,58e-7,53e-7,52e-7,51e-7,42e-7,4e-6,34e-7,26e-7,22e-7];for(let e=0;e<bm.length;++e)bm[e]*=1e6;var Zge=bm[1],Yq=bm[bm.length-1];for(let e=0;e<bm.length;++e)bm[e]=(bm[e]-Yq)/(Zge-Yq);var ra=0;function Tft(e){let t=mU,n=t.length;if(e<t[0])return ra=0,ra;if(e>t[n-1])return ra=n-2,ra;if(e>=t[ra]){if(ra+1<n&&e<t[ra+1])return ra;if(ra+2<n&&e<t[ra+2])return++ra,ra}else if(ra-1>=0&&e>=t[ra-1])return--ra,ra;let i;for(i=0;i<n-2&&!(e>=t[i]&&e<t[i+1]);++i);return ra=i,ra}var bft=new h;$ge.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>8e5||e.mode!==te.SCENE3D){e.fog.enabled=!1;return}let r=i.height,o=Tft(r),s=M.clamp((r-mU[o])/(mU[o+1]-mU[o]),0,1),a=M.lerp(bm[o],bm[o+1],s),c=this.density*1e6,u=c/Zge*Yq;a=a*(c-u)*1e-6;let f=h.normalize(n.positionWC,bft),d=Math.abs(h.dot(n.directionWC,f));a*=1-d,e.fog.density=a,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var pU=$ge;function Rl(e){this._scene=e.scene,this.samplingWindow=y(e.samplingWindow,Rl.defaultSettings.samplingWindow),this.quietPeriod=y(e.quietPeriod,Rl.defaultSettings.quietPeriod),this.warmupPeriod=y(e.warmupPeriod,Rl.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=y(e.minimumFrameRateDuringWarmup,Rl.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=y(e.minimumFrameRateAfterWarmup,Rl.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new ge,this._nominalFrameRate=new ge,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(r,o){Eft(t,o)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){Sft(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}Rl.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};Rl.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new Rl({scene:e})),e._frameRateMonitor};Object.defineProperties(Rl.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});Rl.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};Rl.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};Rl.prototype.isDestroyed=function(){return!1};Rl.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ue(this)};function Eft(e,t){if(e._pauseCount>0)return;let n=Bi();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/Yn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/Yn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/Yn.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let r=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/r;let o=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);r>o?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function Sft(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var _U=Rl;function wft(e,t,n){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=te.SCENE3D,this.morphTime=te.getMorphTime(te.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0,minimumBrightness:void 0},this.terrainExaggeration=1,this.terrainExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0}var gU=wft;function vft(e,t){this.near=y(e,0),this.far=y(t,0);let n=Ce.NUMBER_OF_PASSES,i=new Array(n),r=new Array(n);for(let o=0;o<n;++o)i[o]=[],r[o]=0;this.commands=i,this.indices=r}var yU=vft;var xU=`uniform vec4 u_initialColor;
- #ifdef APPLY_TAILOR
- uniform sampler2D u_mars_clip_area;
- uniform bool u_mars_clip_enabled;
- uniform bool u_mars_clip_only;
- uniform mat4 u_mars_clip_inverMatrix;
- uniform vec4 u_mars_clip_rect;
- #endif
- #if TEXTURE_UNITS > 0
- uniform sampler2D u_dayTextures[TEXTURE_UNITS];
- uniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];
- uniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];
- #ifdef APPLY_ALPHA
- uniform float u_dayTextureAlpha[TEXTURE_UNITS];
- #endif
- #ifdef APPLY_DAY_NIGHT_ALPHA
- uniform float u_dayTextureNightAlpha[TEXTURE_UNITS];
- uniform float u_dayTextureDayAlpha[TEXTURE_UNITS];
- #endif
- #ifdef APPLY_SPLIT
- uniform float u_dayTextureSplit[TEXTURE_UNITS];
- #endif
- #ifdef APPLY_BRIGHTNESS
- uniform float u_dayTextureBrightness[TEXTURE_UNITS];
- #endif
- #ifdef APPLY_CONTRAST
- uniform float u_dayTextureContrast[TEXTURE_UNITS];
- #endif
- #ifdef APPLY_HUE
- uniform float u_dayTextureHue[TEXTURE_UNITS];
- #endif
- #ifdef APPLY_SATURATION
- uniform float u_dayTextureSaturation[TEXTURE_UNITS];
- #endif
- #ifdef APPLY_GAMMA
- uniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];
- #endif
- #ifdef APPLY_INVERT_COLOR_MARS3D
- uniform bool u_mars3dTextureInvertColor[TEXTURE_UNITS];
- #endif
- #ifdef APPLY_FILTER_COLOR_MARS3D
- uniform vec3 u_mars3dTextureFilterColor[TEXTURE_UNITS];
- #endif
- #ifdef APPLY_IMAGERY_CUTOUT
- uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS];
- #endif
- #ifdef APPLY_COLOR_TO_ALPHA
- uniform vec4 u_colorsToAlpha[TEXTURE_UNITS];
- #endif
- uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];
- #endif
- #ifdef SHOW_REFLECTIVE_OCEAN
- uniform sampler2D u_waterMask;
- uniform vec4 u_waterMaskTranslationAndScale;
- uniform float u_zoomedOutOceanSpecularIntensity;
- #endif
- #ifdef SHOW_OCEAN_WAVES
- uniform sampler2D u_oceanNormalMap;
- #endif
- #if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)
- uniform vec2 u_lightingFadeDistance;
- #endif
- #ifdef TILE_LIMIT_RECTANGLE
- uniform vec4 u_cartographicLimitRectangle;
- #endif
- #ifdef GROUND_ATMOSPHERE
- uniform vec2 u_nightFadeDistance;
- #endif
- #ifdef ENABLE_CLIPPING_PLANES
- uniform highp sampler2D u_clippingPlanes;
- uniform mat4 u_clippingPlanesMatrix;
- uniform vec4 u_clippingPlanesEdgeStyle;
- #endif
- #if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
- uniform float u_minimumBrightness;
- #endif
- #ifdef COLOR_CORRECT
- uniform vec3 u_hsbShift;
- #endif
- #ifdef HIGHLIGHT_FILL_TILE
- uniform vec4 u_fillHighlightColor;
- #endif
- #ifdef TRANSLUCENT
- uniform vec4 u_frontFaceAlphaByDistance;
- uniform vec4 u_backFaceAlphaByDistance;
- uniform vec4 u_translucencyRectangle;
- #endif
- #ifdef UNDERGROUND_COLOR
- uniform vec4 u_undergroundColor;
- uniform vec4 u_undergroundColorAlphaByDistance;
- #endif
- #ifdef ENABLE_VERTEX_LIGHTING
- uniform float u_lambertDiffuseMultiplier;
- #endif
- varying vec3 v_positionMC;
- varying vec3 v_positionEC;
- varying vec3 v_textureCoordinates;
- varying vec3 v_normalMC;
- varying vec3 v_normalEC;
- #ifdef APPLY_MATERIAL
- uniform bool u_mars_flood_globe;
- uniform sampler2D u_mars_flood_area;
- uniform bool u_mars_flood_emabled;
- uniform bool u_showFloodOnly;
- uniform mat4 u_mars_flood_inverMatrix;
- uniform vec4 u_mars_flood_rect;
- uniform bool u_mars_flood_showElse;
- varying float v_height;
- varying float v_slope;
- varying float v_aspect;
- #endif
- #if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
- varying float v_distance;
- #endif
- #if defined(GROUND_ATMOSPHERE) || defined(FOG)
- varying vec3 v_atmosphereRayleighColor;
- varying vec3 v_atmosphereMieColor;
- varying float v_atmosphereOpacity;
- #endif
- #if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
- float interpolateByDistance(vec4 nearFarScalar, float distance)
- {
- float startDistance = nearFarScalar.x;
- float startValue = nearFarScalar.y;
- float endDistance = nearFarScalar.z;
- float endValue = nearFarScalar.w;
- float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);
- return mix(startValue, endValue, t);
- }
- #endif
- #if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL)
- vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor)
- {
- return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);
- }
- #endif
- #ifdef TRANSLUCENT
- bool inTranslucencyRectangle()
- {
- return
- v_textureCoordinates.x > u_translucencyRectangle.x &&
- v_textureCoordinates.x < u_translucencyRectangle.z &&
- v_textureCoordinates.y > u_translucencyRectangle.y &&
- v_textureCoordinates.y < u_translucencyRectangle.w;
- }
- #endif
- vec4 sampleAndBlend(
- vec4 previousColor,
- sampler2D textureToSample,
- vec2 tileTextureCoordinates,
- vec4 textureCoordinateRectangle,
- vec4 textureCoordinateTranslationAndScale,
- float textureAlpha,
- float textureNightAlpha,
- float textureDayAlpha,
- float textureBrightness,
- float textureContrast,
- float textureHue,
- float textureSaturation,
- float textureOneOverGamma,
- bool textureInvertColor,
- vec3 texturefilterColor,
- float split,
- vec4 colorToAlpha,
- float nightBlend)
- {
- vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);
- textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;
- alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);
- textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;
- #if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)
- textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend);
- #endif
- vec2 translation = textureCoordinateTranslationAndScale.xy;
- vec2 scale = textureCoordinateTranslationAndScale.zw;
- vec2 textureCoordinates = tileTextureCoordinates * scale + translation;
- vec4 value = texture2D(textureToSample, textureCoordinates);
- vec3 color = value.rgb;
- float alpha = value.a;
- #ifdef APPLY_COLOR_TO_ALPHA
- vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);
- colorDiff.r = max(max(colorDiff.r, colorDiff.g), colorDiff.b);
- alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);
- #endif
- #if !defined(APPLY_GAMMA)
- vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));
- color = tempColor.rgb;
- alpha = tempColor.a;
- #else
- color = pow(color, vec3(textureOneOverGamma));
- #endif
- #ifdef APPLY_SPLIT
- float splitPosition = czm_splitPosition;
- if (split < 0.0 && gl_FragCoord.x > splitPosition) {
- alpha = 0.0;
- }
- else if (split > 0.0 && gl_FragCoord.x < splitPosition) {
- alpha = 0.0;
- }
- #endif
- #ifdef APPLY_BRIGHTNESS
- color = mix(vec3(0.0), color, textureBrightness);
- #endif
- #ifdef APPLY_CONTRAST
- color = mix(vec3(0.5), color, textureContrast);
- #endif
- #ifdef APPLY_HUE
- color = czm_hue(color, textureHue);
- #endif
- #ifdef APPLY_SATURATION
- color = czm_saturation(color, textureSaturation);
- #endif
- #ifdef APPLY_INVERT_COLOR_MARS3D
- if (textureInvertColor) {
- color.r = 1.0 - color.r;
- color.g = 1.0 - color.g;
- color.b = 1.0 - color.b;
- }
- #endif
- #ifdef APPLY_FILTER_COLOR_MARS3D
- if (texturefilterColor.x!=1.0&&texturefilterColor.y!=1.0&&texturefilterColor.z!=1.0) {
- color.r = color.r * texturefilterColor.x;
- color.g = color.g * texturefilterColor.y;
- color.b = color.b * texturefilterColor.z;
- }
- #endif
- float sourceAlpha = alpha * textureAlpha;
- float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);
- outAlpha += sign(outAlpha) - 1.0;
- vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;
- return vec4(outColor, max(outAlpha, 0.0));
- }
- vec3 colorCorrect(vec3 rgb) {
- #ifdef COLOR_CORRECT
- vec3 hsb = czm_RGBToHSB(rgb);
- hsb.x += u_hsbShift.x;
- hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0);
- hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0;
- rgb = czm_HSBToRGB(hsb);
- #endif
- return rgb;
- }
- vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend);
- vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade);
- const float fExposure = 2.0;
- vec3 computeEllipsoidPosition()
- {
- float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0);
- vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0);
- xy *= czm_viewport.zw * mpp * 0.5;
- vec3 direction = normalize(vec3(xy, -czm_currentFrustum.x));
- czm_ray ray = czm_ray(vec3(0.0), direction);
- vec3 ellipsoid_center = czm_view[3].xyz;
- czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);
- vec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start);
- return (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz;
- }
- void main()
- {
- #ifdef TILE_LIMIT_RECTANGLE
- if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x ||
- v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y)
- {
- discard;
- }
- #endif
- #ifdef ENABLE_CLIPPING_PLANES
- float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix);
- #endif
- #if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR)
- vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));
- vec3 normalEC = czm_normal3D * normalMC;
- #endif
- #if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)
- float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0);
- #else
- float nightBlend = 0.0;
- #endif
- vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend);
- #ifdef SHOW_TILE_BOUNDARIES
- if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||
- v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))
- {
- color = vec4(1.0, 0.0, 0.0, 1.0);
- }
- #endif
- #if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)
- float cameraDist;
- if (czm_sceneMode == czm_sceneMode2D)
- {
- cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5;
- }
- else if (czm_sceneMode == czm_sceneModeColumbusView)
- {
- cameraDist = -czm_view[3].z;
- }
- else
- {
- cameraDist = length(czm_view[3]);
- }
- float fadeOutDist = u_lightingFadeDistance.x;
- float fadeInDist = u_lightingFadeDistance.y;
- if (czm_sceneMode != czm_sceneMode3D) {
- vec3 radii = czm_ellipsoidRadii;
- float maxRadii = max(radii.x, max(radii.y, radii.z));
- fadeOutDist -= maxRadii;
- fadeInDist -= maxRadii;
- }
- float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);
- #else
- float fade = 0.0;
- #endif
- #ifdef SHOW_REFLECTIVE_OCEAN
- vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;
- vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;
- vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;
- waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y;
- float mask = texture2D(u_waterMask, waterMaskTextureCoordinates).r;
- if (mask > 0.0)
- {
- mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);
- vec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC);
- vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx);
- vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));
- color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade);
- }
- #endif
- #ifdef APPLY_MATERIAL
- czm_materialInput materialInput;
- materialInput.st = v_textureCoordinates.st;
- materialInput.normalEC = normalize(v_normalEC);
- materialInput.positionToEyeEC = -v_positionEC;
- materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC));
- materialInput.slope = v_slope;
- materialInput.height = v_height;
- materialInput.aspect = v_aspect;
- czm_material material = czm_getMaterial(materialInput);
- vec4 materialColor = vec4(material.diffuse, material.alpha);
- if(u_mars_flood_emabled){
- if(u_mars_flood_globe){
- vec4 materialColor = vec4(material.diffuse, material.alpha);
- color = alphaBlend(materialColor, color);
- }else{
- vec4 lpos = u_mars_flood_inverMatrix * vec4(v_positionMC,1.0);
- vec2 newuv = (lpos.xy - u_mars_flood_rect.xy) / u_mars_flood_rect.zw;
- vec4 ymColor = texture2D(u_mars_flood_area, newuv);
- if (newuv.x>=0.0 && newuv.x<=1.0 && newuv.y>=0.0 && newuv.y<=1.0 && ymColor.r>0.8 && ymColor.a > 0.8) {
- color.xyz = mix(color.xyz, material.diffuse, material.alpha);
- } else {
- if (!u_mars_flood_showElse) {
- discard;
- }
- }
- }
- }
- #endif
- #ifdef ENABLE_VERTEX_LIGHTING
- float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + 0.3, 0.0, 1.0);
- vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);
- #elif defined(ENABLE_DAYNIGHT_SHADING)
- float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);
- diffuseIntensity = mix(1.0, diffuseIntensity, fade);
- vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);
- #else
- vec4 finalColor = color;
- #endif
- #ifdef ENABLE_CLIPPING_PLANES
- vec4 clippingPlanesEdgeColor = vec4(1.0);
- clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb;
- float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a;
- if (clipDistance < clippingPlanesEdgeWidth)
- {
- finalColor = clippingPlanesEdgeColor;
- }
- #endif
- #ifdef HIGHLIGHT_FILL_TILE
- finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a);
- #endif
- #if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)
- vec3 atmosphereLightDirection = czm_sunDirectionWC;
- #else
- vec3 atmosphereLightDirection = czm_lightDirectionWC;
- #endif
- #if defined(GROUND_ATMOSPHERE) || defined(FOG)
- if (!czm_backFacing())
- {
- bool dynamicLighting = false;
- #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))
- dynamicLighting = true;
- #endif
- vec3 rayleighColor;
- vec3 mieColor;
- float opacity;
- vec3 positionWC;
- vec3 lightDirection;
- #ifdef PER_FRAGMENT_GROUND_ATMOSPHERE
- positionWC = computeEllipsoidPosition();
- lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));
- computeAtmosphereScattering(
- positionWC,
- lightDirection,
- rayleighColor,
- mieColor,
- opacity
- );
- #else
- positionWC = v_positionMC;
- lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));
- rayleighColor = v_atmosphereRayleighColor;
- mieColor = v_atmosphereMieColor;
- opacity = v_atmosphereOpacity;
- #endif
- rayleighColor = colorCorrect(rayleighColor);
- mieColor = colorCorrect(mieColor);
- vec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity);
- #ifdef FOG
- vec3 fogColor = groundAtmosphereColor.rgb;
- #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
- float darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0);
- fogColor *= darken;
- #endif
- #ifndef HDR
- fogColor.rgb = czm_acesTonemapping(fogColor.rgb);
- fogColor.rgb = czm_inverseGamma(fogColor.rgb);
- #endif
- const float modifier = 0.15;
- finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, modifier), finalColor.a);
- #else
- const float transmittanceModifier = 0.5;
- float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0);
- vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance;
- #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
- float fadeInDist = u_nightFadeDistance.x;
- float fadeOutDist = u_nightFadeDistance.y;
- float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0);
- float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0);
- vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken);
- finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity);
- #endif
- #ifndef HDR
- finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb);
- #else
- finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6);
- #endif
- finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade);
- #endif
- }
- #endif
- #ifdef UNDERGROUND_COLOR
- if (czm_backFacing())
- {
- float distanceFromEllipsoid = max(czm_eyeHeight, 0.0);
- float distance = max(v_distance - distanceFromEllipsoid, 0.0);
- float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance);
- vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount);
- finalColor = alphaBlend(undergroundColor, finalColor);
- }
- #endif
- #ifdef TRANSLUCENT
- if (inTranslucencyRectangle())
- {
- vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance;
- finalColor.a *= interpolateByDistance(alphaByDistance, v_distance);
- }
- #endif
- #ifdef APPLY_TAILOR
- if(u_mars_clip_enabled){
- vec4 tlpos = u_mars_clip_inverMatrix * vec4(v_positionMC,1.0);
- vec2 tuv = (tlpos.xy - u_mars_clip_rect.xy)/ u_mars_clip_rect.zw;
- vec4 tColor = texture2D(u_mars_clip_area, tuv);
- if (!(tuv.x>=0.0 && tuv.x<=1.0 && tuv.y>=0.0 && tuv.y<=1.0) || (tColor.r<0.5 && tColor.a<0.5)) {
- if (u_mars_clip_only) {
- discard;
- }
- } else {
- if (!u_mars_clip_only) {
- discard;
- }
- }
- }
- #endif
- gl_FragColor = finalColor;
- }
- #ifdef SHOW_REFLECTIVE_OCEAN
- float waveFade(float edge0, float edge1, float x)
- {
- float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
- return pow(1.0 - y, 5.0);
- }
- float linearFade(float edge0, float edge1, float x)
- {
- return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
- }
- const float oceanFrequencyLowAltitude = 825000.0;
- const float oceanAnimationSpeedLowAltitude = 0.004;
- const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;
- const float oceanSpecularIntensity = 0.5;
- const float oceanFrequencyHighAltitude = 125000.0;
- const float oceanAnimationSpeedHighAltitude = 0.008;
- const float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;
- vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade)
- {
- vec3 positionToEyeEC = -positionEyeCoordinates;
- float positionToEyeECLength = length(positionToEyeEC);
- vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC));
- float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);
- #ifdef SHOW_OCEAN_WAVES
- float time = czm_frameNumber * oceanAnimationSpeedHighAltitude;
- vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);
- vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);
- time = czm_frameNumber * oceanAnimationSpeedLowAltitude;
- noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);
- vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);
- float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);
- float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);
- vec3 normalTangentSpace =
- (highAltitudeFade * normalTangentSpaceHighAltitude) +
- (lowAltitudeFade * normalTangentSpaceLowAltitude);
- normalTangentSpace = normalize(normalTangentSpace);
- normalTangentSpace.xy *= waveIntensity;
- normalTangentSpace = normalize(normalTangentSpace);
- #else
- vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);
- #endif
- vec3 normalEC = enuToEye * normalTangentSpace;
- const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);
- float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue;
- vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade);
- #ifdef SHOW_OCEAN_WAVES
- float tsPerturbationRatio = normalTangentSpace.z;
- vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);
- #else
- vec3 nonDiffuseHighlight = vec3(0.0);
- #endif
- float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0);
- float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);
- float specular = specularIntensity * surfaceReflectance;
- #ifdef HDR
- specular *= 1.4;
- float e = 0.2;
- float d = 3.3;
- float c = 1.7;
- vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular));
- #else
- vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular;
- #endif
- return vec4(color, imageryColor.a);
- }
- #endif // #ifdef SHOW_REFLECTIVE_OCEAN
- `;var CU=`#ifdef QUANTIZATION_BITS12
- attribute vec4 compressed0;
- attribute float compressed1;
- #else
- attribute vec4 position3DAndHeight;
- attribute vec4 textureCoordAndEncodedNormals;
- #endif
- #ifdef GEODETIC_SURFACE_NORMALS
- attribute vec3 geodeticSurfaceNormal;
- #endif
- #ifdef EXAGGERATION
- uniform vec2 u_terrainExaggerationAndRelativeHeight;
- #endif
- uniform vec3 u_center3D;
- uniform mat4 u_modifiedModelView;
- uniform mat4 u_modifiedModelViewProjection;
- uniform vec4 u_tileRectangle;
- uniform vec2 u_southAndNorthLatitude;
- uniform vec2 u_southMercatorYAndOneOverHeight;
- varying vec3 v_positionMC;
- varying vec3 v_positionEC;
- varying vec3 v_textureCoordinates;
- varying vec3 v_normalMC;
- varying vec3 v_normalEC;
- #ifdef APPLY_MATERIAL
- varying float v_slope;
- varying float v_aspect;
- varying float v_height;
- #endif
- #if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
- varying float v_distance;
- #endif
- #if defined(FOG) || defined(GROUND_ATMOSPHERE)
- varying vec3 v_atmosphereRayleighColor;
- varying vec3 v_atmosphereMieColor;
- varying float v_atmosphereOpacity;
- #endif
- vec4 getPosition(vec3 position, float height, vec2 textureCoordinates);
- float get2DYPositionFraction(vec2 textureCoordinates);
- vec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)
- {
- return u_modifiedModelViewProjection * vec4(position, 1.0);
- }
- float get2DMercatorYPositionFraction(vec2 textureCoordinates)
- {
- const float maxTileWidth = 0.003068;
- float positionFraction = textureCoordinates.y;
- float southLatitude = u_southAndNorthLatitude.x;
- float northLatitude = u_southAndNorthLatitude.y;
- if (northLatitude - southLatitude > maxTileWidth)
- {
- float southMercatorY = u_southMercatorYAndOneOverHeight.x;
- float oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;
- float currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);
- currentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);
- positionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);
- }
- return positionFraction;
- }
- float get2DGeographicYPositionFraction(vec2 textureCoordinates)
- {
- return textureCoordinates.y;
- }
- vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)
- {
- float yPositionFraction = get2DYPositionFraction(textureCoordinates);
- vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);
- return u_modifiedModelViewProjection * rtcPosition2D;
- }
- vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)
- {
- return getPositionPlanarEarth(position, 0.0, textureCoordinates);
- }
- vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)
- {
- return getPositionPlanarEarth(position, height, textureCoordinates);
- }
- vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)
- {
- vec3 position3DWC = position + u_center3D;
- float yPositionFraction = get2DYPositionFraction(textureCoordinates);
- vec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);
- vec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);
- return czm_modelViewProjection * morphPosition;
- }
- #ifdef QUANTIZATION_BITS12
- uniform vec2 u_minMaxHeight;
- uniform mat4 u_scaleAndBias;
- #endif
- void main()
- {
- #ifdef QUANTIZATION_BITS12
- vec2 xy = czm_decompressTextureCoordinates(compressed0.x);
- vec2 zh = czm_decompressTextureCoordinates(compressed0.y);
- vec3 position = vec3(xy, zh.x);
- float height = zh.y;
- vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);
- height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;
- position = (u_scaleAndBias * vec4(position, 1.0)).xyz;
- #if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y)
- float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;
- float encodedNormal = compressed1;
- #elif defined(INCLUDE_WEB_MERCATOR_Y)
- float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;
- float encodedNormal = 0.0;
- #elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)
- float webMercatorT = textureCoordinates.y;
- float encodedNormal = compressed0.w;
- #else
- float webMercatorT = textureCoordinates.y;
- float encodedNormal = 0.0;
- #endif
- #else
- vec3 position = position3DAndHeight.xyz;
- float height = position3DAndHeight.w;
- vec2 textureCoordinates = textureCoordAndEncodedNormals.xy;
- #if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y)
- float webMercatorT = textureCoordAndEncodedNormals.z;
- float encodedNormal = textureCoordAndEncodedNormals.w;
- #elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
- float webMercatorT = textureCoordinates.y;
- float encodedNormal = textureCoordAndEncodedNormals.z;
- #elif defined(INCLUDE_WEB_MERCATOR_Y)
- float webMercatorT = textureCoordAndEncodedNormals.z;
- float encodedNormal = 0.0;
- #else
- float webMercatorT = textureCoordinates.y;
- float encodedNormal = 0.0;
- #endif
- #endif
- vec3 position3DWC = position + u_center3D;
- #ifdef GEODETIC_SURFACE_NORMALS
- vec3 ellipsoidNormal = geodeticSurfaceNormal;
- #else
- vec3 ellipsoidNormal = normalize(position3DWC);
- #endif
- #if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)
- float exaggeration = u_terrainExaggerationAndRelativeHeight.x;
- float relativeHeight = u_terrainExaggerationAndRelativeHeight.y;
- float newHeight = (height - relativeHeight) * exaggeration + relativeHeight;
- float minRadius = min(min(czm_ellipsoidRadii.x, czm_ellipsoidRadii.y), czm_ellipsoidRadii.z);
- newHeight = max(newHeight, -minRadius);
- vec3 offset = ellipsoidNormal * (newHeight - height);
- position += offset;
- position3DWC += offset;
- height = newHeight;
- #endif
- gl_Position = getPosition(position, height, textureCoordinates);
- v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;
- v_positionMC = position3DWC;
- v_textureCoordinates = vec3(textureCoordinates, webMercatorT);
- #if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
- vec3 normalMC = czm_octDecode(encodedNormal);
- #if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)
- vec3 projection = dot(normalMC, ellipsoidNormal) * ellipsoidNormal;
- vec3 rejection = normalMC - projection;
- normalMC = normalize(projection + rejection * exaggeration);
- #endif
- v_normalMC = normalMC;
- v_normalEC = czm_normal3D * v_normalMC;
- #endif
- #if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE))
- bool dynamicLighting = false;
- #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))
- dynamicLighting = true;
- #endif
- #if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)
- vec3 atmosphereLightDirection = czm_sunDirectionWC;
- #else
- vec3 atmosphereLightDirection = czm_lightDirectionWC;
- #endif
- vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC));
- computeAtmosphereScattering(
- position3DWC,
- lightDirection,
- v_atmosphereRayleighColor,
- v_atmosphereMieColor,
- v_atmosphereOpacity
- );
- #endif
- #if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
- v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);
- #endif
- #ifdef APPLY_MATERIAL
- float northPoleZ = czm_ellipsoidRadii.z;
- vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ);
- vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal));
- float dotProd = abs(dot(ellipsoidNormal, v_normalMC));
- v_slope = acos(dotProd);
- vec3 normalRejected = ellipsoidNormal * dotProd;
- vec3 normalProjected = v_normalMC - normalRejected;
- vec3 aspectVector = normalize(normalProjected);
- v_aspect = acos(dot(aspectVector, vectorEastMC));
- float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal);
- v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect);
- v_height = height;
- #endif
- }
- `;var k0=`uniform vec3 u_radiiAndDynamicAtmosphereColor;
- uniform float u_atmosphereLightIntensity;
- uniform float u_atmosphereRayleighScaleHeight;
- uniform float u_atmosphereMieScaleHeight;
- uniform float u_atmosphereMieAnisotropy;
- uniform vec3 u_atmosphereRayleighCoefficient;
- uniform vec3 u_atmosphereMieCoefficient;
- const float ATMOSPHERE_THICKNESS = 111e3;
- const int PRIMARY_STEPS = 16;
- const int LIGHT_STEPS = 4;
- void computeScattering(
- czm_ray primaryRay,
- float primaryRayLength,
- vec3 lightDirection,
- float atmosphereInnerRadius,
- out vec3 rayleighColor,
- out vec3 mieColor,
- out float opacity
- ) {
- rayleighColor = vec3(0.0);
- mieColor = vec3(0.0);
- opacity = 0.0;
- float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
- vec3 origin = vec3(0.0);
- czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);
- if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {
- return;
- }
- primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);
- primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));
- float rayStepLength = (primaryRayAtmosphereIntersect.stop - primaryRayAtmosphereIntersect.start) / float(PRIMARY_STEPS);
- float rayPositionLength = primaryRayAtmosphereIntersect.start;
- vec3 rayleighAccumulation = vec3(0.0);
- vec3 mieAccumulation = vec3(0.0);
- vec2 opticalDepth = vec2(0.0);
- vec2 heightScale = vec2(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight);
- for (int i = 0; i < PRIMARY_STEPS; i++) {
- vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);
- float sampleHeight = length(samplePosition) - atmosphereInnerRadius;
- vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;
- opticalDepth += sampleDensity;
- czm_ray lightRay = czm_ray(samplePosition, lightDirection);
- czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius);
- float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS);
- float lightPositionLength = 0.0;
- vec2 lightOpticalDepth = vec2(0.0);
- for (int j = 0; j < LIGHT_STEPS; j++) {
- vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);
- float lightHeight = length(lightPosition) - atmosphereInnerRadius;
- lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;
- lightPositionLength += lightStepLength;
- }
- vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));
- rayleighAccumulation += sampleDensity.x * attenuation;
- mieAccumulation += sampleDensity.y * attenuation;
- rayPositionLength += rayStepLength;
- }
- rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation;
- mieColor = u_atmosphereMieCoefficient * mieAccumulation;
- opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x))));
- }
- vec4 computeAtmosphereColor(
- vec3 positionWC,
- vec3 lightDirection,
- vec3 rayleighColor,
- vec3 mieColor,
- float opacity
- ) {
- vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
- vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
- float cosAngle = dot(cameraToPositionWCDirection, lightDirection);
- float cosAngleSq = cosAngle * cosAngle;
- float G = u_atmosphereMieAnisotropy;
- float GSq = G * G;
- float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
- float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));
- vec3 rayleigh = rayleighPhase * rayleighColor;
- vec3 mie = miePhase * mieColor;
- vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity;
- return vec4(color, opacity);
- }
- `;var y1=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) {
- vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
- vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
- czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);
- float atmosphereInnerRadius = length(positionWC);
- computeScattering(
- primaryRay,
- length(cameraToPositionWC),
- lightDirection,
- atmosphereInnerRadius,
- rayleighColor,
- mieColor,
- opacity
- );
- }
- `;function Dft(e,t,n,i,r){this.numberOfDayTextures=e,this.flags=t,this.material=n,this.shaderProgram=i,this.clippingShaderState=r}function Xq(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function Pft(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",r;switch(e){case te.SCENE3D:r=t;break;case te.SCENE2D:case te.COLUMBUS_VIEW:r=n;break;case te.MORPHING:r=i;break}return r}function Ift(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}Xq.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,r=e.applyBrightness,o=e.applyContrast,s=e.applyHue,a=e.applySaturation,c=e.applyGamma,u=e.applyAlpha,f=e.applyDayNightAlpha,d=e.applySplit,p=e.showReflectiveOcean,g=e.showOceanWaves,m=e.enableLighting,x=e.dynamicAtmosphereLighting,C=e.dynamicAtmosphereLightingFromSun,A=e.showGroundAtmosphere,b=e.perFragmentGroundAtmosphere,T=e.hasVertexNormals,S=e.useWebMercatorProjection,w=e.enableFog,D=e.enableClippingPlanes,I=e.clippingPlanes,O=e.clippedByBoundaries,B=e.hasImageryLayerCutout,L=e.colorCorrect,_=e.highlightFillTile,E=e.colorToAlpha,v=e.hasGeodeticSurfaceNormals,P=e.hasExaggeration,R=e.showUndergroundColor,F=e.translucent,U=e.marsOptions||{},k=0,H="",q=n.renderedMesh.encoding;q.quantization===Vs.BITS12&&(k=1,H="QUANTIZATION_BITS12");let X=0,G="";O&&(X=1,G="TILE_LIMIT_RECTANGLE");let $=0,J="";B&&($=1,J="APPLY_IMAGERY_CUTOUT");let ce=t.mode,de=ce|r<<2|o<<3|s<<4|a<<5|c<<6|u<<7|p<<8|g<<9|m<<10|x<<11|C<<12|A<<13|b<<14|T<<15|S<<16|w<<17|k<<18|d<<19|D<<20|X<<21|$<<22|L<<23|_<<24|E<<25|v<<26|P<<27|R<<28|F<<29|f<<30,ie=0;l(I)&&I.length>0&&(ie=D?I.clippingPlanesState:0);let ae=n.surfaceShader;if(l(ae)&&ae.numberOfDayTextures===i&&ae.flags===de&&ae.material===this.material&&ae.clippingShaderState===ie)return ae.shaderProgram;let _e=this._shadersByTexturesFlags[i];if(l(_e)||(_e=this._shadersByTexturesFlags[i]=[]),ae=_e[de],U.enableClip||!l(ae)||ae.material!==this.material||ae.clippingShaderState!==ie){let be=this.baseVertexShaderSource.clone(),Te=this.baseFragmentShaderSource.clone();ie!==0&&Te.sources.unshift(wg(I,t.context)),U.enableClip&&Te.defines.push("APPLY_TAILOR"),be.defines.push(H),Te.defines.push(`TEXTURE_UNITS ${i}`,G,J),r&&Te.defines.push("APPLY_BRIGHTNESS"),o&&Te.defines.push("APPLY_CONTRAST"),s&&Te.defines.push("APPLY_HUE"),a&&Te.defines.push("APPLY_SATURATION"),c&&Te.defines.push("APPLY_GAMMA"),U.invertColor&&Te.defines.push("APPLY_INVERT_COLOR_MARS3D"),U.filterColor&&Te.defines.push("APPLY_FILTER_COLOR_MARS3D"),u&&Te.defines.push("APPLY_ALPHA"),f&&Te.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&(Te.defines.push("SHOW_REFLECTIVE_OCEAN"),be.defines.push("SHOW_REFLECTIVE_OCEAN")),g&&Te.defines.push("SHOW_OCEAN_WAVES"),E&&Te.defines.push("APPLY_COLOR_TO_ALPHA"),R&&(be.defines.push("UNDERGROUND_COLOR"),Te.defines.push("UNDERGROUND_COLOR")),F&&(be.defines.push("TRANSLUCENT"),Te.defines.push("TRANSLUCENT")),m&&(T?(be.defines.push("ENABLE_VERTEX_LIGHTING"),Te.defines.push("ENABLE_VERTEX_LIGHTING")):(be.defines.push("ENABLE_DAYNIGHT_SHADING"),Te.defines.push("ENABLE_DAYNIGHT_SHADING"))),x&&(be.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),Te.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),C&&(be.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),Te.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),A&&(be.defines.push("GROUND_ATMOSPHERE"),Te.defines.push("GROUND_ATMOSPHERE"),b&&(be.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),Te.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),be.defines.push("INCLUDE_WEB_MERCATOR_Y"),Te.defines.push("INCLUDE_WEB_MERCATOR_Y"),w&&(be.defines.push("FOG"),Te.defines.push("FOG")),d&&Te.defines.push("APPLY_SPLIT"),D&&Te.defines.push("ENABLE_CLIPPING_PLANES"),L&&Te.defines.push("COLOR_CORRECT"),_&&Te.defines.push("HIGHLIGHT_FILL_TILE"),v&&be.defines.push("GEODETIC_SURFACE_NORMALS"),P&&be.defines.push("EXAGGERATION");let Oe=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)
- {
- vec4 color = initialColor;
- `;B&&(Oe+=` vec4 cutoutAndColorResult;
- bool texelUnclipped;
- `);for(let tt=0;tt<i;++tt)B?Oe+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${tt}];
- texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;
- cutoutAndColorResult = sampleAndBlend(
- `:Oe+=` color = sampleAndBlend(
- `,Oe+=` color,
- u_dayTextures[${tt}],
- u_dayTextureUseWebMercatorT[${tt}] ? textureCoordinates.xz : textureCoordinates.xy,
- u_dayTextureTexCoordsRectangle[${tt}],
- u_dayTextureTranslationAndScale[${tt}],
- ${u?`u_dayTextureAlpha[${tt}]`:"1.0"},
- ${f?`u_dayTextureNightAlpha[${tt}]`:"1.0"},
- ${f?`u_dayTextureDayAlpha[${tt}]`:"1.0"},
- ${r?`u_dayTextureBrightness[${tt}]`:"0.0"},
- ${o?`u_dayTextureContrast[${tt}]`:"0.0"},
- ${s?`u_dayTextureHue[${tt}]`:"0.0"},
- ${a?`u_dayTextureSaturation[${tt}]`:"0.0"},
- ${c?`u_dayTextureOneOverGamma[${tt}]`:"0.0"},
- //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
- ${U.invertColor?`u_mars3dTextureInvertColor[${tt}]`:"false"},
- ${U.filterColor?`u_mars3dTextureFilterColor[${tt}]`:"vec3(1.0)"},
- //\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
- ${d?`u_dayTextureSplit[${tt}]`:"0.0"},
- ${E?`u_colorsToAlpha[${tt}]`:"vec4(0.0)"},
- nightBlend );
- `,B&&(Oe+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);
- `);Oe+=` return color;
- }`,Te.sources.push(Oe),be.sources.push(Pft(ce)),be.sources.push(Ift(S));let Be=Wt.fromCache({context:t.context,vertexShaderSource:be,fragmentShaderSource:Te,attributeLocations:q.getAttributeLocations()});ae=_e[de]=new Dft(i,de,this.material,Be,ie)}return n.surfaceShader=ae,ae.shaderProgram};Xq.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];if(!l(r))continue;for(e in r)r.hasOwnProperty(e)&&(t=r[e],l(t)&&t.shaderProgram.destroy())}return ue(this)};var AU=Xq;var Oft={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},ui=Object.freeze(Oft);var Rft={START:0,LOADING:1,DONE:2,FAILED:3},oa=Object.freeze(Rft);var Mft={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},Er=Object.freeze(Mft);function to(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new h,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=Er.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new re,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(to.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===Er.RECEIVING||e===Er.TRANSFORMING),i=this.imagery;for(let r=0,o=i.length;n&&r<o;++r){let s=i[r];n=!l(s.loadingImagery)||s.loadingImagery.state!==ui.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});var Bft=new me;function Kq(e,t,n,i,r,o){let s=e.getExaggeratedPosition(i,r,o);if(l(t)&&t!==te.SCENE3D){let c=n.ellipsoid.cartesianToCartographic(s,Bft);s=n.project(c,o),s=h.fromElements(s.z,s.x,s.y,o)}return s}var Lft=new h,Nft=new h,Fft=new h;to.prototype.pick=function(e,t,n,i,r){let o=this.renderedMesh;if(!l(o))return;let s=o.vertices,a=o.indices,c=o.encoding,u=a.length,f=Number.MAX_VALUE;for(let d=0;d<u;d+=3){let p=a[d],g=a[d+1],m=a[d+2],x=Kq(c,t,n,s,p,Lft),C=Kq(c,t,n,s,g,Nft),A=Kq(c,t,n,s,m,Fft),b=er.rayTriangleParametric(e,x,C,A,i);l(b)&&b<f&&b>=0&&(f=b)}return f!==Number.MAX_VALUE?En.getPoint(e,f,r):void 0};to.prototype.freeResources=function(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=Er.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,n=e.length;t<n;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()};to.prototype.freeVertexArray=function(){to._freeVertexArray(this.vertexArray),this.vertexArray=void 0,to._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};to.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new to),e.state===oa.START&&(Vft(e,t,n),e.state=oa.LOADING)};to.processStateMachine=function(e,t,n,i,r,o,s){to.initialize(e,n,i);let a=e.data;if(e.state===oa.LOADING&&kft(e,t,n,i,r,o),s)return;let c=e.renderable;e.renderable=l(a.vertexArray);let u=a.terrainState===Er.READY;e.upsampledFromParent=l(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let f=a.processImagery(e,n,t);if(u&&f){let d=e._loadedCallbacks,p={};for(let g in d)d.hasOwnProperty(g)&&(d[g](e)||(p[g]=d[g]));e._loadedCallbacks=p,e.state=oa.DONE}c&&(e.renderable=!0)};to.prototype.processImagery=function(e,t,n,i){let r=e.data,o=e.upsampledFromParent,s=!1,a=!0,c=r.imagery,u,f;for(u=0,f=c.length;u<f;++u){let d=c[u];if(!l(d.loadingImagery)){o=!1;continue}if(d.loadingImagery.state===ui.PLACEHOLDER){let g=d.loadingImagery.imageryLayer;if(g.imageryProvider.ready){d.freeResources(),c.splice(u,1),g._createTileImagerySkeletons(e,t,u),--u,f=c.length;continue}else o=!1}let p=d.processStateMachine(e,n,i);a=a&&p,s=s||p||l(d.readyImagery),o=o&&l(d.loadingImagery)&&(d.loadingImagery.state===ui.FAILED||d.loadingImagery.state===ui.INVALID)}return e.upsampledFromParent=o,e.renderable=e.renderable&&(s||a),a};function Jge(e,t,n,i){let r=e.renderedMesh,o=r.vertices,s=r.encoding,a=o.length/s.stride,c=mc.clone(s);c.hasGeodeticSurfaceNormals=t,c=mc.clone(c);let u=c.stride,f=new Float32Array(a*u);t?s.addGeodeticSurfaceNormals(o,f,n):s.removeGeodeticSurfaceNormals(o,f),r.vertices=f,r.stride=u,r!==e.mesh?(to._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=to._createVertexArrayForMesh(i.context,r)):(to._freeVertexArray(e.vertexArray),e.vertexArray=to._createVertexArrayForMesh(i.context,r)),to._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}to.prototype.addGeodeticSurfaceNormals=function(e,t){Jge(this,!0,e,t)};to.prototype.removeGeodeticSurfaceNormals=function(e){Jge(this,!1,void 0,e)};to.prototype.updateExaggeration=function(e,t,n){let i=this,r=i.renderedMesh;if(r===void 0)return;let o=t.terrainExaggeration,s=t.terrainExaggerationRelativeHeight,a=o!==1,c=r.encoding,u=c.exaggeration!==o,f=c.exaggerationRelativeHeight!==s;if(u||f){if(u)if(a&&!c.hasGeodeticSurfaceNormals){let d=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(d,t)}else!a&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=o,c.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let d=e.customData,p=d.length;for(let g=0;g<p;g++){let m=d[g];m.level=-1}}}};function Vft(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(i)&&l(e.parent)){let r=e.parent,o=r.data;l(o)&&l(o.terrainData)&&(i=o.terrainData.isChildAvailable(r.x,r.y,e.x,e.y))}i===!1&&(e.data.terrainState=Er.FAILED);for(let r=0,o=n.length;r<o;++r){let s=n.get(r);s.show&&s._createTileImagerySkeletons(e,t)}}function kft(e,t,n,i,r,o){let s=e.data,a=e.parent;if(s.terrainState===Er.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||to.processStateMachine(a,t,n,i,r,o,!0)),s.terrainState===Er.FAILED&&Uft(s,e,t,n,e.x,e.y,e.level),s.terrainState===Er.UNLOADED&&zft(s,n,e.x,e.y,e.level),s.terrainState===Er.RECEIVED&&Gft(s,t,n,e.x,e.y,e.level),s.terrainState===Er.TRANSFORMED&&(Wft(s,t.context,n,e.x,e.y,e.level,o),s.updateExaggeration(e,t,r)),s.terrainState>=Er.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)qft(t.context,s);else{let u=s._findAncestorTileWithTerrainData(e);l(u)&&l(u.data.waterMaskTexture)&&(s.waterMaskTexture=u.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,u,s.waterMaskTranslationAndScale))}}function Uft(e,t,n,i,r,o,s){let a=t.parent;if(!a){t.state=oa.FAILED;return}let c=a.data.terrainData,u=a.x,f=a.y,d=a.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,u,f,d,r,o,s);!l(p)||(e.terrainState=Er.RECEIVING,Promise.resolve(p).then(function(g){e.terrainData=g,e.terrainState=Er.RECEIVED}).catch(function(){e.terrainState=Er.FAILED}))}function zft(e,t,n,i,r){function o(c){e.terrainData=c,e.terrainState=Er.RECEIVED,e.request=void 0}function s(c){if(e.request.state===mi.CANCELLED){e.terrainData=void 0,e.terrainState=Er.UNLOADED,e.request=void 0;return}e.terrainState=Er.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${r}. Error message: "${c}"`;t._requestError=jn.reportError(t._requestError,t,t.errorEvent,u,n,i,r),t._requestError.retry&&a()}function a(){let c=new oo({throttle:!1,throttleByServer:!0,type:ro.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,r,c);l(u)?(e.terrainState=Er.RECEIVING,Promise.resolve(u).then(function(f){o(f)}).catch(function(f){s(f)})):(e.terrainState=Er.UNLOADED,e.request=void 0)}a()}var Hft={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Gft(e,t,n,i,r,o){let s=n.tilingScheme,a=Hft;a.tilingScheme=s,a.x=i,a.y=r,a.level=o,a.exaggeration=t.terrainExaggeration,a.exaggerationRelativeHeight=t.terrainExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);!l(u)||(e.terrainState=Er.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=Er.TRANSFORMED}).catch(function(){e.terrainState=Er.FAILED}))}to._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=at.createVertexBuffer({context:e,typedArray:n,usage:Ne.STATIC_DRAW}),r=t.encoding.getAttributes(i),o=t.indices.indexBuffers||{},s=o[e.id];if(!l(s)||s.isDestroyed()){let a=t.indices;s=at.createIndexBuffer({context:e,typedArray:a,usage:Ne.STATIC_DRAW,indexDatatype:Le.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,o[e.id]=s,t.indices.indexBuffers=o}else++s.referenceCount;return new Qn({context:e,attributes:r,indexBuffer:s})};to._freeVertexArray=function(e){if(l(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),l(t)&&!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function Wft(e,t,n,i,r,o,s){e.vertexArray=to._createVertexArrayForMesh(t,e.mesh),e.terrainState=Er.READY,e.fill=e.fill&&e.fill.destroy(s)}function jft(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=wt.create({context:e,pixelFormat:ct.LUMINANCE,pixelDatatype:qe.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new on({wrapS:mn.CLAMP_TO_EDGE,wrapT:mn.CLAMP_TO_EDGE,minificationFilter:It.LINEAR,magnificationFilter:Xi.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function qft(e,t){let n=t.terrainData.waterMask,i=jft(e),r,o=n.length;if(o===1)if(n[0]!==0)r=i.allWaterTexture;else return;else{let s=Math.sqrt(o);r=wt.create({context:e,pixelFormat:ct.LUMINANCE,pixelDatatype:qe.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),r.referenceCount=0}++r.referenceCount,t.waterMaskTexture=r,se.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}to.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;l(t)&&(!l(t.data)||!l(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};to.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,r=e.rectangle,o=r.width,s=r.height,a=o/i.width,c=s/i.height;return n.x=a*(r.west-i.west)/o,n.y=c*(r.south-i.south)/s,n.z=a,n.w=c,n};var Qd=to;var TU=`uniform sampler2D u_texture;
- varying vec2 v_textureCoordinates;
- void main()
- {
- gl_FragColor = texture2D(u_texture, v_textureCoordinates);
- }
- `;var bU=`attribute vec4 position;
- attribute float webMercatorT;
- uniform vec2 u_textureDimensions;
- varying vec2 v_textureCoordinates;
- void main()
- {
- v_textureCoordinates = vec2(position.x, webMercatorT);
- gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));
- }
- `;function OE(e,t,n,i,r){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let o=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(o,s,a)}this.state=ui.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!l(r)&&e.imageryProvider.ready&&(r=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=r}OE.createPlaceholder=function(e){let t=new OE(e,0,0,0);return t.addReference(),t.state=ui.PLACEHOLDER,t};OE.prototype.addReference=function(){++this.referenceCount};OE.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),ue(this),0):this.referenceCount};OE.prototype.processStateMachine=function(e,t,n){this.state===ui.UNLOADED&&!n&&(this.state=ui.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===ui.RECEIVED&&(this.state=ui.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===ui.READY&&t&&!this.texture;(this.state===ui.TEXTURE_LOADED||i)&&(this.state=ui.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var x1=OE;function $q(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}$q.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};$q.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,r=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===ui.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this),!0;let o=i.parent,s;for(;l(o)&&(o.state!==ui.READY||!this.useWebMercatorT&&!l(o.texture));)o.state!==ui.FAILED&&o.state!==ui.INVALID&&(s=s||o),o=o.parent;return this.readyImagery!==o&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=o,l(o)&&(o.addReference(),this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this))),i.state===ui.FAILED||i.state===ui.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var C1=$q;function Hi(e,t){this._imageryProvider=e,t=y(t,y.EMPTY_OBJECT),this.alpha=y(t.alpha,y(e.defaultAlpha,1)),this.nightAlpha=y(t.nightAlpha,y(e.defaultNightAlpha,1)),this.dayAlpha=y(t.dayAlpha,y(e.defaultDayAlpha,1)),this.brightness=y(t.brightness,y(e.defaultBrightness,Hi.DEFAULT_BRIGHTNESS)),this.contrast=y(t.contrast,y(e.defaultContrast,Hi.DEFAULT_CONTRAST)),this.hue=y(t.hue,y(e.defaultHue,Hi.DEFAULT_HUE)),this.saturation=y(t.saturation,y(e.defaultSaturation,Hi.DEFAULT_SATURATION)),this.gamma=y(t.gamma,y(e.defaultGamma,Hi.DEFAULT_GAMMA)),this.splitDirection=y(t.splitDirection,y(e.defaultSplit,Hi.DEFAULT_SPLIT)),this.minificationFilter=y(t.minificationFilter,y(e.defaultMinificationFilter,Hi.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=y(t.magnificationFilter,y(e.defaultMagnificationFilter,Hi.DEFAULT_MAGNIFICATION_FILTER)),this.show=y(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=y(t.rectangle,he.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new C1(x1.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=y(t.colorToAlphaThreshold,Hi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD),this._marsOptions=y(t.marsOptions,{}),this._initByMars3D&&this._initByMars3D(e,t)}Object.defineProperties(Hi.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}}});Hi.DEFAULT_BRIGHTNESS=1;Hi.DEFAULT_CONTRAST=1;Hi.DEFAULT_HUE=0;Hi.DEFAULT_SATURATION=1;Hi.DEFAULT_GAMMA=1;Hi.DEFAULT_SPLIT=as.NONE;Hi.DEFAULT_MINIFICATION_FILTER=It.LINEAR;Hi.DEFAULT_MAGNIFICATION_FILTER=Xi.LINEAR;Hi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Hi.prototype.isBaseLayer=function(){return this._isBaseLayer};Hi.prototype.isDestroyed=function(){return!1};Hi.prototype.destroy=function(){return ue(this)};var t0e=new he,Qge=new he,Zq=new he,n0e=new he;Hi.prototype.getViewableRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return e.readyPromise.then(function(){return he.intersection(e.rectangle,t)})};Hi.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;let r=this._imageryProvider;if(l(n)||(n=i.imagery.length),!r.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let o=r.tilingScheme.projection instanceof ji&&e.rectangle.north<ji.MaximumLatitude&&e.rectangle.south>-ji.MaximumLatitude,s=he.intersection(r.rectangle,this._rectangle,t0e),a=he.intersection(e.rectangle,s,Qge);if(!l(a)){if(!this.isBaseLayer())return!1;let v=s,P=e.rectangle;a=Qge,P.south>=v.north?a.north=a.south=v.north:P.north<=v.south?a.north=a.south=v.south:(a.south=Math.max(P.south,v.south),a.north=Math.min(P.north,v.north)),P.west>=v.east?a.west=a.east=v.east:P.east<=v.west?a.west=a.east=v.west:(a.west=Math.max(P.west,v.west),a.east=Math.min(P.east,v.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),d=Kft(this,f,c);d=Math.max(0,d);let p=r.maximumLevel;if(d>p&&(d=p),l(r.minimumLevel)){let v=r.minimumLevel;d<v&&(d=v)}let g=r.tilingScheme,m=g.positionToTileXY(he.northwest(a),d),x=g.positionToTileXY(he.southeast(a),d),C=e.rectangle.width/512,A=e.rectangle.height/512,b=g.tileXYToRectangle(m.x,m.y,d);Math.abs(b.south-e.rectangle.north)<A&&m.y<x.y&&++m.y,Math.abs(b.east-e.rectangle.west)<C&&m.x<x.x&&++m.x;let T=g.tileXYToRectangle(x.x,x.y,d);Math.abs(T.north-e.rectangle.south)<A&&x.y>m.y&&--x.y,Math.abs(T.west-e.rectangle.east)<C&&x.x>m.x&&--x.x;let S=he.clone(e.rectangle,n0e),w=g.tileXYToRectangle(m.x,m.y,d),D=he.intersection(w,s,Zq),I;o?(g.rectangleToNativeRectangle(S,S),g.rectangleToNativeRectangle(w,w),g.rectangleToNativeRectangle(D,D),g.rectangleToNativeRectangle(s,s),I=g.tileXYToNativeRectangle.bind(g),C=S.width/512,A=S.height/512):I=g.tileXYToRectangle.bind(g);let O,B=0,L=1,_;!this.isBaseLayer()&&Math.abs(D.west-S.west)>=C&&(B=Math.min(1,(D.west-S.west)/S.width)),!this.isBaseLayer()&&Math.abs(D.north-S.north)>=A&&(L=Math.max(0,(D.north-S.south)/S.height));let E=L;for(let v=m.x;v<=x.x;v++)if(O=B,w=I(v,m.y,d),D=he.simpleIntersection(w,s,Zq),!!l(D)){B=Math.min(1,(D.east-S.west)/S.width),v===x.x&&(this.isBaseLayer()||Math.abs(D.east-S.east)<C)&&(B=1),L=E;for(let P=m.y;P<=x.y;P++){if(_=L,w=I(v,P,d),D=he.simpleIntersection(w,s,Zq),!l(D))continue;L=Math.max(0,(D.south-S.south)/S.height),P===x.y&&(this.isBaseLayer()||Math.abs(D.south-S.south)<A)&&(L=0);let R=new se(O,L,B,_),F=this.getImageryFromCache(v,P,d);i.imagery.splice(n,0,new C1(F,R,o)),++n}}return!0};Hi.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,t0e),i=c.rectangleToNativeRectangle(i,n0e)}let r=i.width,o=i.height,s=r/n.width,a=o/n.height;return new se(s*(i.west-n.west)/r,a*(i.south-n.south)/o,s,a)};Hi.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return r();e.image=s,e.state=ui.RECEIVED,e.request=void 0,jn.reportSuccess(n._requestImageError),n._marsOptions.onAddTileSuccess&&n._marsOptions.onAddTileSuccess(e)}function r(s){if(!e.request||e.request.state===mi.CANCELLED){e.state=ui.UNLOADED,e.request=void 0;return}e.state=ui.FAILED,e.request=void 0;let a=`\u65E0\u6CD5\u83B7\u5F97\u56FE\u5757 X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=jn.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&o(),n._marsOptions.onAddTileError&&n._marsOptions.onAddTileError(e)}function o(){let s=new oo({throttle:!1,throttleByServer:!0,type:ro.IMAGERY});e.request=s,e.state=ui.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=ui.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),n._marsOptions.onAddTile&&n._marsOptions.onAddTile(e),a.then?a.then(function(c){i(c)}).catch(function(c){r(c)}):i(a)}o()};Hi.prototype._createTextureWebGL=function(e,t){let n=new on({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new wt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new wt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?ct.RGBA:ct.RGB,sampler:n})};Hi.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let o=n.tileDiscardPolicy;if(l(o)){if(!o.isReady()){t.state=ui.RECEIVED;return}if(o.shouldDiscardImage(i)){t.state=ui.INVALID;return}}}let r=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof ji?t.textureWebMercator=r:t.texture=r,t.image=void 0,t.state=ui.TEXTURE_LOADED};function e0e(e,t,n){return`${e}:${t}:${n}`}Hi.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===It.LINEAR&&i===Xi.LINEAR&&!ct.isCompressedFormat(t.pixelFormat)&&M.isPowerOfTwo(t.width)&&M.isPowerOfTwo(t.height)){n=It.LINEAR_MIPMAP_LINEAR;let o=Bt.maximumTextureFilterAnisotropy,s=Math.min(o,y(this._maximumAnisotropy,o)),a=e0e(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[a];l(u)||(u=c[a]=new on({wrapS:mn.CLAMP_TO_EDGE,wrapT:mn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(cp.NICEST),t.sampler=u}else{let o=e0e(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[o];l(a)||(a=s[o]=new on({wrapS:mn.CLAMP_TO_EDGE,wrapT:mn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Hi.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,r=t.rectangle,o=e.context;if(n=y(n,!0),n&&!(this._imageryProvider.tilingScheme.projection instanceof Ii)&&r.width/i.width>1e-5){let s=this;t.addReference();let a=new cd({persists:!0,owner:this,preExecute:function(c){Xft(c,o,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(o,c),t.state=ui.READY,t.releaseReference()},canceled:function(){t.state=ui.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(o,i),t.state=ui.READY};Hi.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};Hi.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Hi.prototype.getImageryFromCache=function(e,t,n,i){let r=i0e(e,t,n),o=this._imageryCache[r];return l(o)||(o=new x1(this,e,t,n,i),this._imageryCache[r]=o),o.addReference(),o};Hi.prototype.removeImageryFromCache=function(e){this._marsOptions.onRemoveTile&&this._marsOptions.onRemoveTile(e);let t=i0e(e.x,e.y,e.level);delete this._imageryCache[t]};function i0e(e,t,n){return JSON.stringify([e,t,n])}var EU={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new W,texture:void 0},Yft=Et.supportsTypedArrays()?new Float32Array(2*64):void 0;function Xft(e,t,n,i){let r=t.cache.imageryLayer_reproject;if(!l(r)){r=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let C=new Float32Array(2*64*2),A=0;for(let D=0;D<64;++D){let I=D/63;C[A++]=0,C[A++]=I,C[A++]=1,C[A++]=I}let b={position:0,webMercatorT:1},T=ns.getRegularGridIndices(2,64),S=at.createIndexBuffer({context:t,typedArray:T,usage:Ne.STATIC_DRAW,indexDatatype:Le.UNSIGNED_SHORT});r.vertexArray=new Qn({context:t,attributes:[{index:b.position,vertexBuffer:at.createVertexBuffer({context:t,typedArray:C,usage:Ne.STATIC_DRAW}),componentsPerAttribute:2},{index:b.webMercatorT,vertexBuffer:at.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Ne.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:S});let w=new Fe({sources:[bU]});r.shaderProgram=Wt.fromCache({context:t,vertexShaderSource:w,fragmentShaderSource:TU,attributeLocations:b}),r.sampler=new on({wrapS:mn.CLAMP_TO_EDGE,wrapT:mn.CLAMP_TO_EDGE,minificationFilter:It.LINEAR,magnificationFilter:Xi.LINEAR})}n.sampler=r.sampler;let o=n.width,s=n.height;EU.textureDimensions.x=o,EU.textureDimensions.y=s,EU.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let u=.5*Math.log((1+a)/(1-a)),f=1/(u-c),d=new wt({context:t,width:o,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});M.isPowerOfTwo(o)&&M.isPowerOfTwo(s)&&d.generateMipmap(cp.NICEST);let p=i.south,g=i.north,m=Yft,x=0;for(let C=0;C<64;++C){let A=C/63,b=M.lerp(p,g,A);a=Math.sin(b);let S=(.5*Math.log((1+a)/(1-a))-c)*f;m[x++]=S,m[x++]=S}r.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(m),e.shaderProgram=r.shaderProgram,e.outputTexture=d,e.uniformMap=EU,e.vertexArray=r.vertexArray}function Kft(e,t,n){let i=e._imageryProvider,r=i.tilingScheme,o=r.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Ii?1:Math.cos(n),a=r.rectangle,u=o.maximumRadius*a.width*s/(i.tileWidth*r.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}var Nf=Hi;var r0e={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=r0e.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},Kn=r0e;function ME(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se}ME.prototype.update=function(e,t,n){this.changedThisFrame&&(f0e(e,t,this.tile,n),this.changedThisFrame=!1)};ME.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};ME.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):Qd._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var $ft=new rl;ME.updateFillTiles=function(e,t,n,i){let r=e._quadtree,o=r._levelZeroTiles,s=r._lastSelectionFrameNumber,a=$ft;a.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&a.enqueue(t[u])}let c=a.dequeue();for(;c!==void 0;){let u=c.findTileToWest(o),f=c.findTileToSouth(o),d=c.findTileToEast(o),p=c.findTileToNorth(o);As(e,n,c,u,s,pn.EAST,!1,a,i),As(e,n,c,f,s,pn.NORTH,!1,a,i),As(e,n,c,d,s,pn.WEST,!1,a,i),As(e,n,c,p,s,pn.SOUTH,!1,a,i);let g=u.findTileToNorth(o),m=u.findTileToSouth(o),x=d.findTileToNorth(o),C=d.findTileToSouth(o);As(e,n,c,g,s,pn.SOUTHEAST,!1,a,i),As(e,n,c,x,s,pn.SOUTHWEST,!1,a,i),As(e,n,c,m,s,pn.NORTHEAST,!1,a,i),As(e,n,c,C,s,pn.NORTHWEST,!1,a,i),c=a.dequeue()}};function As(e,t,n,i,r,o,s,a,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==r||Kn.wasKicked(u._lastSelectionResult)||Kn.originalResult(u._lastSelectionResult)===Kn.CULLED);){if(s)return;let f=u.parent;if(o>=pn.NORTHWEST&&f!==void 0)switch(o){case pn.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case pn.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case pn.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case pn.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===Kn.RENDERED){if(l(u.data.vertexArray))return;Zft(e,t,n,u,o,r,a,c);return}if(Kn.originalResult(i._lastSelectionResult)!==Kn.CULLED)switch(o){case pn.WEST:As(e,t,n,i.northwestChild,r,o,!0,a,c),As(e,t,n,i.southwestChild,r,o,!0,a,c);break;case pn.EAST:As(e,t,n,i.southeastChild,r,o,!0,a,c),As(e,t,n,i.northeastChild,r,o,!0,a,c);break;case pn.SOUTH:As(e,t,n,i.southwestChild,r,o,!0,a,c),As(e,t,n,i.southeastChild,r,o,!0,a,c);break;case pn.NORTH:As(e,t,n,i.northeastChild,r,o,!0,a,c),As(e,t,n,i.northwestChild,r,o,!0,a,c);break;case pn.NORTHWEST:As(e,t,n,i.northwestChild,r,o,!0,a,c);break;case pn.NORTHEAST:As(e,t,n,i.northeastChild,r,o,!0,a,c);break;case pn.SOUTHWEST:As(e,t,n,i.southwestChild,r,o,!0,a,c);break;case pn.SOUTHEAST:As(e,t,n,i.southeastChild,r,o,!0,a,c);break;default:throw new ye("Invalid edge")}}}function Zft(e,t,n,i,r,o,s,a){let c=i.data;if(c.fill===void 0)c.fill=new ME(i);else if(c.fill.visitedFrame===o)return;c.fill.enqueuedFrame!==o&&(c.fill.enqueuedFrame=o,c.fill.changedThisFrame=!1,s.enqueue(i)),Jft(e,t,n,i,r,a)}function Jft(e,t,n,i,r,o){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(f0e(e,t,n,o),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(r){case pn.WEST:u=s.westMeshes,f=s.westTiles;break;case pn.SOUTH:u=s.southMeshes,f=s.southTiles;break;case pn.EAST:u=s.eastMeshes,f=s.eastTiles;break;case pn.NORTH:u=s.northMeshes,f=s.northTiles;break;case pn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case pn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case pn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case pn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let d,p,g,m,x=n.rectangle,C,A=i.rectangle;switch(r){case pn.WEST:for(C=(A.north-A.south)*M.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!M.greaterThan(x.north,m.south,C));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!M.greaterThanOrEquals(x.south,m.north,C));++p);break;case pn.SOUTH:for(C=(A.east-A.west)*M.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!M.lessThan(x.west,m.east,C));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!M.lessThanOrEquals(x.east,m.west,C));++p);break;case pn.EAST:for(C=(A.north-A.south)*M.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!M.lessThan(x.south,m.north,C));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!M.lessThanOrEquals(x.north,m.south,C));++p);break;case pn.NORTH:for(C=(A.east-A.west)*M.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!M.greaterThan(x.east,m.west,C));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!M.greaterThanOrEquals(x.west,m.east,C));++p);break}p-d===1?(s.changedThisFrame=s.changedThisFrame||u[d]!==a,u[d]=a,f[d]=n):(s.changedThisFrame=!0,u.splice(d,p-d,a),f.splice(d,p-d,n))}var uC=new me,Qft=new me,RE=new h,tY=new h,Jq=new W,Qq=new W,wu=new W;function OU(){this.height=0,this.encodedNormal=new W}function SU(e,t,n,i,r,o,s,a,c){if(l(r))return r;let u;if(l(o)&&l(s))u=(o.height+s.height)*.5;else if(l(o))u=o.height;else if(l(s))u=s.height;else if(l(a))u=a.height;else{let d=e.tile.data.tileBoundingRegion,p=0,g=0;l(d)&&(p=d.minimumHeight,g=d.maximumHeight),u=(p+g)*.5}return d0e(e,t,n,i,u,c),c}var edt={minimumHeight:0,maximumHeight:0},tdt=new h,o0e=new OU,s0e=new OU,a0e=new OU,c0e=new OU,ndt=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,idt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function f0e(e,t,n,i){Qd.initialize(n,e.terrainProvider,e._imageryLayers);let r=n.data,o=r.fill,s=n.rectangle,a=t.terrainExaggeration,c=t.terrainExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,d=vU(o,f,0,1,o.northwestTile,o.northwestMesh,o.northTiles,o.northMeshes,o.westTiles,o.westMeshes,a0e),p=vU(o,f,0,0,o.southwestTile,o.southwestMesh,o.westTiles,o.westMeshes,o.southTiles,o.southMeshes,o0e),g=vU(o,f,1,0,o.southeastTile,o.southeastMesh,o.southTiles,o.southMeshes,o.eastTiles,o.eastMeshes,s0e),m=vU(o,f,1,1,o.northeastTile,o.northeastMesh,o.eastTiles,o.eastMeshes,o.northTiles,o.northMeshes,c0e);d=SU(o,f,0,1,d,p,m,g,a0e),p=SU(o,f,0,0,p,d,g,m,o0e),g=SU(o,f,1,1,g,p,m,d,s0e),m=SU(o,f,1,1,m,g,d,p,c0e);let x=p.height,C=g.height,A=d.height,b=m.height,T=Math.min(x,C,A,b),S=Math.max(x,C,A,b),w=(T+S)*.5,D,I,O=e.getLevelMaximumGeometricError(n.level),B=f.maximumRadius-O,L=Math.acos(B/f.maximumRadius)*4;if(L*=1.5,s.width>L&&S-T<=O){let v=new Fa({width:9,height:9,buffer:ndt,structure:{heightOffset:S}}),P=idt;P.tilingScheme=n.tilingScheme,P.x=n.x,P.y=n.y,P.level=n.level,P.exaggeration=a,P.exaggerationRelativeHeight=c,o.mesh=v._createMeshSync(P)}else{let v=u,P=he.center(s,Qft);P.height=w;let R=f.cartographicToCartesian(P,tdt),F=new mc(R,void 0,void 0,void 0,void 0,!0,!0,v,a,c),U=5,k;for(k=o.westMeshes,D=0,I=k.length;D<I;++D)U+=k[D].eastIndicesNorthToSouth.length;for(k=o.southMeshes,D=0,I=k.length;D<I;++D)U+=k[D].northIndicesWestToEast.length;for(k=o.eastMeshes,D=0,I=k.length;D<I;++D)U+=k[D].westIndicesSouthToNorth.length;for(k=o.northMeshes,D=0,I=k.length;D<I;++D)U+=k[D].southIndicesEastToWest.length;let H=edt;H.minimumHeight=T,H.maximumHeight=S;let V=F.stride,q=new Float32Array(U*V),j=0,X=j;j=wU(f,s,F,q,j,0,1,d.height,d.encodedNormal,1,H),j=PU(o,f,F,q,j,o.westTiles,o.westMeshes,pn.EAST,H);let G=j;j=wU(f,s,F,q,j,0,0,p.height,p.encodedNormal,0,H),j=PU(o,f,F,q,j,o.southTiles,o.southMeshes,pn.NORTH,H);let $=j;j=wU(f,s,F,q,j,1,0,g.height,g.encodedNormal,0,H),j=PU(o,f,F,q,j,o.eastTiles,o.eastMeshes,pn.WEST,H);let J=j;j=wU(f,s,F,q,j,1,1,m.height,m.encodedNormal,1,H),j=PU(o,f,F,q,j,o.northTiles,o.northMeshes,pn.SOUTH,H),T=H.minimumHeight,S=H.maximumHeight;let ce=Ai.fromRectangle(s,T,S,n.tilingScheme.ellipsoid),de=ji.geodeticLatitudeToMercatorAngle(s.south),ie=1/(ji.geodeticLatitudeToMercatorAngle(s.north)-de),ae=(ji.geodeticLatitudeToMercatorAngle(P.latitude)-de)*ie,_e=f.geodeticSurfaceNormalCartographic(uC,tY),be=In.octEncode(_e,Jq),Te=j;F.encode(q,j*V,ce.center,W.fromElements(.5,.5,wu),w,be,ae,_e),++j;let Oe=j,Be=Oe<256?1:2,tt=(Oe-1)*3,lt=tt*Be,Pt=(q.length-Oe*V)*Float32Array.BYTES_PER_ELEMENT,ht;if(Pt>=lt){let we=Oe*V*Float32Array.BYTES_PER_ELEMENT;ht=Oe<256?new Uint8Array(q.buffer,we,tt):new Uint16Array(q.buffer,we,tt)}else ht=Oe<256?new Uint8Array(tt):new Uint16Array(tt);q=new Float32Array(q.buffer,0,Oe*V);let wn=0;for(D=0;D<Oe-2;++D)ht[wn++]=Te,ht[wn++]=D,ht[wn++]=D+1;ht[wn++]=Te,ht[wn++]=D,ht[wn++]=0;let ii=[];for(D=G;D>=X;--D)ii.push(D);let nt=[];for(D=$;D>=G;--D)nt.push(D);let Mt=[];for(D=J;D>=$;--D)Mt.push(D);let ri=[];for(ri.push(0),D=Te-1;D>=J;--D)ri.push(D);o.mesh=new Kf(F.center,q,ht,tt,Oe,T,S,re.fromOrientedBoundingBox(ce),udt(e,ce.center,s,T,S),F.stride,ce,F,ii,nt,Mt,ri)}let _=t.context;o._destroyVertexArray(i),o.vertexArray=Qd._createVertexArrayForMesh(_,o.mesh),r.processImagery(n,e.terrainProvider,t,!0);let E=o.waterMaskTexture;if(o.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let v=r._findAncestorTileWithTerrainData(n);l(v)&&l(v.data.waterMaskTexture)&&(o.waterMaskTexture=v.data.waterMaskTexture,++o.waterMaskTexture.referenceCount,r._computeWaterMaskTranslationAndScale(n,v,o.waterMaskTranslationAndScale))}l(E)&&(--E.referenceCount,E.referenceCount===0&&E.destroy())}function wU(e,t,n,i,r,o,s,a,c,u,f){let d=uC;d.longitude=M.lerp(t.west,t.east,o),d.latitude=M.lerp(t.south,t.north,s),d.height=a;let p=e.cartographicToCartesian(d,RE),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,tY));let m=Qq;return m.x=o,m.y=s,n.encode(i,r*n.stride,p,m,a,c,u,g),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),r+1}var IU=new he;function A1(e,t,n,i){let r=e.rectangle,o=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(r=he.clone(e.rectangle,IU),r.west-=M.TWO_PI,r.east-=M.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(r=he.clone(e.rectangle,IU),r.west+=M.TWO_PI,r.east+=M.TWO_PI);let s=r.east-r.west,a=(o.west-r.west)/s,c=(o.east-r.west)/s,u=r.north-r.south,f=(o.south-r.south)/u,d=(o.north-r.south)/u,p=(n.x-a)/(c-a),g=(n.y-f)/(d-f);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=p,i.y=g,i}var rdt=new W;function eY(e,t,n,i,r){let o=e.encoding,s=e.vertices;if(r.height=o.decodeHeight(s,t),o.hasVertexNormals)o.getOctEncodedNormal(s,t,r.encodedNormal);else{let a=r.encodedNormal;a.x=0,a.y=0}}var odt=new W,sdt=new h;function adt(e,t,n,i,r,o,s,a,c,u){let f=i.encoding,d=i.vertices,p=A1(t,n,f.decodeTextureCoordinates(d,r,wu),wu),g=A1(t,n,f.decodeTextureCoordinates(d,o,Qq),Qq),m;c?m=(s-p.x)/(g.x-p.x):m=(a-p.y)/(g.y-p.y);let x=f.decodeHeight(d,r),C=f.decodeHeight(d,o),A=n.rectangle;uC.longitude=M.lerp(A.west,A.east,s),uC.latitude=M.lerp(A.south,A.north,a),u.height=uC.height=M.lerp(x,C,m);let b;if(f.hasVertexNormals){let T=f.getOctEncodedNormal(d,r,rdt),S=f.getOctEncodedNormal(d,o,odt),w=In.octDecode(T.x,T.y,RE),D=In.octDecode(S.x,S.y,sdt);b=h.lerp(w,D,m,RE),h.normalize(b,b),In.octEncode(b,u.encodedNormal)}else b=e.geodeticSurfaceNormalCartographic(uC,RE),In.octEncode(b,u.encodedNormal)}function d0e(e,t,n,i,r,o){o.height=r;let s=t.geodeticSurfaceNormalCartographic(uC,RE);In.octEncode(s,o.encodedNormal)}function vU(e,t,n,i,r,o,s,a,c,u,f){if(u0e(e,t,a,s,!1,n,i,f)||u0e(e,t,u,c,!0,n,i,f))return f;let p;if(nY(r,o))return n===0?i===0?p=o.eastIndicesNorthToSouth[0]:p=o.southIndicesEastToWest[0]:i===0?p=o.northIndicesWestToEast[0]:p=o.westIndicesSouthToNorth[0],eY(o,p,n,i,f),f;let g;if(n===0?i===0?g=DU(e.westMeshes,e.westTiles,pn.EAST,e.southMeshes,e.southTiles,pn.NORTH,n,i):g=DU(e.northMeshes,e.northTiles,pn.SOUTH,e.westMeshes,e.westTiles,pn.EAST,n,i):i===0?g=DU(e.southMeshes,e.southTiles,pn.NORTH,e.eastMeshes,e.eastTiles,pn.WEST,n,i):g=DU(e.eastMeshes,e.eastTiles,pn.WEST,e.northMeshes,e.northTiles,pn.SOUTH,n,i),l(g))return d0e(e,t,n,i,g,f),f}function DU(e,t,n,i,r,o,s,a){let c=l0e(e,t,!1,n,s,a),u=l0e(i,r,!0,o,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function PU(e,t,n,i,r,o,s,a,c){for(let u=0;u<o.length;++u)r=cdt(e,t,n,i,r,o[u],s[u],a,c);return r}function cdt(e,t,n,i,r,o,s,a,c){let u=o.rectangle;a===pn.EAST&&e.tile.x===0?(u=he.clone(o.rectangle,IU),u.west-=M.TWO_PI,u.east-=M.TWO_PI):a===pn.WEST&&o.x===0&&(u=he.clone(o.rectangle,IU),u.west+=M.TWO_PI,u.east+=M.TWO_PI);let f=e.tile.rectangle,d,p;r>0&&(n.decodeTextureCoordinates(i,r-1,wu),d=wu.x,p=wu.y);let g,m;switch(a){case pn.WEST:g=s.westIndicesSouthToNorth,m=!1;break;case pn.NORTH:g=s.northIndicesWestToEast,m=!0;break;case pn.EAST:g=s.eastIndicesNorthToSouth,m=!1;break;case pn.SOUTH:g=s.southIndicesEastToWest,m=!0;break}let x=o,C=e.tile,A=s.encoding,b=s.vertices,T=n.stride,S,w;A.hasWebMercatorT&&(S=ji.geodeticLatitudeToMercatorAngle(f.south),w=1/(ji.geodeticLatitudeToMercatorAngle(f.north)-S));for(let D=0;D<g.length;++D){let I=g[D],O=A.decodeTextureCoordinates(b,I,wu);A1(x,C,O,O);let B=O.x,L=O.y,_=m?B:L;if(_<0||_>1||Math.abs(B-d)<M.EPSILON5&&Math.abs(L-p)<M.EPSILON5)continue;let E=Math.abs(B)<M.EPSILON5||Math.abs(B-1)<M.EPSILON5,v=Math.abs(L)<M.EPSILON5||Math.abs(L-1)<M.EPSILON5;if(E&&v)continue;let P=A.decodePosition(b,I,RE),R=A.decodeHeight(b,I),F;A.hasVertexNormals?F=A.getOctEncodedNormal(b,I,Jq):(F=Jq,F.x=0,F.y=0);let U=L;if(A.hasWebMercatorT){let H=M.lerp(f.south,f.north,L);U=(ji.geodeticLatitudeToMercatorAngle(H)-S)*w}let k;n.hasGeodeticSurfaceNormals&&(k=t.geodeticSurfaceNormal(P,tY)),n.encode(i,r*T,P,O,R,F,U,k),c.minimumHeight=Math.min(c.minimumHeight,R),c.maximumHeight=Math.max(c.maximumHeight,R),++r}return r}function l0e(e,t,n,i,r,o){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let u=s;u!==a;u+=c){let f=e[u],d=t[u];if(!nY(d,f))continue;let p;switch(i){case pn.WEST:p=f.westIndicesSouthToNorth;break;case pn.SOUTH:p=f.southIndicesEastToWest;break;case pn.EAST:p=f.eastIndicesNorthToSouth;break;case pn.NORTH:p=f.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return f.encoding.decodeHeight(f.vertices,g)}}function nY(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function u0e(e,t,n,i,r,o,s,a){let c,u,f,d,p,g=i[r?0:n.length-1],m=n[r?0:n.length-1];if(nY(g,m)&&(o===0?s===0?(c=r?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,u=r,f=r):(c=r?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,u=!r,f=!1):s===0?(c=r?m.westIndicesSouthToNorth:m.northIndicesWestToEast,u=!r,f=!0):(c=r?m.southIndicesEastToWest:m.westIndicesSouthToNorth,u=r,f=!r),c.length>0)){d=r?0:c.length-1,p=c[d],m.encoding.decodeTextureCoordinates(m.vertices,p,wu);let x=A1(g,e.tile,wu,wu);if(x.x===o&&x.y===s)return eY(m,p,o,s,a),!0;if(d=ao(c,u?o:s,function(C,A){m.encoding.decodeTextureCoordinates(m.vertices,C,wu);let b=A1(g,e.tile,wu,wu);return f?u?b.x-o:b.y-s:u?o-b.x:s-b.y}),d<0){if(d=~d,d>0&&d<c.length)return adt(t,g,e.tile,m,c[d-1],c[d],o,s,u,a),!0}else return eY(m,c[d],o,s,a),!0}return!1}var ldt=[new h,new h,new h,new h];function udt(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=ldt;return h.fromRadians(n.west,n.south,r,a,c[0]),h.fromRadians(n.east,n.south,r,a,c[1]),h.fromRadians(n.west,n.north,r,a,c[2]),h.fromRadians(n.east,n.north,r,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}var T1=ME;function no(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=Zt.RECEIVE_ONLY,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new ge,this._imageryLayers.layerAdded.addEventListener(no.prototype._onLayerAdded,this),this._imageryLayers.layerRemoved.addEventListener(no.prototype._onLayerRemoved,this),this._imageryLayers.layerMoved.addEventListener(no.prototype._onLayerMoved,this),this._imageryLayers.layerShownOrHidden.addEventListener(no.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new ge,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new z(0,0,.5,1),this._clippingPlanes=void 0,this.cartographicLimitRectangle=he.clone(he.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldTerrainExaggeration=void 0,this._oldTerrainExaggerationRelativeHeight=void 0,this._initByMars3D&&this._initByMars3D(e)}Object.defineProperties(no.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=se.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return this._terrainProvider.ready&&(this._imageryLayers.length===0||this._imageryLayers.get(0).imageryProvider.ready)}},tilingScheme:{get:function(){return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){vs.setOwner(e,this,"_clippingPlanes")}}});function fdt(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}no.prototype.update=function(e){this._imageryLayers._update()};function ddt(e,t){let n=t.creditDisplay;e._terrainProvider.ready&&l(e._terrainProvider.credit)&&n.addCredit(e._terrainProvider.credit);let i=e._imageryLayers;for(let r=0,o=i.length;r<o;++r){let s=i.get(r).imageryProvider;s.ready&&l(s.credit)&&n.addCredit(s.credit)}}no.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(fdt)})),ddt(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)Qd._freeVertexArray(t[i]);t.length=0};no.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let i=0,r=t.length;i<r;++i){let o=t[i];l(o)&&(o.length=0)}let n=this._clippingPlanes;l(n)&&n.enabled&&n.update(e),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};no.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:wc.LESS}}),this._blendRenderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:wc.LESS_OR_EQUAL},blending:hn.ALPHA_BLEND});let s=$e(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=Ve.fromCache(s),s=$e(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=Ve.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&T1.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);let t=this.quadtree,n=e.terrainExaggeration,i=e.terrainExaggerationRelativeHeight,r=this._oldTerrainExaggeration!==n||this._oldTerrainExaggerationRelativeHeight!==i;this._oldTerrainExaggeration=n,this._oldTerrainExaggerationRelativeHeight=i,r&&t.forEachLoadedTile(function(s){s.data.updateExaggeration(s,e,t)});let o=this._tilesToRenderByTextureCount;for(let s=0,a=o.length;s<a;++s){let c=o[s];if(!!l(c))for(let u=0,f=c.length;u<f;++u){let d=c[u],p=d.data.tileBoundingRegion;Ndt(this,d,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function g0e(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}no.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)g0e(t[n],e)};no.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};no.prototype.getLevelMaximumGeometricError=function(e){return this._terrainProvider.getLevelMaximumGeometricError(e)};no.prototype.loadTile=function(e,t){let n=t.data,i=!0,r;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===Kn.CULLED_BUT_NEEDED,r=n.terrainState),Qd.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i),n=t.data,i&&r!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==xo.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,Qd.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var hdt=new re,y0e=new he,mdt=new he,pdt=new me;function MU(e,t){if(t.west<t.east)return t;let n=he.clone(t,mdt);return he.center(e,pdt).longitude>0?n.east=M.PI:n.west=-M.PI,n}function x0e(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;return!!(l(n)&&n.enabled||!he.equals(e.cartographicLimitRectangle,he.MAX_VALUE))}no.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let r=x0e(this,t);if(t.fog.enabled&&!r&&M.fog(i,t.fog.density)>=1)return xo.NONE;let o=e.data,s=o.tileBoundingRegion;if(o.boundingVolumeSourceTile===void 0)return xo.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;l(c)||(c=s.boundingSphere),o.clippedByBoundaries=!1;let u=MU(e.rectangle,this.cartographicLimitRectangle),f=he.simpleIntersection(u,e.rectangle,y0e);if(!l(f))return xo.NONE;if(he.equals(f,e.rectangle)||(o.clippedByBoundaries=!0),t.mode!==te.SCENE3D&&(c=hdt,re.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),h.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===te.MORPHING&&l(o.renderedMesh)&&(c=re.union(s.boundingSphere,c,c))),!l(c))return xo.PARTIAL;let d=this._clippingPlanes;if(l(d)&&d.enabled){let x=d.computeIntersectionWithBoundingVolume(c);if(e.isClipped=x!==Jt.INSIDE,x===Jt.OUTSIDE)return xo.NONE}let p,g=a.computeVisibility(c);if(g===Jt.OUTSIDE?p=xo.NONE:g===Jt.INTERSECTING?p=xo.PARTIAL:g===Jt.INSIDE&&(p=xo.FULL),p===xo.NONE)return p;let m=t.mode===te.SCENE3D&&t.camera.frustum instanceof en;if(t.mode===te.SCENE3D&&!m&&l(n)&&!r){let x=o.occludeePointInScaledSpace;return!l(x)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(x,s.minimumHeight)?p:xo.NONE}return p};no.prototype.canRefine=function(e){return l(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var _dt=[],gdt=[];no.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=_dt;i.length=this._imageryLayers.length;let r=!1,o=!1,s;l(n)&&(r=n.terrainState===Er.READY,o=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=o;if(l(s))for(a=0,c=s.length;a<c;++a){let d=s[a],p=d.loadingImagery,g=!l(p)||p.state===ui.FAILED||p.state===ui.INVALID,m=(d.loadingImagery||d.readyImagery).imageryLayer._layerIndex;i[m]=g&&i[m]}let u=this.quadtree._lastSelectionFrameNumber,f=gdt;for(f.length=0,f.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);f.length>0;){let d=f.pop(),p=d._lastSelectionResultFrame===u?d._lastSelectionResult:Kn.NONE;if(p===Kn.RENDERED){let g=d.data;if(!l(g))continue;if(!r&&d.data.terrainState===Er.READY)return!1;let m=d.data.imagery;for(a=0,c=m.length;a<c;++a){let x=m[a],C=x.loadingImagery,A=!l(C)||C.state===ui.FAILED||C.state===ui.INVALID,b=(x.loadingImagery||x.readyImagery).imageryLayer._layerIndex;if(A&&!i[b])return!1}}else p===Kn.REFINED&&f.push(d.southwestChild,d.southeastChild,d.northwestChild,d.northeastChild)}return!0};var ydt=new h;no.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let r=t.camera.positionWC,o=t.camera.directionWC,s=h.subtract(i.center,r,ydt),a=h.magnitude(s);return a<M.EPSILON5?0:(h.divideByScalar(s,a,s),(1-h.dot(s,o))*e._distance)};var h0e=new N,RU=new N,xdt=new se,Cdt=new se,Adt=new se,Tdt=new h,m0e=new h,bdt=new h,Edt=new h;no.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let u=i[a];l(u.readyImagery)&&u.readyImagery.imageryLayer.alpha!==0&&++n}let r=this._tilesToRenderByTextureCount[n];l(r)||(r=[],this._tilesToRenderByTextureCount[n]=r),r.push(e);let o=e.data;l(o.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var Sdt=[new h,new h,new h,new h];function p0e(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Sdt;return h.fromRadians(n.west,n.south,r,a,c[0]),h.fromRadians(n.east,n.south,r,a,c[1]),h.fromRadians(n.west,n.north,r,a,c[2]),h.fromRadians(n.east,n.north,r,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}no.prototype.computeDistanceToTile=function(e,t){wdt(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let r=n.tileBoundingRegion,o=r.minimumHeight,s=r.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,u=Math.abs(c-o),f=Math.abs(c-s);u>f?(r.minimumHeight=o,r.maximumHeight=o):(r.minimumHeight=s,r.maximumHeight=s)}let a=r.distanceToCamera(t);return r.minimumHeight=o,r.maximumHeight=s,a};function wdt(e,t,n){let i=e.data;i===void 0&&(i=e.data=new Qd);let r=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new wd({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:r,minimumHeight:0,maximumHeight:0}));let o=i.tileBoundingRegion,s=o.minimumHeight,a=o.maximumHeight,c=!1,u=e,f=i.mesh,d=i.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0)o.minimumHeight=f.minimumHeight,o.maximumHeight=f.maximumHeight,c=!0;else if(d!==void 0&&d._minimumHeight!==void 0&&d._maximumHeight!==void 0)o.minimumHeight=d._minimumHeight,o.maximumHeight=d._maximumHeight;else{o.minimumHeight=Number.NaN,o.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let g=p.data;if(g!==void 0){let m=g.mesh,x=g.terrainData;if(m!==void 0&&m.minimumHeight!==void 0&&m.maximumHeight!==void 0){o.minimumHeight=m.minimumHeight,o.maximumHeight=m.maximumHeight;break}else if(x!==void 0&&x._minimumHeight!==void 0&&x._maximumHeight!==void 0){o.minimumHeight=x._minimumHeight,o.maximumHeight=x._maximumHeight;break}}p=p.parent}u=p}if(u!==void 0){let p=n.terrainExaggeration,g=n.terrainExaggerationRelativeHeight;if(p!==1&&(c=!1,o.minimumHeight=el.getHeight(o.minimumHeight,p,g),o.maximumHeight=el.getHeight(o.maximumHeight,p,g)),c)i.boundingVolumeIsFromMesh||(o._orientedBoundingBox=Ai.clone(f.orientedBoundingBox,o._orientedBoundingBox),o._boundingSphere=re.clone(f.boundingSphere3D,o._boundingSphere),i.occludeePointInScaledSpace=h.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=p0e(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace)));else{let x=o._orientedBoundingBox===void 0||o._boundingSphere===void 0;(o.minimumHeight!==s||o.maximumHeight!==a||x)&&(o.computeBoundingVolumes(r),i.occludeePointInScaledSpace=p0e(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}no.prototype.isDestroyed=function(){return!1};no.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),ue(this)};function vdt(e,t,n){return function(i){let r,o,s=-1,a=i.data.imagery,c=a.length,u;for(u=0;u<c;++u)if(r=a[u],o=y(r.readyImagery,r.loadingImagery),o.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(r=a[f],o=l(r)?y(r.readyImagery,r.loadingImagery):void 0,!l(o)||o.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}no.prototype._onLayerAdded=function(e,t){if(e.show){let n=this._terrainProvider,i=this,r=e.imageryProvider,o=this._imageryLayersUpdatedEvent;r._reload=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(l(s._loadedCallbacks[e._layerIndex]))return;let a,c=s.data.imagery,u=c.length,f=-1,d=0;for(a=0;a<u;++a){let g=c[a];if(y(g.readyImagery,g.loadingImagery).imageryLayer===e)f===-1&&(f=a),++d;else if(f!==-1)break}if(f===-1)return;let p=f+d;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=vdt(d,e,n),s.state=oa.LOADING)})},this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=oa.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==Kn.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};no.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,r=-1,o=0;for(let s=0,a=i.length;s<a;++s){let c=i[s],u=c.loadingImagery;if(l(u)||(u=c.readyImagery),u.imageryLayer===e)r===-1&&(r=s),c.freeResources(),++o;else if(r!==-1)break}r!==-1&&i.splice(r,o)}),l(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};no.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};no.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var Ddt=new N,Pdt=new N;function _0e(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_terrainExaggerationAndRelativeHeight:function(){return this.properties.terrainExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,r=N.multiplyByPoint(i,this.properties.rtc,m0e);return N.setTranslation(i,r,h0e),h0e},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,r=e.context.uniformState.projection,o=N.multiplyByPoint(i,this.properties.rtc,m0e);return N.setTranslation(i,o,RU),N.multiply(r,RU,RU),RU},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,r=l(i)?N.multiply(e.context.uniformState.view,i.modelMatrix,Ddt):N.IDENTITY;return N.inverseTranspose(r,Pdt)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_mars3dTextureInvertColor:function(){return this.properties.mars3dTextureInvertColor},u_mars3dTextureFilterColor:function(){return this.properties.mars3dTextureFilterColor},properties:{initialColor:new se(0,0,.5,1),fillHighlightColor:new z(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new W(65e5,9e6),nightFadeDistance:new W(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new h(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new h(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new h,center3D:void 0,rtc:new h,modifiedModelView:new N,tileRectangle:new se,terrainExaggerationAndRelativeHeight:new W(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new W,southMercatorYAndOneOverHeight:new W,waterMask:void 0,waterMaskTranslationAndScale:new se,minMaxHeight:new W,scaleAndBias:new N,clippingPlanesEdgeColor:z.clone(z.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new se,frontFaceAlphaByDistance:new se,backFaceAlphaByDistance:new se,localizedTranslucencyRectangle:new se,undergroundColor:z.clone(z.TRANSPARENT),undergroundColorAlphaByDistance:new se,lambertDiffuseMultiplier:0,mars3dTextureInvertColor:[],mars3dTextureFilterColor:[]}};if(t._marsOptions&&l(t._marsOptions.updateTileUniformMap)){let i=t._marsOptions.updateTileUniformMap(e,t);n=rt(n,i)}return l(t.materialUniformMap)?rt(n,t.materialUniformMap):n}function Idt(e,t,n){let i=n.data,r,o;if(l(i.vertexArray)?(r=i.mesh,o=i.vertexArray):l(i.fill)&&l(i.fill.vertexArray)&&(r=i.fill.mesh,o=i.fill.vertexArray),!(!l(r)||!l(o))){if(l(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===r)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=Odt(e,o,r),i.wireframeVertexArray.mesh=r}}function Odt(e,t,n){let r={indices:n.indices,primitiveType:Me.TRIANGLES};Bn.toWireframe(r);let o=r.indices,s=at.createIndexBuffer({context:e,typedArray:o,usage:Ne.STATIC_DRAW,indexDatatype:Le.fromSizeInBytes(o.BYTES_PER_ELEMENT)});return new Qn({context:e,attributes:t._attributes,indexBuffer:s})}var C0e,A0e,BU;(function(){let e=new pt({geometry:Ch.fromDimensions({dimensions:new h(2,2,2)})}),t=new pt({geometry:new og({radius:1})}),n=new N,i,r;function o(s){return new Tn({geometryInstances:s,appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})}C0e=function(s,a){return s===i||(BU(),i=s,n=N.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Ot.fromColor(a),r=o(e)),r},A0e=function(s,a){return s===i||(BU(),i=s,n=N.fromTranslation(s.center,n),n=N.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Ot.fromColor(a),r=o(t)),r},BU=function(){l(r)&&(r.destroy(),r=void 0,i=void 0)}})();var Rdt=new se(0,0,0,0),Mdt={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},Bdt=z.TRANSPARENT,Ldt=new St;function Ndt(e,t,n){let i=t.data;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new T1(t)),i.fill.update(e,n));let r=n.creditDisplay,o=i.terrainData;if(l(o)&&l(o.credits)){let nt=o.credits;for(let Mt=0,ri=nt.length;Mt<ri;++Mt)r.addCredit(nt[Mt])}let s=Bt.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,f=n.globeTranslucencyState,d=f.translucent,p=f.frontFaceAlphaByDistance,g=f.backFaceAlphaByDistance,m=f.rectangle,x=y(e.undergroundColor,Bdt),C=y(e.undergroundColorAlphaByDistance,Ldt),A=x0e(e,n)&&n.mode===te.SCENE3D&&x.alpha>0&&(C.nearValue>0||C.farValue>0),b=e.lambertDiffuseMultiplier,T=e.hasWaterMask&&l(a),S=e.oceanNormalMap,w=T&&l(S),D=e.terrainProvider.ready&&e.terrainProvider.hasVertexNormals,I=n.fog.enabled&&n.fog.renderable&&!u,O=e.showGroundAtmosphere&&n.mode===te.SCENE3D,B=Zt.castShadows(e.shadows)&&!d,L=Zt.receiveShadows(e.shadows)&&!d,_=e.hueShift,E=e.saturationShift,v=e.brightnessShift,P=!(M.equalsEpsilon(_,0,M.EPSILON7)&&M.equalsEpsilon(E,0,M.EPSILON7)&&M.equalsEpsilon(v,0,M.EPSILON7)),R=!1;if(O){let nt=h.magnitude(n.camera.positionWC),Mt=e.nightFadeOutDistance;R=nt>Mt}T&&--s,w&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,s-=f.numberOfTextureUniforms;let F=i.renderedMesh,U=F.center,k=F.encoding,H=i.tileBoundingRegion,V=n.terrainExaggeration,q=n.terrainExaggerationRelativeHeight,j=V!==1,X=k.hasGeodeticSurfaceNormals,G=xdt,$=0,J=0,ce=0,de=0,ie=!1;if(n.mode!==te.SCENE3D){let nt=n.mapProjection,Mt=nt.project(he.southwest(t.rectangle),bdt),ri=nt.project(he.northeast(t.rectangle),Edt);if(G.x=Mt.x,G.y=Mt.y,G.z=ri.x,G.w=ri.y,n.mode!==te.MORPHING&&(U=Tdt,U.x=0,U.y=(G.z+G.x)*.5,U.z=(G.w+G.y)*.5,G.x-=U.y,G.y-=U.z,G.z-=U.y,G.w-=U.z),n.mode===te.SCENE2D&&k.quantization===Vs.BITS12){let we=1/(Math.pow(2,12)-1)*.5,_t=(G.z-G.x)*we,Yt=(G.w-G.y)*we;G.x-=_t,G.y-=Yt,G.z+=_t,G.w+=Yt}nt instanceof ji&&($=t.rectangle.south,J=t.rectangle.north,ce=ji.geodeticLatitudeToMercatorAngle($),de=1/(ji.geodeticLatitudeToMercatorAngle(J)-ce),ie=!0)}let ae=Mdt;ae.frameState=n,ae.surfaceTile=i,ae.showReflectiveOcean=T,ae.showOceanWaves=w,ae.enableLighting=e.enableLighting,ae.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,ae.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,ae.showGroundAtmosphere=O,ae.atmosphereLightIntensity=e.atmosphereLightIntensity,ae.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,ae.atmosphereMieCoefficient=e.atmosphereMieCoefficient,ae.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,ae.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,ae.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,ae.perFragmentGroundAtmosphere=R,ae.hasVertexNormals=D,ae.useWebMercatorProjection=ie,ae.clippedByBoundaries=i.clippedByBoundaries,ae.hasGeodeticSurfaceNormals=X,ae.hasExaggeration=j;let _e=i.imagery,be=0,Te=_e.length,Oe=e.showSkirts&&!u&&!d,Be=e.backFaceCulling&&!u&&!d,tt=Be?e._renderState:e._disableCullingRenderState,lt=Be?e._blendRenderState:e._disableCullingBlendRenderState,Pt=tt,ht=e._firstPassInitialColor,wn=n.context;if(l(e._debug.boundingSphereTile)||BU(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let nt=e._drawCommands.length;for(let Mt=0;Mt<nt;++Mt)e._uniformMaps[Mt]=_0e(n,e)}do{let nt=0,Mt,ri;if(e._drawCommands.length<=e._usedDrawCommands?(Mt=new Ze,Mt.owner=t,Mt.cull=!1,Mt.boundingVolume=new re,Mt.orientedBoundingBox=void 0,ri=_0e(n,e),e._drawCommands.push(Mt),e._uniformMaps.push(ri)):(Mt=e._drawCommands[e._usedDrawCommands],ri=e._uniformMaps[e._usedDrawCommands]),Mt.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let Ls=H.boundingVolume,ca=H.boundingSphere;l(Ls)?C0e(Ls,z.RED).update(n):l(ca)&&A0e(ca,z.RED).update(n)}let we=ri.properties;se.clone(ht,we.initialColor),we.oceanNormalMap=S,we.lightingFadeDistance.x=e.lightingFadeOutDistance,we.lightingFadeDistance.y=e.lightingFadeInDistance,we.nightFadeDistance.x=e.nightFadeOutDistance,we.nightFadeDistance.y=e.nightFadeInDistance,we.atmosphereLightIntensity=e.atmosphereLightIntensity,we.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,we.atmosphereMieCoefficient=e.atmosphereMieCoefficient,we.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,we.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,we.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,we.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let _t=u?g:p,Yt=u?p:g;l(_t)&&(se.fromElements(_t.near,_t.nearValue,_t.far,_t.farValue,we.frontFaceAlphaByDistance),se.fromElements(Yt.near,Yt.nearValue,Yt.far,Yt.farValue,we.backFaceAlphaByDistance)),se.fromElements(C.near,C.nearValue,C.far,C.farValue,we.undergroundColorAlphaByDistance),z.clone(x,we.undergroundColor),we.lambertDiffuseMultiplier=b;let Gi=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;Gi&&z.clone(e.fillHighlightColor,we.fillHighlightColor),we.terrainExaggerationAndRelativeHeight.x=V,we.terrainExaggerationAndRelativeHeight.y=q,we.center3D=F.center,h.clone(U,we.rtc),se.clone(G,we.tileRectangle),we.southAndNorthLatitude.x=$,we.southAndNorthLatitude.y=J,we.southMercatorYAndOneOverHeight.x=ce,we.southMercatorYAndOneOverHeight.y=de;let ti=Cdt,Br=MU(t.rectangle,e.cartographicLimitRectangle),or=Adt,Lr=MU(t.rectangle,m);h.fromElements(_,E,v,we.hsbShift);let Pi=t.rectangle,gr=1/Pi.width,Ia=1/Pi.height;ti.x=(Br.west-Pi.west)*gr,ti.y=(Br.south-Pi.south)*Ia,ti.z=(Br.east-Pi.west)*gr,ti.w=(Br.north-Pi.south)*Ia,se.clone(ti,we.localizedCartographicLimitRectangle),or.x=(Lr.west-Pi.west)*gr,or.y=(Lr.south-Pi.south)*Ia,or.z=(Lr.east-Pi.west)*gr,or.w=(Lr.north-Pi.south)*Ia,se.clone(or,we.localizedTranslucencyRectangle);let He=I&&M.fog(t._distance,n.fog.density)>M.EPSILON3;P=P&&(He||O);let We=!1,Ue=!1,Je=!1,gt=!1,cn=!1,Rn=!1,$i=!1,Nr=!1,zo=!1,$n=!1,Ho=!1,Go=!1;for(;nt<s&&be<Te;){let Ls=_e[be],ca=Ls.readyImagery;if(++be,!l(ca)||ca.imageryLayer.alpha===0)continue;let FC=Ls.useWebMercatorT?ca.textureWebMercator:ca.texture,vt=ca.imageryLayer;l(Ls.textureTranslationAndScale)||(Ls.textureTranslationAndScale=vt._calculateTextureTranslationAndScale(t,Ls)),we.dayTextures[nt]=FC,we.dayTextureTranslationAndScale[nt]=Ls.textureTranslationAndScale,we.dayTextureTexCoordsRectangle[nt]=Ls.textureCoordinateRectangle,we.dayTextureUseWebMercatorT[nt]=Ls.useWebMercatorT,we.dayTextureAlpha[nt]=vt.alpha,Rn=Rn||we.dayTextureAlpha[nt]!==1,we.dayTextureNightAlpha[nt]=vt.nightAlpha,$i=$i||we.dayTextureNightAlpha[nt]!==1,we.dayTextureDayAlpha[nt]=vt.dayAlpha,$i=$i||we.dayTextureDayAlpha[nt]!==1,we.dayTextureBrightness[nt]=vt.brightness,We=We||we.dayTextureBrightness[nt]!==Nf.DEFAULT_BRIGHTNESS,we.dayTextureContrast[nt]=vt.contrast,Ue=Ue||we.dayTextureContrast[nt]!==Nf.DEFAULT_CONTRAST,we.dayTextureHue[nt]=vt.hue,Je=Je||we.dayTextureHue[nt]!==Nf.DEFAULT_HUE,we.dayTextureSaturation[nt]=vt.saturation,gt=gt||we.dayTextureSaturation[nt]!==Nf.DEFAULT_SATURATION,we.dayTextureOneOverGamma[nt]=1/vt.gamma,cn=cn||we.dayTextureOneOverGamma[nt]!==1/Nf.DEFAULT_GAMMA,we.dayTextureSplit[nt]=vt.splitDirection,Nr=Nr||we.dayTextureSplit[nt]!==0,Ho=Ho||Boolean(vt.invertColor),we.mars3dTextureInvertColor[nt]=Boolean(vt.invertColor),Go=Go||Boolean(vt.filterColor),vt.filterColor?we.mars3dTextureFilterColor[nt]=new h(vt.filterColor.red,vt.filterColor.green,vt.filterColor.blue):we.mars3dTextureFilterColor[nt]=new h(1,1,1);let ve=we.dayTextureCutoutRectangles[nt];if(l(ve)||(ve=we.dayTextureCutoutRectangles[nt]=new se),se.clone(se.ZERO,ve),l(vt.cutoutRectangle)){let Zn=MU(Pi,vt.cutoutRectangle),go=he.simpleIntersection(Zn,Pi,y0e);zo=l(go)||zo,ve.x=(Zn.west-Pi.west)*gr,ve.y=(Zn.south-Pi.south)*Ia,ve.z=(Zn.east-Pi.west)*gr,ve.w=(Zn.north-Pi.south)*Ia}let ut=we.colorsToAlpha[nt];l(ut)||(ut=we.colorsToAlpha[nt]=new se);let sn=l(vt.colorToAlpha)&&vt.colorToAlphaThreshold>0;if($n=$n||sn,sn){let Zn=vt.colorToAlpha;ut.x=Zn.red,ut.y=Zn.green,ut.z=Zn.blue,ut.w=vt.colorToAlphaThreshold}else ut.w=-1;if(l(ca.credits)){let Zn=ca.credits;for(let go=0,io=Zn.length;go<io;++go)r.addCredit(Zn[go])}++nt}we.dayTextures.length=nt,we.waterMask=a,se.clone(c,we.waterMaskTranslationAndScale),we.minMaxHeight.x=k.minimumHeight,we.minMaxHeight.y=k.maximumHeight,N.clone(k.matrix,we.scaleAndBias);let lc=e._clippingPlanes,jr=l(lc)&&lc.enabled&&t.isClipped;jr&&(we.clippingPlanesEdgeColor=z.clone(lc.edgeColor,we.clippingPlanesEdgeColor),we.clippingPlanesEdgeWidth=lc.edgeWidth),ae.numberOfDayTextures=nt,ae.applyBrightness=We,ae.applyContrast=Ue,ae.applyHue=Je,ae.applySaturation=gt,ae.applyGamma=cn,ae.applyAlpha=Rn,ae.applyDayNightAlpha=$i,ae.applySplit=Nr,ae.enableFog=He,ae.enableClippingPlanes=jr,ae.clippingPlanes=lc,ae.hasImageryLayerCutout=zo,ae.colorCorrect=P,ae.highlightFillTile=Gi,ae.colorToAlpha=$n,ae.showUndergroundColor=A,ae.translucent=d,ae.marsOptions={invertColor:Ho,filterColor:Go,enableClip:e._marsOptions&&e._marsOptions.clip&&e._marsOptions.clip.enabled};let Fr=i.renderedMesh.indices.length;Oe||(Fr=i.renderedMesh.indexCountWithoutSkirts),Mt.shaderProgram=e._surfaceShaderSet.getShaderProgram(ae),Mt.castShadows=B,Mt.receiveShadows=L,Mt.renderState=Pt,Mt.primitiveType=Me.TRIANGLES,Mt.vertexArray=i.vertexArray||i.fill.vertexArray,Mt.count=Fr,Mt.uniformMap=ri,Mt.pass=Ce.GLOBE,e._debug.wireframe&&(Idt(wn,e,t),l(i.wireframeVertexArray)&&(Mt.vertexArray=i.wireframeVertexArray,Mt.primitiveType=Me.LINES,Mt.count=Fr*2));let Po=Mt.boundingVolume,Kc=Mt.orientedBoundingBox;n.mode!==te.SCENE3D?(re.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,H.minimumHeight,H.maximumHeight,Po),h.fromElements(Po.center.z,Po.center.x,Po.center.y,Po.center),n.mode===te.MORPHING&&(Po=re.union(H.boundingSphere,Po,Po))):(Mt.boundingVolume=re.clone(H.boundingSphere,Po),Mt.orientedBoundingBox=Ai.clone(H.boundingVolume,Kc)),Mt.dirty=!0,d&&f.updateDerivedCommands(Mt,n),g0e(Mt,n),Pt=lt,ht=Rdt}while(be<Te)}var LU=no;function T0e(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=he.clone(he.MAX_VALUE)}Object.defineProperties(T0e.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=St.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=St.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=he.clone(he.MAX_VALUE)),he.clone(e,this._rectangle)}}});var NU=T0e;function Ts(){this._layers=[],this.layerAdded=new ge,this.layerRemoved=new ge,this.layerMoved=new ge,this.layerShownOrHidden=new ge}Object.defineProperties(Ts.prototype,{length:{get:function(){return this._layers.length}}});Ts.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t)};Ts.prototype.addImageryProvider=function(e,t){let n=new Nf(e);return this.add(n,t),n};Ts.prototype.remove=function(e,t){t=y(t,!0);let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};Ts.prototype.removeAll=function(e){e=y(e,!0);let t=this._layers;for(let n=0,i=t.length;n<i;n++){let r=t[n];this.layerRemoved.raiseEvent(r,n),e&&r.destroy()}this._layers=[]};Ts.prototype.contains=function(e){return this.indexOf(e)!==-1};Ts.prototype.indexOf=function(e){return this._layers.indexOf(e)};Ts.prototype.get=function(e){return this._layers[e]};function FU(e,t){return e.indexOf(t)}function b0e(e,t,n){let i=e._layers;if(t=M.clamp(t,0,i.length-1),n=M.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e._update(),e.layerMoved.raiseEvent(r,n,t)}Ts.prototype.raise=function(e){let t=FU(this._layers,e);b0e(this,t,t+1)};Ts.prototype.lower=function(e){let t=FU(this._layers,e);b0e(this,t,t-1)};Ts.prototype.raiseToTop=function(e){let t=FU(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};Ts.prototype.lowerToBottom=function(e){let t=FU(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var Fdt=new he;function E0e(e,t,n,i){let r=e.globe._surface._tilesToRender,o;for(let a=0;!l(o)&&a<r.length;++a){let c=r[a];he.contains(c.rectangle,t)&&(o=c)}if(!l(o))return;let s=o.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],u=c.readyImagery;if(!l(u))continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!he.contains(u.rectangle,t))continue;let d=Fdt,p=1/1024;d.west=M.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.x-p),d.east=M.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.z+p),d.south=M.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.y-p),d.north=M.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.w+p),he.contains(d,t)&&i(u)}}Ts.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.globe.ellipsoid.cartesianToCartographic(n),r=[];if(E0e(t,i,!1,function(o){r.push(o.imageryLayer)}),r.length!==0)return r};Ts.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.globe.ellipsoid.cartesianToCartographic(n),r=[],o=[];if(E0e(t,i,!0,function(s){let c=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);l(c)&&(r.push(c),o.push(s.imageryLayer))}),r.length!==0)return Promise.all(r).then(function(s){let a=[];for(let c=0;c<s.length;++c){let u=s[c],f=o[c];if(l(u)&&u.length>0)for(let d=0;d<u.length;++d){let p=u[d];p.imageryLayer=f,l(p.position)||(p.position=i),a.push(p)}}return a})};Ts.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Ts.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Ts.prototype.isDestroyed=function(){return!1};Ts.prototype.destroy=function(){return this.removeAll(!0),ue(this)};Ts.prototype._update=function(){let e=!0,t=this._layers,n,i,r,o;for(r=0,o=t.length;r<o;++r)i=t[r],i._layerIndex=r,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(r=0,o=n.length;r<o;++r)i=n[r],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var VU=Ts;function S0e(e){this._ellipsoid=new g_(e.ellipsoid,h.ZERO)}Object.defineProperties(S0e.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var kU=S0e;function Gc(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=Kn.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=oa.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}Gc.createLevelZeroTiles=function(e){let t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n),r=0;for(let o=0;o<n;++o)for(let s=0;s<t;++s)i[r++]=new Gc({tilingScheme:e,x:s,y:o,level:0});return i};Gc.prototype._updateCustomData=function(e,t,n){let i=this.customData,r,o,s;if(l(t)&&l(n)){for(i=i.filter(function(a){return n.indexOf(a)===-1}),this._customData=i,s=this._rectangle,r=0;r<t.length;++r)o=t[r],he.contains(s,o.positionCartographic)&&i.push(o);this._frameUpdated=e}else{let a=this._parent;if(l(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let c=a.customData;for(r=0;r<c.length;++r)o=c[r],he.contains(s,o.positionCartographic)&&i.push(o);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(Gc.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return l(this._southwestChild)||(this._southwestChild=new Gc({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return l(this._southeastChild)||(this._southeastChild=new Gc({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return l(this._northwestChild)||(this._northwestChild=new Gc({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return l(this._northeastChild)||(this._northeastChild=new Gc({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<oa.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});Gc.prototype.findLevelZeroTile=function(e,t,n){let i=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=i:t>=i&&(t-=i),!(n<0||n>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(r){return r.x===t&&r.y===n})[0]};Gc.prototype.findTileToWest=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;let n=t.findTileToWest(e);if(n!==void 0)return t.southwestChild===this?n.southeastChild:n.northeastChild};Gc.prototype.findTileToEast=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;let n=t.findTileToEast(e);if(n!==void 0)return t.southeastChild===this?n.southwestChild:n.northwestChild};Gc.prototype.findTileToSouth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;let n=t.findTileToSouth(e);if(n!==void 0)return t.southwestChild===this?n.northwestChild:n.northeastChild};Gc.prototype.findTileToNorth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;let n=t.findTileToNorth(e);if(n!==void 0)return t.northwestChild===this?n.southwestChild:n.southeastChild};Gc.prototype.freeResources=function(){this.state=oa.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),UU(this._southwestChild),this._southwestChild=void 0,UU(this._southeastChild),this._southeastChild=void 0,UU(this._northwestChild),this._northwestChild=void 0,UU(this._northeastChild),this._northeastChild=void 0};function UU(e){l(e)&&e.freeResources()}var zU=Gc;function HU(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}HU.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};HU.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),w0e(this,t)),t=i}};function w0e(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}HU.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&w0e(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var GU=HU;function Ff(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new GU,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=y(e.maximumScreenSpaceError,2),this.tileCacheSize=y(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new kU({ellipsoid:n}),this._tileLoadProgressEvent=new ge,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(Ff.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});Ff.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function Vdt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,D0e(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let o=n[i].customData,s=o.length;for(let a=0;a<s;++a){let c=o[a];c.level=0,e._addHeightCallbacks.push(c)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}Ff.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==oa.START&&e(t),t=t.replacementNext};Ff.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};Ff.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let r=n._addHeightCallbacks,o=r.length;for(let s=0;s<o;++s)if(r[s]===i){r.splice(s,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};Ff.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function D0e(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}Ff.prototype.beginFrame=function(e){!e.passes.render||(this._tilesInvalidated&&(Vdt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),D0e(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};Ff.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),Hdt(this,e),Jdt(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function kdt(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;(n!==e._lastTileLoadQueueLength||e._tilesInvalidated)&&(t.afterRender.push(ge.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n)),e._lastTileLoadQueueLength=n);let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(r,o){return Math.max(r,o.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}Ff.prototype.endFrame=function(e){!e.passes.render||e.mode===te.MORPHING||(Xdt(this,e),Zdt(this,e),kdt(this,e))};Ff.prototype.isDestroyed=function(){return!1};Ff.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var E1,v0e=new me;function Udt(e,t){let n=he.center(e.rectangle,v0e),i=n.longitude-E1.longitude,r=n.latitude-E1.latitude;n=he.center(t.rectangle,v0e);let o=n.longitude-E1.longitude,s=n.latitude-E1.latitude;return i*i+r*r-(o*o+s*s)}var zdt=new h,b1=[];function Hdt(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let r,o=e._tileProvider;if(!l(e._levelZeroTiles))if(o.ready){let x=o.tilingScheme;e._levelZeroTiles=zU.createLevelZeroTiles(x);let C=e._levelZeroTiles.length;if(b1.length<C)for(b1=new Array(C),r=0;r<C;++r)b1[r]===void 0&&(b1[r]=new S1)}else return;e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,c=a.length>1?e._occluders:void 0;E1=t.camera.positionCartographic,a.sort(Udt);let u=e._addHeightCallbacks,f=e._removeHeightCallbacks,d=t.frameNumber,p;if(u.length>0||f.length>0){for(r=0,p=a.length;r<p;++r)s=a[r],s._updateCustomData(d,u,f);u.length=0,f.length=0}let g=t.camera;e._cameraPositionCartographic=g.positionCartographic;let m=N.getTranslation(g.transform,zdt);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(m,e._cameraReferenceFrameOriginCartographic),r=0,p=a.length;r<p;++r)s=a[r],e._tileReplacementQueue.markTileRendered(s),s.renderable?wa(e,s,o,t,c,!1,b1[r]):(o_(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=d}function o_(e,t,n,i){!n.needsLoading||(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function S1(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function P0e(){this.southwest=new S1,this.southeast=new S1,this.northwest=new S1,this.northeast=new S1}P0e.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,r=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&r.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||r.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+r.notYetRenderableCount};var oY=new Array(31);for(let e=0;e<oY.length;++e)oY[e]=new P0e;function Gdt(e,t,n,i,r){let o=e._debug;++o.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n._updateCustomData(t.frameNumber),n.level>o.maxDepthVisited&&(o.maxDepthVisited=n.level);let s=qdt(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,d=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===d?n._lastSelectionResult:Kn.NONE,g=e.tileProvider;if(s||i){let m=Kn.originalResult(p)===Kn.RENDERED,x=Kn.originalResult(p)===Kn.CULLED||p===Kn.NONE,C=n.state===oa.DONE,A=m||x||C;if(A||l(g.canRenderWithoutLosingDetail)&&(A=g.canRenderWithoutLosingDetail(n)),A){s&&o_(e,e._tileLoadQueueMedium,n,t),WU(e,n),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===Kn.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Kn.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&o_(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){WU(e,n),o_(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===Kn.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Kn.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Kn.REFINED;let x=e._tilesToRender.length,C=e._tileLoadQueueLow.length,A=e._tileLoadQueueMedium.length,b=e._tileLoadQueueHigh.length,T=e._tileToUpdateHeights.length;if(Wdt(e,a,c,u,f,t,i,r),x!==e._tilesToRender.length){let S=r.allAreRenderable,w=r.anyWereRenderedLastFrame,D=r.notYetRenderableCount,I=!1;if(!S&&!w){let O=e._tilesToRender;for(let L=x;L<O.length;++L){let _=O[L];for(;_!==void 0&&_._lastSelectionResult!==Kn.KICKED&&_!==n;)_._lastSelectionResult=Kn.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=x,e._tileToUpdateHeights.length=T,WU(e,n),n._lastSelectionResult=Kn.RENDERED;let B=p===Kn.RENDERED;!B&&D>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=C,e._tileLoadQueueMedium.length=A,e._tileLoadQueueHigh.length=b,o_(e,e._tileLoadQueueMedium,n,t),r.notYetRenderableCount=n.renderable?0:1,I=!0),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=B,B||e._tileToUpdateHeights.push(n),++o.tilesWaitingForChildren}e.preloadAncestors&&!I&&o_(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Kn.RENDERED,WU(e,n),o_(e,e._tileLoadQueueHigh,n,t),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===Kn.RENDERED,r.notYetRenderableCount=n.renderable?0:1}function Wdt(e,t,n,i,r,o,s,a){let c=o.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=oY[t.level],p=d.southwest,g=d.southeast,m=d.northwest,x=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(wa(e,t,u,o,f,s,p),wa(e,n,u,o,f,s,g),wa(e,i,u,o,f,s,m),wa(e,r,u,o,f,s,x)):(wa(e,i,u,o,f,s,m),wa(e,t,u,o,f,s,p),wa(e,r,u,o,f,s,x),wa(e,n,u,o,f,s,g)):c.latitude<t.rectangle.north?(wa(e,n,u,o,f,s,g),wa(e,t,u,o,f,s,p),wa(e,r,u,o,f,s,x),wa(e,i,u,o,f,s,m)):(wa(e,r,u,o,f,s,x),wa(e,i,u,o,f,s,m),wa(e,n,u,o,f,s,g),wa(e,t,u,o,f,s,p)),d.combine(a)}function jdt(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&he.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&he.contains(n,e._cameraReferenceFrameOriginCartographic)}function wa(e,t,n,i,r,o,s){if(n.computeTileVisibility(t,i,r)!==xo.NONE)return Gdt(e,i,t,o,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,jdt(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&o_(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:Kn.NONE;c!==Kn.CULLED_BUT_NEEDED&&c!==Kn.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=Kn.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(o_(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=Kn.CULLED):t._lastSelectionResult=Kn.CULLED;t._lastSelectionResultFrame=i.frameNumber}function qdt(e,t,n){if(t.mode===te.SCENE2D||t.camera.frustum instanceof en||t.camera.frustum instanceof Xo)return Ydt(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),r=n._distance,o=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*o/(r*s);return t.fog.enabled&&(a-=M.fog(r,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function Ydt(e,t,n){let r=t.camera.frustum;l(r._offCenterFrustum)&&(r=r._offCenterFrustum);let o=t.context,s=o.drawingBufferWidth,a=o.drawingBufferHeight,c=e._tileProvider.getLevelMaximumGeometricError(n.level),u=Math.max(r.top-r.bottom,r.right-r.left)/Math.max(s,a),f=c/u;return t.fog.enabled&&t.mode!==te.SCENE2D&&(f-=M.fog(n._distance,t.fog.density)*t.fog.sse),f/=t.pixelRatio,f}function WU(e,t){e._tilesToRender.push(t)}function Xdt(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,r=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&r.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let o=Bi()+e._loadQueueTimeSlice,s=e._tileProvider,a=iY(e,t,s,o,n,!1);a=iY(e,t,s,o,i,a),iY(e,t,s,o,r,a)}function Kdt(e,t){return e._loadPriority-t._loadPriority}function iY(e,t,n,i,r,o){n.computeTileLoadPriority!==void 0&&r.sort(Kdt);for(let s=0,a=r.length;s<a&&(Bi()<i||!o);++s){let c=r[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),o=!0}return o}var BE=new En,rY=new me,U0=new h,$dt=[];function Zdt(e,t){if(!e.tileProvider.ready)return;let n=$dt;n.length=0;let i=e._tileToUpdateHeights,r=Bi(),o=e._updateHeightsTimeSlice,s=r+o,a=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let d=i[0];if(!l(d.data)||!l(d.data.mesh)){let x=d._lastSelectionResultFrame===e._lastSelectionFrameNumber?d._lastSelectionResult:Kn.NONE;(x===Kn.RENDERED||x===Kn.CULLED_BUT_NEEDED)&&n.push(d),i.shift(),e._lastTileIndex=0;continue}let p=d.customData,g=p.length,m=!1;for(f=e._lastTileIndex;f<g;++f){let x=p[f],C=d.data.terrainData,A=l(C)&&C.wasCreatedByUpsampling();if(d.level>x.level&&!A){if(l(x.positionOnEllipsoidSurface)||(x.positionOnEllipsoidSurface=h.fromRadians(x.positionCartographic.longitude,x.positionCartographic.latitude,0,u)),a===te.SCENE3D){let T=u.geodeticSurfaceNormal(x.positionOnEllipsoidSurface,BE.direction),S=u.getSurfaceNormalIntersectionWithZAxis(x.positionOnEllipsoidSurface,11500,BE.origin);if(!l(S)){let w=0;l(d.data.tileBoundingRegion)&&(w=d.data.tileBoundingRegion.minimumHeight);let D=Math.min(w,-11500),I=h.multiplyByScalar(T,Math.abs(D)+1,U0);h.subtract(x.positionOnEllipsoidSurface,I,BE.origin)}}else me.clone(x.positionCartographic,rY),rY.height=-11500,c.project(rY,U0),h.fromElements(U0.z,U0.x,U0.y,U0),h.clone(U0,BE.origin),h.clone(h.UNIT_X,BE.direction);let b=d.data.pick(BE,a,c,!1,U0);l(b)&&(l(x.callback)&&x.callback(b),x.level=d.level)}if(Bi()>=s){m=!0;break}}if(m){e._lastTileIndex=f;break}else e._lastTileIndex=0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function Jdt(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let r=0,o=i.length;r<o;++r){let s=i[r];n.showTileThisFrame(s,t)}}var jU=Ff;function eh(e){e=y(e,oe.WGS84);let t=new H_({ellipsoid:e}),n=new VU;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new AU,this._material=void 0,this._surface=new jU({tileProvider:new LU({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new ge,this._undergroundColor=z.clone(z.BLACK),this._undergroundColorAlphaByDistance=new St(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new NU,aY(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new De({url:Qt("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!0,this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=1e7,this.lightingFadeInDistance=2e7,this.nightFadeOutDistance=1e7,this.nightFadeInDistance=5e7,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=Zt.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.terrainExaggeration=1,this.terrainExaggerationRelativeHeight=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0}Object.defineProperties(eh.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface.tileProvider.ready&&this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=he.clone(he.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),l(this._material)&&aY(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,aY(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=z.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=St.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function aY(e){let t=[],n=l(e._material)&&(e._material.shaderSource.match(/slope/)||e._material.shaderSource.match("normalEC")),i=[k0,y1];l(e._material)&&(!n||e._terrainProvider.requestVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(xU),e._surfaceShaderSet.baseVertexShaderSource=new Fe({sources:[k0,y1,CU],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Fe({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function Qdt(e){return function(t,n){let i=re.distanceSquaredTo(t.pickBoundingSphere,e),r=re.distanceSquaredTo(n.pickBoundingSphere,e);return i-r}}var eht=[],tht={start:0,stop:0};eh.prototype.pickWorldCoordinates=function(e,t,n,i){n=y(n,!0);let r=t.mode,o=t.mapProjection,s=eht;s.length=0;let a=this._surface._tilesToRender,c=a.length,u,f;for(f=0;f<c;++f){u=a[f];let p=u.data;if(!l(p))continue;let g=p.pickBoundingSphere;if(r!==te.SCENE3D)p.pickBoundingSphere=g=re.fromRectangleWithHeights2D(u.rectangle,o,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,g),h.fromElements(g.center.z,g.center.x,g.center.y,g.center);else if(l(p.renderedMesh))re.clone(p.tileBoundingRegion.boundingSphere,g);else continue;let m=er.raySphere(e,g,tht);l(m)&&s.push(p)}s.sort(Qdt(e.origin));let d;for(c=s.length,f=0;f<c&&(d=s[f].pick(e,t.mode,t.mapProjection,n,i),!l(d));++f);return d};var nht=new me;eh.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==te.SCENE3D){n=h.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,nht);n=t.globe.ellipsoid.cartographicToCartesian(i,n)}return n};var iht=new h,I0e=new h,rht=new me,oht=new En;function sY(e,t){return l(e)&&he.contains(e.rectangle,t)?e:void 0}eh.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,r=t.length;for(i=0;i<r&&(n=t[i],!he.contains(n.rectangle,e));++i);if(i>=r)return;let o=n;for(;l(n);)n=sY(n._southwestChild,e)||sY(n._southeastChild,e)||sY(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(o=n);if(n=o,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=h.fromRadians(e.longitude,e.latitude,0,a,iht),u=oht,f=a.geodeticSurfaceNormal(c,u.direction),d=a.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(d)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let m=Math.min(y(g,0),-11500),x=h.multiplyByScalar(f,Math.abs(m)+1,I0e);h.subtract(c,x,u.origin)}let p=n.data.pick(u,void 0,s,!1,I0e);if(!!l(p))return a.cartesianToCartographic(p,rht).height};eh.prototype.update=function(e){!this.show||e.passes.render&&this._surface.update(e)};eh.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,r=this.showWaterEffect&&i.ready&&i.hasWaterMask;if(r&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let u=this;a.fetchImage().then(function(f){c===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new wt({context:e.context,source:f}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let o=e.passes,s=e.mode;o.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===te.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=r,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};eh.prototype.render=function(e){!this.show||(l(this._material)&&this._material.update(e.context),this._surface.render(e))};eh.prototype.endFrame=function(e){!this.show||e.passes.render&&this._surface.endFrame(e)};eh.prototype.isDestroyed=function(){return!1};eh.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),ue(this)};var qU=eh;var vu=`uniform sampler2D colorTexture;
- varying vec2 v_textureCoordinates;
- void main()
- {
- gl_FragColor = texture2D(colorTexture, v_textureCoordinates);
- }
- `;var fC=`uniform highp sampler2D u_depthTexture;
- varying vec2 v_textureCoordinates;
- void main()
- {
- gl_FragColor = czm_packDepth(texture2D(u_depthTexture, v_textureCoordinates).r);
- }
- `;function Em(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new pi,this._tempCopyDepthFramebuffer=new pi,this._updateDepthFramebuffer=new pi({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new je,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(Em.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}}});function sht(e){e._pickColorFramebuffer.destroy(),e._outputFramebuffer.destroy(),e._copyDepthFramebuffer.destroy(),e._tempCopyDepthFramebuffer.destroy(),e._updateDepthFramebuffer.destroy()}function O0e(e,t,n,i,r){e._viewport.width=n,e._viewport.height=i;let o=!je.equals(e._viewport,r.viewport),s=o!==e._useScissorTest;e._useScissorTest=o,je.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=je.clone(r.viewport,e._scissorRectangle),s=!0),(!l(e._rs)||!je.equals(e._viewport,e._rs.viewport)||s)&&(e._rs=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:hn.ALPHA_BLEND}),e._rsUpdate=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:yi.EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:yi.NEVER,reference:tn.CESIUM_3D_TILE_MASK,mask:tn.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(fC,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(vu,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(fC,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(vu,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new li({color:new z(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}Em.prototype.update=function(e,t,n,i,r,o){let s=n.width,a=n.height,c=r?e.halfFloatingPointTexture?qe.HALF_FLOAT:qe.FLOAT:qe.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),O0e(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._useHdr=r,this._clearGlobeDepth=o};Em.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};Em.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};Em.prototype.executeUpdateDepth=function(e,t,n,i){let r=l(i)?i:t.framebuffer.depthStencilTexture;if(n||r!==this.colorFramebufferManager.getDepthStencilTexture()){if(l(this._updateDepthCommand)){if(!l(this._updateDepthFramebuffer.framebuffer)||this._updateDepthFramebuffer.getDepthStencilTexture()!==r||this._updateDepthFramebuffer.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let o=this._copyDepthFramebuffer.getColorTexture().width,s=this._copyDepthFramebuffer.getColorTexture().height;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,o,s);let a=this._copyDepthFramebuffer.getColorTexture();this._updateDepthFramebuffer.setColorTexture(a,0),this._updateDepthFramebuffer.setDepthStencilTexture(r),this._updateDepthFramebuffer.update(e,o,s),O0e(this,e,o,s,t)}this._tempCopyDepthTexture=r,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)}return}l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t)};Em.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};Em.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(z.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};Em.prototype.isDestroyed=function(){return!1};Em.prototype.destroy=function(){return sht(this),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),ue(this)};var YU=Em;function dC(){this._framebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new pi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new je,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(dC.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function aht(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function cht(e,t,n,i,r){let o=r?t.halfFloatingPointTexture?qe.HALF_FLOAT:qe.FLOAT:qe.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,o),e._packedDepthFramebuffer.update(t,n,i)}function lht(e,t,n,i,r){e._viewport.width=n,e._viewport.height=i;let o=!je.equals(e._viewport,r.viewport),s=o!==e._useScissorTest;e._useScissorTest=o,je.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=je.clone(r.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!je.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(fC,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new li({color:new z(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}dC.prototype.updateAndClear=function(e,t,n,i){let r=t.width,o=t.height;cht(this,n,r,o,e),lht(this,n,r,o,i),this._useHdr=e};dC.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};dC.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};dC.prototype.isDestroyed=function(){return!1};dC.prototype.destroy=function(){return aht(this),ue(this)};var XU=dC;var sa={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},hC=sa.DERIVED_COMMANDS_MAXIMUM_LENGTH,z0e=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function mC(){this._frontFaceAlphaByDistance=new St(0,1,0,1),this._backFaceAlphaByDistance=new St(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=he.clone(he.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(hC),this._derivedBlendCommandTypes=new Array(hC),this._derivedPickCommandTypes=new Array(hC),this._derivedCommandTypesToUpdate=new Array(hC),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(mC.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});mC.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=R0e(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=R0e(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=M0e(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=M0e(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=hht(this,e,t),this._sunVisibleThroughGlobe=uht(this,e),this._environmentVisible=fht(this,e),this._useDepthPlane=dht(this,e),this._numberOfTextureUniforms=mht(this),this._rectangle=he.clone(t.translucency.rectangle,this._rectangle),pht(this,e)};function R0e(e,t,n,i){return e?l(n)?(St.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function M0e(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function uht(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function fht(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function dht(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function hht(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==te.SCENE2D&&t.context.depthTexture}function mht(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function pht(e,t){e._derivedCommandsLength=cY(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=cY(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=cY(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let r=0;for(n=0;n<hC;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[r++]=n);e._derivedCommandsToUpdateLength=r;let o=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=o,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=Iht())}function cY(e,t,n,i,r){let o=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return o;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?sa.PICK_FRONT_FACE:u?sa.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:sa.TRANSLUCENT_FRONT_FACE,d=i?sa.PICK_BACK_FACE:u?sa.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:sa.TRANSLUCENT_BACK_FACE;return t.mode===te.SCENE2D?(r[o++]=sa.DEPTH_ONLY_FRONT_FACE,r[o++]=f,o):(a?(n||(r[o++]=sa.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(r[o++]=f,r[o++]=d):(r[o++]=d,r[o++]=f)):c?(n||(r[o++]=sa.DEPTH_ONLY_BACK_FACE),r[o++]=sa.OPAQUE_FRONT_FACE,r[o++]=d):(n||(r[o++]=sa.DEPTH_ONLY_FRONT_FACE),r[o++]=sa.OPAQUE_BACK_FACE,r[o++]=f),o)}function Vf(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function B0e(e,t){return e.indexOf(t)>-1}function _ht(e,t){Vf(e.defines,"TRANSLUCENT"),Vf(t.defines,"TRANSLUCENT")}function ght(e,t){Vf(e.defines,"GROUND_ATMOSPHERE"),Vf(t.defines,"GROUND_ATMOSPHERE"),Vf(e.defines,"FOG"),Vf(t.defines,"FOG"),Vf(e.defines,"TRANSLUCENT"),Vf(t.defines,"TRANSLUCENT")}function lY(e,t){if(B0e(t.defines,"TILE_LIMIT_RECTANGLE")||B0e(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main()
- {
- gl_FragColor = vec4(1.0);
- }
- `;t.sources=[n]}function uY(e,t){let n=t.sources,i=n.length;for(let o=0;o<i;++o)n[o]=Fe.replaceMain(n[o],"czm_globe_translucency_main");let r=`
- uniform sampler2D u_classificationTexture;
- void main()
- {
- vec2 st = gl_FragCoord.xy / czm_viewport.zw;
- #ifdef MANUAL_DEPTH_TEST
- float logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, st));
- if (logDepthOrDepth != 0.0)
- {
- vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
- float depthEC = eyeCoordinate.z / eyeCoordinate.w;
- if (v_positionEC.z < depthEC)
- {
- discard;
- }
- }
- #endif
- czm_globe_translucency_main();
- vec4 classificationColor = texture2D(u_classificationTexture, st);
- if (classificationColor.a > 0.0)
- {
- // Reverse premultiplication process to get the correct composited result of the classification primitives
- classificationColor.rgb /= classificationColor.a;
- }
- gl_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + gl_FragColor * (1.0 - classificationColor.a);
- }
- `;n.push(r)}function H0e(e,t){uY(e,t),Vf(e.defines,"GROUND_ATMOSPHERE"),Vf(t.defines,"GROUND_ATMOSPHERE"),Vf(e.defines,"FOG"),Vf(t.defines,"FOG")}function yht(e,t){uY(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function xht(e,t){H0e(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function L0e(e,t){let n=`uniform sampler2D u_classificationTexture;
- void main()
- {
- vec2 st = gl_FragCoord.xy / czm_viewport.zw;
- vec4 pickColor = texture2D(u_classificationTexture, st);
- if (pickColor == vec4(0.0))
- {
- discard;
- }
- gl_FragColor = pickColor;
- }
- `;t.sources=[n]}function Cht(e,t,n,i,r,o){if(!l(r))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,o);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],r(c,u),s=e.shaderCache.createDerivedShaderProgram(t,o,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:a})}return s}function Aht(e){e.cull.face=Yi.BACK,e.cull.enabled=!0}function Tht(e){e.cull.face=Yi.FRONT,e.cull.enabled=!0}function bht(e){e.cull.face=Yi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Eht(e){e.cull.face=Yi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Sht(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function N0e(e){e.cull.face=Yi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=hn.ALPHA_BLEND}function F0e(e){e.cull.face=Yi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=hn.ALPHA_BLEND}function wht(e){e.cull.face=Yi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function vht(e){e.cull.face=Yi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function Dht(e,t,n,i,r){if(!l(i))return e;if(!n&&l(t))return t;let o=r[e.id];if(!l(o)){let s=Ve.getState(e);i(s),o=Ve.fromCache(s),r[e.id]=o}return o}function LE(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function Pht(e,t,n,i,r){return l(r)?!i&&l(n)?n:rt(t,r(e),!1):t}function th(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function Iht(){return[new th({pass:Ce.GLOBE,pickOnly:!1,getShaderProgramFunction:_ht,getRenderStateFunction:Aht,getUniformMapFunction:void 0}),new th({pass:Ce.GLOBE,pickOnly:!1,getShaderProgramFunction:ght,getRenderStateFunction:Tht,getUniformMapFunction:void 0}),new th({pass:Ce.GLOBE,pickOnly:!1,getShaderProgramFunction:lY,getRenderStateFunction:bht,getUniformMapFunction:void 0}),new th({pass:Ce.GLOBE,pickOnly:!1,getShaderProgramFunction:lY,getRenderStateFunction:Eht,getUniformMapFunction:void 0}),new th({pass:Ce.GLOBE,pickOnly:!1,getShaderProgramFunction:lY,getRenderStateFunction:Sht,getUniformMapFunction:void 0}),new th({pass:Ce.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:uY,getRenderStateFunction:N0e,getUniformMapFunction:LE}),new th({pass:Ce.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:H0e,getRenderStateFunction:F0e,getUniformMapFunction:LE}),new th({pass:Ce.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:yht,getRenderStateFunction:N0e,getUniformMapFunction:LE}),new th({pass:Ce.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:xht,getRenderStateFunction:F0e,getUniformMapFunction:LE}),new th({pass:Ce.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:L0e,getRenderStateFunction:wht,getUniformMapFunction:LE}),new th({pass:Ce.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:L0e,getRenderStateFunction:vht,getUniformMapFunction:LE})]}var V0e=new Array(hC),k0e=new Array(hC);mC.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let r=0;r<i;++r)k0e[r]=this._derivedCommandPacks[n[r]],V0e[r]=z0e[n[r]];Oht(this,e,i,n,V0e,k0e,t)}};function Oht(e,t,n,i,r,o,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let u=s.frameNumber,f=y(a.uniformMapDirtyFrame,0),d=y(a.shaderProgramDirtyFrame,0),p=y(a.renderStateDirtyFrame,0),g=a.uniformMap!==t.uniformMap,m=a.shaderProgramId!==t.shaderProgram.id,x=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=u),m&&(a.shaderProgramDirtyFrame=u),x&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let C=0;C<n;++C){let A=o[C],b=i[C],T=r[C],S=a[T],w,D,I;l(S)?(w=S.uniformMap,D=S.shaderProgram,I=S.renderState):(w=void 0,D=void 0,I=void 0),S=Ze.shallowClone(t,S),a[T]=S;let O=y(S.derivedCommands.uniformMapDirtyFrame,0),B=y(S.derivedCommands.shaderProgramDirtyFrame,0),L=y(S.derivedCommands.renderStateDirtyFrame,0),_=g||O<f,E=m||B<d,v=x||L<p;_&&(S.derivedCommands.uniformMapDirtyFrame=u),E&&(S.derivedCommands.shaderProgramDirtyFrame=u),v&&(S.derivedCommands.renderStateDirtyFrame=u),S.derivedCommands.type=b,S.pass=A.pass,S.pickOnly=A.pickOnly,S.uniformMap=Pht(e,t.uniformMap,w,_,A.getUniformMapFunction),S.shaderProgram=Cht(s.context,t.shaderProgram,D,E,A.getShaderProgramFunction,T),S.renderState=Dht(t.renderState,I,v,A.getRenderStateFunction,A.renderStateCache)}}}mC.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick;if(i&&t)return;let r=this._derivedCommandTypes,o=this._derivedCommandsLength;if(i?(r=this._derivedPickCommandTypes,o=this._derivedPickCommandsLength):t&&(r=this._derivedBlendCommandTypes,o=this._derivedBlendCommandsLength),o===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<o;++a){let c=z0e[r[a]];n.commandList.push(s[c])}};function G0e(e,t,n,i,r,o,s){for(let a=0;a<t;++a){let c=e[a],u=c.derivedCommands.type;(!l(s)||s.indexOf(u)>-1)&&n(c,i,r,o)}}function U0e(e,t,n,i,r,o){for(let s=0;s<t;++s)n(e[s],i,r,o)}var Rht=[sa.OPAQUE_FRONT_FACE,sa.OPAQUE_BACK_FACE],Mht=[sa.DEPTH_ONLY_FRONT_FACE,sa.DEPTH_ONLY_BACK_FACE,sa.DEPTH_ONLY_FRONT_AND_BACK_FACE];mC.prototype.executeGlobeCommands=function(e,t,n,i,r){let o=i.context,s=e.commands[Ce.GLOBE],a=e.indices[Ce.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(o,r),G0e(s,a,t,i,o,r,Rht))};mC.prototype.executeGlobeClassificationCommands=function(e,t,n,i,r){let o=i.context,s=e.commands[Ce.GLOBE],a=e.indices[Ce.GLOBE],c=e.commands[Ce.TERRAIN_CLASSIFICATION],u=e.indices[Ce.TERRAIN_CLASSIFICATION];if(a===0||u===0)return;let f=this._frontFaceTranslucent,d=this._backFaceTranslucent;if((!f||!d)&&U0e(c,u,t,i,o,r),!f&&!d)return;this._globeTranslucencyFramebuffer=n;let p=o.uniformState.globeDepthTexture,g=r.framebuffer;if(r.framebuffer=n.classificationFramebuffer,G0e(s,a,t,i,o,r,Mht),o.depthTexture){let m=n.packDepth(o,r);o.uniformState.globeDepthTexture=m}U0e(c,u,t,i,o,r),o.uniformState.globeDepthTexture=p,r.framebuffer=g};var KU=mC;function fY(){this._image=new Image}fY.prototype.isReady=function(){return!0};fY.prototype.shouldDiscardImage=function(e){return e===this._image};function w1(e){e=y(e,y.EMPTY_OBJECT),this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0;let t;if(l(e.metadata))t=e.metadata;else{let o=De.createIfNeeded(e.url);t=new Mh(o)}this._metadata=t,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new Qi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new he(-M.PI,-M.PI,M.PI,M.PI),ellipsoid:e.ellipsoid});let n=e.credit;typeof n=="string"&&(n=new Gt(n)),this._credit=n,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new fY),this._errorEvent=new ge,this._ready=!1;let i=this,r;this._readyPromise=t.readyPromise.then(function(o){if(!t.imageryPresent){let s=new fe(`The server ${t.url} doesn't have imagery`);return r=jn.reportError(r,i,i._errorEvent,s.message,void 0,void 0,void 0,s),Promise.reject(s)}return jn.reportSuccess(r),i._ready=o,o}).catch(function(o){return r=jn.reportError(r,i,i._errorEvent,o.message,void 0,void 0,void 0,o),Promise.reject(o)})}Object.defineProperties(w1.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});w1.prototype.getTileCredits=function(e,t,n){let i=this._metadata,r=i.getTileInformation(e,t,n);if(l(r)){let o=i.providers[r.imageryProvider];if(l(o))return[o]}};w1.prototype.requestImage=function(e,t,n,i){let r=this._tileDiscardPolicy._image,o=this._metadata,s=Mh.tileXYToQuadKey(e,t,n),a=o.getTileInformation(e,t,n);if(!l(a)){if(o.isValid(s)){let u=new oo({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});o.populateSubtree(e,t,n,u);return}return Promise.resolve(r)}if(!a.hasImagery())return Promise.resolve(r);let c=Bht(this,a,e,t,n,i).fetchArrayBuffer();if(!!l(c))return c.then(function(u){JI(o.key,u);let f=new Uint8Array(u),d,p=o.protoImagery;if((!l(p)||!p)&&(d=Lht(f)),!l(d)&&(!l(p)||p)){let g=Nht(f);d=g.imageType,f=g.imageData}return!l(d)||!l(f)?r:Y_({uint8Array:f,format:d,flipY:!0})})};w1.prototype.pickFeatures=function(e,t,n,i,r){};function Bht(e,t,n,i,r,o){let s=Mh.tileXYToQuadKey(n,i,r),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:o})}function Lht(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function Nht(e){let t=WA.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let r=i.imageType;if(l(r))switch(r){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new fe("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let o=i.alphaType;return l(o)&&o!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var W0e=w1;var Fht=new z(1,1,1,.4),Vht=new z(0,1,0,.05),kht=new z(0,.5,0,.2);function pC(e){e=y(e,y.EMPTY_OBJECT),this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Qi({ellipsoid:e.ellipsoid}),this._cells=y(e.cells,8),this._color=y(e.color,Fht),this._glowColor=y(e.glowColor,Vht),this._glowWidth=y(e.glowWidth,6),this._backgroundColor=y(e.backgroundColor,kht),this._errorEvent=new ge,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._canvasSize=y(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._readyPromise=Promise.resolve(!0)}Object.defineProperties(pC.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});pC.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let r=i/this._cells,o=1+r*(n-1);e.moveTo(o,0),e.lineTo(o,n),e.moveTo(0,o),e.lineTo(n,o)}e.stroke()};pC.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),r=this._backgroundColor.toCssColorString();i.fillStyle=r,i.fillRect(t,t,n,n);let o=this._glowColor.toCssColorString();i.strokeStyle=o,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};pC.prototype.getTileCredits=function(e,t,n){};pC.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};pC.prototype.pickFeatures=function(e,t,n,i,r){};var j0e=pC;function Sm(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new pi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new pi({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new li({color:new z(0,0,0,0),owner:this}),this._clearCommand=new li({color:new z(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(Sm.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});Sm.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var Uht={depthMask:!1,stencilTest:{enabled:!0,frontFunction:yi.EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:yi.NEVER,reference:0,mask:tn.CLASSIFICATION_MASK},blending:hn.ALPHA_BLEND},zht={depthMask:!1,stencilTest:{enabled:!0,frontFunction:yi.NOT_EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:yi.NEVER,reference:0,mask:tn.CLASSIFICATION_MASK},blending:hn.ALPHA_BLEND},Hht={depthMask:!0,depthTest:{enabled:!0},stencilTest:tn.setCesium3DTileBit(),stencilMask:tn.CESIUM_3D_TILE_MASK,blending:hn.ALPHA_BLEND},Ght=`#extension GL_EXT_frag_depth : enable
- uniform sampler2D colorTexture;
- uniform sampler2D depthTexture;
- uniform sampler2D classifiedTexture;
- varying vec2 v_textureCoordinates;
- void main()
- {
- vec4 color = texture2D(colorTexture, v_textureCoordinates);
- if (color.a == 0.0)
- {
- discard;
- }
- bool isClassified = all(equal(texture2D(classifiedTexture, v_textureCoordinates), vec4(0.0)));
- #ifdef UNCLASSIFIED
- vec4 highlightColor = czm_invertClassificationColor;
- if (isClassified)
- {
- discard;
- }
- #else
- vec4 highlightColor = vec4(1.0);
- if (!isClassified)
- {
- discard;
- }
- #endif
- gl_FragColor = color * highlightColor;
- gl_FragDepthEXT = texture2D(depthTexture, v_textureCoordinates).r;
- }
- `,Wht=`uniform sampler2D colorTexture;
- varying vec2 v_textureCoordinates;
- void main()
- {
- vec4 color = texture2D(colorTexture, v_textureCoordinates);
- if (color.a == 0.0)
- {
- discard;
- }
- #ifdef UNCLASSIFIED
- gl_FragColor = color * czm_invertClassificationColor;
- #else
- gl_FragColor = color;
- #endif
- }
- `;Sm.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),r=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let o=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||r||o)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new wt({context:e,width:s,height:a,pixelFormat:ct.DEPTH_STENCIL,pixelDatatype:qe.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new sf({context:e,width:s,height:a,format:Cl.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||r||o){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=Ve.fromCache(Uht),this._rsClassified=Ve.fromCache(zht),this._rsDefault=Ve.fromCache(Hht)),!l(this._unclassifiedCommand)||r||o){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=l(this._previousFramebuffer)?Wht:Ght,f=new Fe({defines:["UNCLASSIFIED"],sources:[u]}),d=new Fe({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(d,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(vu,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};Sm.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};Sm.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};Sm.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};Sm.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};Sm.prototype.isDestroyed=function(){return!1};Sm.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),ue(this)};var v1=Sm;function $U(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties($U.prototype,{total:{get:function(){return this._total}}});function z0(e){let t=new Array(ss.NUMBER_OF_JOB_TYPES);t[ss.TEXTURE]=new $U(l(e)?e[ss.TEXTURE]:10),t[ss.PROGRAM]=new $U(l(e)?e[ss.PROGRAM]:10),t[ss.BUFFER]=new $U(l(e)?e[ss.BUFFER]:30);let n=t.length,i,r=0;for(i=0;i<n;++i)r+=t[i].total;let o=new Array(n);for(i=0;i<n;++i)o[i]=!1;this._totalBudget=r,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=o}z0.getTimestamp=Bi;Object.defineProperties(z0.prototype,{totalBudget:{get:function(){return this._totalBudget}}});z0.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};z0.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};z0.prototype.execute=function(e,t){let n=this._budgets,i=n[t],r=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&r)return i.starvedThisFrame=!0,!1;let o;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,u;for(u=0;u<c&&(o=n[u],!(o.usedThisFrame+o.stolenFromMeThisFrame<o.total&&!o.starvedLastFrame));++u);if(u===c&&r)return!1;r&&(i.starvedThisFrame=!0)}let s=z0.getTimestamp();e.execute();let a=z0.getTimestamp()-s;return this._totalUsedThisFrame+=a,o?o.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var ZU=z0;function q0e(){}Object.defineProperties(q0e.prototype,{color:{get:ye.throwInstantiationError},intensity:{get:ye.throwInstantiationError}});var Y0e=q0e;var jht=/\/$/,X0e=new Gt('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function NE(e){e=y(e,y.EMPTY_OBJECT);let t=e.styleId,n=e.accessToken;this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0;let i=De.createIfNeeded(y(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=n;let r=y(e.tilesize,512);this._tilesize=r;let o=y(e.username,"mapbox");this._username=o;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();jht.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new Gt(c))):c=X0e,this._resource=i,this._imageryProvider=new oc({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(NE.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return this._imageryProvider.ready}},readyPromise:{get:function(){return this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});NE.prototype.getTileCredits=function(e,t,n){};NE.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};NE.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};NE._defaultCredit=X0e;var K0e=NE;function D1(e){e=y(e,y.EMPTY_OBJECT);let t=e.textureUrl;l(t)||(t=Qt("Assets/Textures/moonSmall.jpg")),this.show=y(e.show,!0),this.textureUrl=t,this._ellipsoid=y(e.ellipsoid,oe.MOON),this.onlySunLighting=y(e.onlySunLighting,!0),this._ellipsoidPrimitive=new fU({radii:this.ellipsoid.radii,material:cr.fromType(cr.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new yO}Object.defineProperties(D1.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var JU=new Q,qht=new Q,Yht=new h,QU=[];D1.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(yt.computeIcrfToFixedMatrix(n,JU))||yt.computeTemeToPseudoFixedMatrix(n,JU);let i=this._axes.evaluate(n,qht);Q.transpose(i,i),Q.multiply(JU,i,i);let r=Wy.computeMoonPositionInEarthInertialFrame(n,Yht);Q.multiplyByVector(JU,r,r),N.fromRotationTranslation(i,r,t.modelMatrix);let o=e.commandList;return e.commandList=QU,QU.length=0,t.update(e),e.commandList=o,QU.length===1?QU[0]:void 0};D1.prototype.isDestroyed=function(){return!1};D1.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ue(this)};var e4=D1;function dY(e){}dY.prototype.isReady=function(){return!0};dY.prototype.shouldDiscardImage=function(e){return!1};var $0e=dY;var P1=`#ifdef MRT
- #extension GL_EXT_draw_buffers : enable
- #endif
- uniform vec4 u_bgColor;
- uniform sampler2D u_depthTexture;
- varying vec2 v_textureCoordinates;
- void main()
- {
- if (texture2D(u_depthTexture, v_textureCoordinates).r < 1.0)
- {
- #ifdef MRT
- gl_FragData[0] = u_bgColor;
- gl_FragData[1] = vec4(u_bgColor.a);
- #else
- gl_FragColor = u_bgColor;
- #endif
- return;
- }
- discard;
- }
- `;var t4=`uniform sampler2D u_opaque;
- uniform sampler2D u_accumulation;
- uniform sampler2D u_revealage;
- varying vec2 v_textureCoordinates;
- void main()
- {
- vec4 opaque = texture2D(u_opaque, v_textureCoordinates);
- vec4 accum = texture2D(u_accumulation, v_textureCoordinates);
- float r = texture2D(u_revealage, v_textureCoordinates).r;
- #ifdef MRT
- vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);
- #else
- vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);
- #endif
- gl_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;
- if (opaque != czm_backgroundColor)
- {
- gl_FragColor.a = 1.0;
- }
- }
- `;function s_(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new pi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new pi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new pi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new pi({createColorAttachments:!1}),this._opaqueClearCommand=new li({color:new z(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new li({color:new z(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new li({color:new z(0,0,0,0),owner:this}),this._alphaClearCommand=new li({color:new z(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new je,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function Z0e(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function hY(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function J0e(e){Z0e(e),hY(e)}function Xht(e,t,n,i){Z0e(e),e._accumulationTexture=new wt({context:t,width:n,height:i,pixelFormat:ct.RGBA,pixelDatatype:qe.FLOAT});let r=new Float32Array(n*i*4);e._revealageTexture=new wt({context:t,pixelFormat:ct.RGBA,pixelDatatype:qe.FLOAT,source:{arrayBufferView:r,width:n,height:i},flipY:!1})}function Kht(e,t){hY(e);let n=Z.FRAMEBUFFER_COMPLETE,i=!0,r=e._accumulationTexture.width,o=e._accumulationTexture.height;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,r,o),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(hY(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,r,o),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,r,o);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!c||!u)&&(J0e(e),e._translucentMultipassSupport=!1,i=!1)}return i}s_.prototype.update=function(e,t,n,i,r){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let o=this._opaqueTexture.width,s=this._opaqueTexture.height,a=this._accumulationTexture,c=!l(a)||a.width!==o||a.height!==s||i!==this._useHDR,u=this._numSamples!==r;if((c||u)&&(this._numSamples=r,Xht(this,e,o,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!Kht(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new Fe({sources:[t4]}),this._translucentMRTSupport&&d.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(d=new Fe({defines:["MRT"],sources:[P1]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(d=new Fe({sources:[P1]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}))),this._viewport.width=o,this._viewport.height=s;let g=!je.equals(this._viewport,t.viewport),m=g!==this._useScissorTest;this._useScissorTest=g,je.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=je.clone(t.viewport,this._scissorRectangle),m=!0),(!l(this._rs)||!je.equals(this._viewport,this._rs.viewport)||m)&&(this._rs=Ve.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var $ht={enabled:!0,color:new z(0,0,0,0),equationRgb:Wa.ADD,equationAlpha:Wa.ADD,functionSourceRgb:Pr.ONE,functionDestinationRgb:Pr.ONE,functionSourceAlpha:Pr.ZERO,functionDestinationAlpha:Pr.ONE_MINUS_SOURCE_ALPHA},Zht={enabled:!0,color:new z(0,0,0,0),equationRgb:Wa.ADD,equationAlpha:Wa.ADD,functionSourceRgb:Pr.ONE,functionDestinationRgb:Pr.ONE,functionSourceAlpha:Pr.ONE,functionDestinationAlpha:Pr.ONE},Jht={enabled:!0,color:new z(0,0,0,0),equationRgb:Wa.ADD,equationAlpha:Wa.ADD,functionSourceRgb:Pr.ZERO,functionDestinationRgb:Pr.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Pr.ZERO,functionDestinationAlpha:Pr.ONE_MINUS_SOURCE_ALPHA};function mY(e,t,n,i){let r=n[i.id];if(!l(r)){let o=Ve.getState(i);o.depthMask=!1,o.blending=t,r=Ve.fromCache(o),n[i.id]=r}return r}function Qht(e,t,n){return mY(t,$ht,e._translucentRenderStateCache,n)}function emt(e,t,n){return mY(t,Zht,e._translucentRenderStateCache,n)}function tmt(e,t,n){return mY(t,Jht,e._alphaRenderStateCache,n)}var nmt=` vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;
- float ai = czm_gl_FragColor.a;
- float wzi = czm_alphaWeight(ai);
- gl_FragData[0] = vec4(Ci * wzi, ai);
- gl_FragData[1] = vec4(ai * wzi);
- `,imt=` vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;
- float ai = czm_gl_FragColor.a;
- float wzi = czm_alphaWeight(ai);
- gl_FragColor = vec4(Ci, ai) * wzi;
- `,rmt=` float ai = czm_gl_FragColor.a;
- gl_FragColor = vec4(ai);
- `;function pY(e,t,n,i){let r=e.shaderCache.getDerivedShaderProgram(t,n);if(!l(r)){let o=t._attributeLocations,s=t.fragmentShaderSource.clone();s.sources=s.sources.map(function(a){return a=Fe.replaceMain(a,"czm_translucent_main"),a=a.replace(/gl_FragColor/g,"czm_gl_FragColor"),a=a.replace(/\bdiscard\b/g,"czm_discard = true"),a=a.replace(/czm_phong/g,"czm_translucentPhong"),a}),s.sources.splice(0,0,`${i.indexOf("gl_FragData")!==-1?`#extension GL_EXT_draw_buffers : enable
- `:""}vec4 czm_gl_FragColor;
- bool czm_discard = false;
- `),s.sources.push(`void main()
- {
- czm_translucent_main();
- if (czm_discard)
- {
- discard;
- }
- ${i}}
- `),r=e.shaderCache.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:s,attributeLocations:o})}return r}function omt(e,t){return pY(e,t,"translucentMRT",nmt)}function smt(e,t){return pY(e,t,"translucentMultipass",imt)}function amt(e,t){return pY(e,t,"alphaMultipass",rmt)}s_.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let i,r;l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,r=n.translucentCommand.renderState),n.translucentCommand=Ze.shallowClone(e,n.translucentCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=omt(t,e.shaderProgram),n.translucentCommand.renderState=Qht(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=r)}else{let i,r,o,s;l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,r=n.translucentCommand.renderState,o=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=Ze.shallowClone(e,n.translucentCommand),n.alphaCommand=Ze.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=smt(t,e.shaderProgram),n.translucentCommand.renderState=emt(this,t,e.renderState),n.alphaCommand.shaderProgram=amt(t,e.shaderProgram),n.alphaCommand.renderState=tmt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=r,n.alphaCommand.shaderProgram=o,n.alphaCommand.renderState=s)}return n};function cmt(e,t,n,i,r,o){let s,a,c,u=t.context,f=t.frameState.useLogDepth,d=t._hdr,p=i.framebuffer,g=r.length,m=t.frameState.shadowState.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(u,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(u,i);let x=e._opaqueFBO.framebuffer;for(i.framebuffer=e._translucentFBO.framebuffer,c=0;c<g;++c)s=r[c],s=f?s.derivedCommands.logDepth.command:s,s=d?s.derivedCommands.hdr.command:s,a=m&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,n(a,t,u,i,x);for(l(o)&&(s=o.unclassifiedCommand,a=m&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,n(a,t,u,i,x)),i.framebuffer=e._alphaFBO.framebuffer,c=0;c<g;++c)s=r[c],s=f?s.derivedCommands.logDepth.command:s,s=d?s.derivedCommands.hdr.command:s,a=m&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,n(a,t,u,i,x);l(o)&&(s=o.unclassifiedCommand,a=m&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,n(a,t,u,i,x)),i.framebuffer=p}function lmt(e,t,n,i,r,o){let s=t.context,a=t.frameState.useLogDepth,c=t._hdr,u=i.framebuffer,f=r.length,d=t.frameState.shadowState.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let p=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;let g,m;for(let x=0;x<f;++x)g=r[x],g=a?g.derivedCommands.logDepth.command:g,g=c?g.derivedCommands.hdr.command:g,m=d&&g.receiveShadows?g.derivedCommands.oit.shadows.translucentCommand:g.derivedCommands.oit.translucentCommand,n(m,t,s,i,p);l(o)&&(g=o.unclassifiedCommand,m=d&&g.receiveShadows?g.derivedCommands.oit.shadows.translucentCommand:g.derivedCommands.oit.translucentCommand,n(m,t,s,i,p)),i.framebuffer=u}s_.prototype.executeCommands=function(e,t,n,i,r){if(this._translucentMRTSupport){lmt(this,e,t,n,i,r);return}cmt(this,e,t,n,i,r)};s_.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};s_.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,z.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};s_.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};s_.prototype.isDestroyed=function(){return!1};s_.prototype.destroy=function(){return J0e(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),ue(this)};var n4=s_;var umt=new Gt("MapQuest, Open Street Map and contributors, CC-BY-SA");function i4(e){e=y(e,y.EMPTY_OBJECT);let t=De.createIfNeeded(y(e.url,"https://a.tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+=`{z}/{x}/{y}.${y(e.fileExtension,"png")}`;let n=new is({ellipsoid:e.ellipsoid}),i=256,r=256,o=y(e.minimumLevel,0),s=e.maximumLevel,a=y(e.rectangle,n.rectangle),c=n.positionToTileXY(he.southwest(a),o),u=n.positionToTileXY(he.northeast(a),o),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),d=y(e.credit,umt);typeof d=="string"&&(d=new Gt(d)),oc.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:r,minimumLevel:o,maximumLevel:s,rectangle:a})}l(Object.create)&&(i4.prototype=Object.create(oc.prototype),i4.prototype.constructor=i4);var FE=i4;var fmt=new W(1,1);function _Y(e){e=y(e,y.EMPTY_OBJECT),this.mass=y(e.mass,1),this.position=h.clone(y(e.position,h.ZERO)),this.velocity=h.clone(y(e.velocity,h.ZERO)),this.life=y(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=z.clone(y(e.startColor,z.WHITE)),this.endColor=z.clone(y(e.endColor,z.WHITE)),this.startScale=y(e.startScale,1),this.endScale=y(e.endScale,1),this.imageSize=W.clone(y(e.imageSize,fmt)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(_Y.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var Q0e=new h;_Y.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,Q0e),h.add(this.position,Q0e,this.position),l(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var I1=_Y;function eye(e){e=y(e,y.EMPTY_OBJECT),this.time=y(e.time,0),this.minimum=y(e.minimum,0),this.maximum=y(e.maximum,50),this._complete=!1}Object.defineProperties(eye.prototype,{complete:{get:function(){return this._complete}}});var tye=eye;function nye(e){}nye.prototype.emit=function(e){ye.throwInstantiationError()};var iye=nye;var rye=new W(1,1);function O1(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.updateCallback=e.updateCallback,this.loop=y(e.loop,!0),this.image=y(e.image,void 0);let t=e.emitter;l(t)||(t=new Bk(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this._emitterModelMatrix=N.clone(y(e.emitterModelMatrix,N.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new N,this._startColor=z.clone(y(e.color,y(e.startColor,z.WHITE))),this._endColor=z.clone(y(e.color,y(e.endColor,z.WHITE))),this._startScale=y(e.scale,y(e.startScale,1)),this._endScale=y(e.scale,y(e.endScale,1)),this._emissionRate=y(e.emissionRate,5),this._minimumSpeed=y(e.speed,y(e.minimumSpeed,1)),this._maximumSpeed=y(e.speed,y(e.maximumSpeed,1)),this._minimumParticleLife=y(e.particleLife,y(e.minimumParticleLife,5)),this._maximumParticleLife=y(e.particleLife,y(e.maximumParticleLife,5)),this._minimumMass=y(e.mass,y(e.minimumMass,1)),this._maximumMass=y(e.mass,y(e.maximumMass,1)),this._minimumImageSize=W.clone(y(e.imageSize,y(e.minimumImageSize,rye))),this._maximumImageSize=W.clone(y(e.imageSize,y(e.maximumImageSize,rye))),this._sizeInMeters=y(e.sizeInMeters,!1),this._lifetime=y(e.lifetime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new ge,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(O1.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!N.equals(this._modelMatrix,e),N.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!N.equals(this._emitterModelMatrix,e),N.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){z.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){z.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function dmt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,r=e._bursts;if(l(r)){let d=r.length;for(let p=0;p<d;++p)i+=r[p].maximum}let o=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(a-c.length-u.length,0);for(let d=0;d<f;++d){let p=new I1;p._billboard=o.add({image:s}),u.push(p)}e._particleEstimate=a}function hmt(e){let t=e._particlePool.pop();return l(t)||(t=new I1),t}function mmt(e,t){e._particlePool.push(t)}function pmt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,r=t.length,o=n.length,s=e._particleEstimate,a=o-Math.max(s-r-o,0);for(let c=a;c<o;++c){let u=n[c];i.remove(u._billboard)}n.length=a}function _mt(e){l(e._billboard)&&(e._billboard.show=!1)}function oye(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=M.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),r=M.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),o=M.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=M.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new z(i,r,o,s),n.scale=M.lerp(t.startScale,t.endScale,t.normalizedAge)}function gmt(e,t){t.startColor=z.clone(e._startColor,t.startColor),t.endColor=z.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=M.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=M.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=M.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=M.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=M.randomBetween(e._minimumSpeed,e._maximumSpeed);h.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function ymt(e,t){if(e._isComplete)return 0;t=M.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let r=e.bursts.length;for(let o=0;o<r;o++){let s=e.bursts[o],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=M.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var r4=new h;O1.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new uf),this._updateParticlePool&&(dmt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=ee.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,r=this.updateCallback,o,s,a=n.length;for(o=0;o<a;++o)s=n[o],s.update(t,r)?oye(this,s):(_mt(s),mmt(this,s),n[o]=n[a-1],--o,--a);n.length=a;let c=ymt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=N.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(o=0;o<c;o++)s=hmt(this),this._emitter.emit(s),h.add(s.position,s.velocity,r4),N.multiplyByPoint(u,r4,r4),s.position=N.multiplyByPoint(u,s.position,s.position),h.subtract(r4,s.position,s.velocity),h.normalize(s.velocity,s.velocity),gmt(this,s),oye(this,s)}if(this._billboardCollection.update(e),this._previousTime=ee.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=M.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(o=0;o<u;o++)this.bursts[o]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&pmt(this)};O1.prototype.isDestroyed=function(){return!1};O1.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ue(this)};var sye=O1;function o4(e){e=y(e,y.EMPTY_OBJECT);let t=Pn(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let r=document.createElement("div");r.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),r.appendChild(this._msText),n.appendChild(r),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=Bi(),this._lastMsSampleTime=Bi(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let o=document.createElement("div");o.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),o.appendChild(this._throttledText),n.appendChild(o)}Object.defineProperties(o4.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});o4.prototype.update=function(e){let t=Bi(),n=y(e,!0);this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let o="N/A";n&&(o=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${o} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let r=t-this._lastMsSampleTime;if(r>200){let o="N/A";n&&(o=(r/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${o} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};o4.prototype.destroy=function(){return ue(this)};var H0=o4;function _C(){this._framebuffer=new pi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(_C.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function xmt(e,t,n){let i=n.width,r=n.height;e._framebuffer.update(t,i,r)}function Cmt(e,t,n){if(!l(e._copyDepthCommand)){let i=`uniform highp sampler2D u_texture;
- varying vec2 v_textureCoordinates;
- void main()
- {
- gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);
- }
- `;e._copyDepthCommand=t.createViewportQuadCommand(i,{renderState:Ve.fromCache(),uniformMap:{u_texture:function(){return e._textureToCopy}},owner:e})}e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}_C.prototype.update=function(e,t){xmt(this,e,t),Cmt(this,e,t)};var Amt=new se,Tmt=new se(1,1/255,1/65025,1/16581375);_C.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),r=se.unpack(i,0,Amt);return se.divideByScalar(r,255,r),se.dot(r,Tmt)};_C.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};_C.prototype.isDestroyed=function(){return!1};_C.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ue(this)};var s4=_C;function R1(){this._framebuffer=new pi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(R1.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function bmt(e){e._framebuffer.destroy()}function Emt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let r=new Hc(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new je},r.viewport=new je,e._passState=r}R1.prototype.update=function(e,t,n){let i=n.width,r=n.height;this._framebuffer.isDirty(i,r)&&Emt(this,e);let o=this.framebuffer,s=this._passState;return s.framebuffer=o,s.viewport.width=i,s.viewport.height=r,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=r-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};R1.prototype.isDestroyed=function(){return!1};R1.prototype.destroy=function(){return bmt(this),ue(this)};var a4=R1;function B1(e){let t=new Hc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new je},t.viewport=new je,this._context=e,this._fb=new pi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}B1.prototype.begin=function(e,t){let n=this._context,i=t.width,r=t.height;return je.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=r,this._fb.update(n,i,r),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=r,this._passState};var M1=new z;B1.prototype.end=function(e){let t=y(e.width,1),n=y(e.height,1),i=this._context,r=i.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),o=Math.max(t,n),s=o*o,a=Math.floor(t*.5),c=Math.floor(n*.5),u=0,f=0,d=0,p=-1;for(let g=0;g<s;++g){if(-a<=u&&u<=a&&-c<=f&&f<=c){let m=4*((c-f)*t+u+a);M1.red=z.byteToFloat(r[m]),M1.green=z.byteToFloat(r[m+1]),M1.blue=z.byteToFloat(r[m+2]),M1.alpha=z.byteToFloat(r[m+3]);let x=i.getObjectByPickColor(M1);if(l(x))return x}if(u===f||u<0&&-u===f||u>0&&u===1-f){let m=d;d=-p,p=m}u+=d,f+=p}};B1.prototype.isDestroyed=function(){return!1};B1.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var c4=B1;function a_(){this._numSamples=1,this._colorFramebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new z(0,0,0,0),this._clearCommand=new li({color:new z(0,0,0,0),depth:1,owner:this})}function Smt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(a_.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});a_.prototype.update=function(e,t,n,i){let r=t.width,o=t.height,s=n?e.halfFloatingPointTexture?qe.HALF_FLOAT:qe.FLOAT:qe.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,r,o,i,s),this._idFramebuffer.update(e,r,o)};a_.prototype.clear=function(e,t,n){z.clone(n,this._clearCommand.color),z.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};a_.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};a_.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};a_.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};a_.prototype.isDestroyed=function(){return!1};a_.prototype.destroy=function(){return Smt(this),ue(this)};var VE=a_;function gC(){}gC.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};gC.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let o=Fe.findPositionVarying(e),s=l(o);if(t&&!s){let a=r.length;for(let u=0;u<a;++u)r[u]=Fe.replaceMain(r[u],"czm_shadow_cast_main");let c=`varying vec3 v_positionEC;
- void main()
- {
- czm_shadow_cast_main();
- v_positionEC = (czm_inverseProjection * gl_Position).xyz;
- }`;r.push(c)}return new Fe({defines:i,sources:r})};gC.createShadowCastFragmentShader=function(e,t,n,i){let r=e.defines.slice(0),o=e.sources.slice(0);r.push("SHADOW_MAP");let s=Fe.findPositionVarying(e),a=l(s);a||(s="v_positionEC");let c=o.length;for(let f=0;f<c;++f)o[f]=Fe.replaceMain(o[f],"czm_shadow_cast_main");let u="";return t&&(a||(u+=`varying vec3 v_positionEC;
- `),u+=`uniform vec4 shadowMap_lightPositionEC;
- `),i?u+=`void main()
- {
- `:u+=`void main()
- {
- czm_shadow_cast_main();
- if (gl_FragColor.a == 0.0)
- {
- discard;
- }
- `,t?u+=` float distance = length(${s});
- if (distance >= shadowMap_lightPositionEC.w)
- {
- discard;
- }
- distance /= shadowMap_lightPositionEC.w; // radius
- gl_FragColor = czm_packDepth(distance);
- `:n?u+=` gl_FragColor = vec4(1.0);
- `:u+=` gl_FragColor = czm_packDepth(gl_FragCoord.z);
- `,u+=`}
- `,o.push(u),new Fe({defines:r,sources:o})};gC.getShadowReceiveShaderKeyword=function(e,t,n,i){let r=e._usesDepthTexture,o=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${r}${o}${s}${a}${c}${u}${f}${t}${n}${i}`};gC.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new Fe({defines:i,sources:r})};gC.createShadowReceiveFragmentShader=function(e,t,n,i,r){let o=Fe.findNormalVarying(e),s=!i&&l(o)||i&&r,a=Fe.findPositionVarying(e),c=l(a),u=t._usesDepthTexture,f=t._polygonOffsetSupported,d=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,m=t.debugCascadeColors,x=t.softShadows,C=d?t._pointBias:i?t._terrainBias:t._primitiveBias,A=e.defines.slice(0),b=e.sources.slice(0),T=b.length;for(let D=0;D<T;++D)b[D]=Fe.replaceMain(b[D],"czm_shadow_receive_main");d?A.push("USE_CUBE_MAP_SHADOW"):u&&A.push("USE_SHADOW_DEPTH_TEXTURE"),x&&!d&&A.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?A.push("ENABLE_VERTEX_LIGHTING"):A.push("ENABLE_DAYNIGHT_SHADING")),n&&C.normalShading&&s&&(A.push("USE_NORMAL_SHADING"),C.normalShadingSmooth>0&&A.push("USE_NORMAL_SHADING_SMOOTH"));let S="";d?S+=`uniform samplerCube shadowMap_textureCube;
- `:S+=`uniform sampler2D shadowMap_texture;
- `;let w;return c?w=` return vec4(${a}, 1.0);
- `:w=`#ifndef LOG_DEPTH
- return czm_windowToEyeCoordinates(gl_FragCoord);
- #else
- return vec4(v_logPositionEC, 1.0);
- #endif
- `,S+=`uniform mat4 shadowMap_matrix;
- uniform vec3 shadowMap_lightDirectionEC;
- uniform vec4 shadowMap_lightPositionEC;
- uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness;
- uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth;
- #ifdef LOG_DEPTH
- varying vec3 v_logPositionEC;
- #endif
- vec4 getPositionEC()
- {
- ${w}}
- vec3 getNormalEC()
- {
- ${s?` return normalize(${o});
- `:` return vec3(1.0);
- `}}
- void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL)
- {
- ${C.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x;
- float normalOffsetScale = 1.0 - nDotL;
- vec3 offset = normalOffset * normalOffsetScale * normalEC;
- positionEC.xyz += offset;
- `:""}}
- `,S+=`void main()
- {
- czm_shadow_receive_main();
- vec4 positionEC = getPositionEC();
- vec3 normalEC = getNormalEC();
- float depth = -positionEC.z;
- `,S+=` czm_shadowParameters shadowParameters;
- shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy;
- shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z;
- shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w;
- shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w;
- `,i?S+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0);
- `:f||(S+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015);
- `),d?S+=` vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz;
- float distance = length(directionEC);
- directionEC = normalize(directionEC);
- float radius = shadowMap_lightPositionEC.w;
- // Stop early if the fragment is beyond the point light radius
- if (distance > radius)
- {
- return;
- }
- vec3 directionWC = czm_inverseViewRotation * directionEC;
- shadowParameters.depth = distance / radius;
- shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0);
- shadowParameters.texCoords = directionWC;
- float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters);
- `:p?S+=` vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz);
- float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0);
- applyNormalOffset(positionEC, normalEC, nDotL);
- vec4 shadowPosition = shadowMap_matrix * positionEC;
- // Spot light uses a perspective projection, so perform the perspective divide
- shadowPosition /= shadowPosition.w;
- // Stop early if the fragment is not in the shadow bounds
- if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0))))
- {
- return;
- }
- shadowParameters.texCoords = shadowPosition.xy;
- shadowParameters.depth = shadowPosition.z;
- shadowParameters.nDotL = nDotL;
- float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters);
- `:g?S+=` float maxDepth = shadowMap_cascadeSplits[1].w;
- // Stop early if the eye depth exceeds the last cascade
- if (depth > maxDepth)
- {
- return;
- }
- // Get the cascade based on the eye-space depth
- vec4 weights = czm_cascadeWeights(depth);
- // Apply normal offset
- float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0);
- applyNormalOffset(positionEC, normalEC, nDotL);
- // Transform position into the cascade
- vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC;
- // Get visibility
- shadowParameters.texCoords = shadowPosition.xy;
- shadowParameters.depth = shadowPosition.z;
- shadowParameters.nDotL = nDotL;
- float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters);
- // Fade out shadows that are far away
- float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z;
- float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0);
- visibility = mix(visibility, 1.0, fade);
- ${m?` // Draw cascade colors for debugging
- gl_FragColor *= czm_cascadeColor(weights);
- `:""}`:S+=` float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0);
- applyNormalOffset(positionEC, normalEC, nDotL);
- vec4 shadowPosition = shadowMap_matrix * positionEC;
- // Stop early if the fragment is not in the shadow bounds
- if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0))))
- {
- return;
- }
- shadowParameters.texCoords = shadowPosition.xy;
- shadowParameters.depth = shadowPosition.z;
- shadowParameters.nDotL = nDotL;
- float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters);
- `,S+=` gl_FragColor.rgb *= visibility;
- }
- `,b.push(S),new Fe({defines:A,sources:b})};var c_=gC;function wm(e){e=y(e,y.EMPTY_OBJECT);let t=e.context;this._enabled=y(e.enabled,!0),this._softShadows=y(e.softShadows,!1),this._normalOffset=y(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=y(e.fromLightSource,!0),this.darkness=y(e.darkness,.3),this._darkness=this.darkness,this.fadingEnabled=y(e.fadingEnabled,!0),this.maximumDistance=y(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(Et.isInternetExplorer()||Et.isEdge()||(Et.isChrome()||Et.isFirefox())&&Et.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new N,this._shadowMapTexture=void 0,this._lightDirectionEC=new h,this._lightPositionEC=new se,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new l4,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new re,this._isPointLight=y(e.isPointLight,!1),this._pointLightRadius=y(e.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:y(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?y(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new W,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Xo:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new se,new se],this._cascadeMatrices=[new N,new N,new N,new N],this._cascadeDistances=new se;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let r=0;r<i;++r)this._passes[r]=new wmt(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,yY(this),this._clearCommand=new li({depth:1,color:new z}),this._clearPassState=new Hc(t),this._size=y(e.size,2048),this.size=this._size}wm.MAXIMUM_DISTANCE=2e4;function wmt(e){this.camera=new l4,this.passState=new Hc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function gY(e,t){return Ve.fromCache({cull:{enabled:!0,face:Yi.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function yY(e){let t=!e._usesDepthTexture;e._primitiveRenderState=gY(t,e._primitiveBias),e._terrainRenderState=gY(t,e._terrainBias),e._pointRenderState=gY(t,e._pointBias)}wm.prototype.debugCreateRenderStates=function(){yY(this)};Object.defineProperties(wm.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){Rmt(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function xY(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],r=i.framebuffer;l(r)&&!r.isDestroyed()&&r.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function vmt(e,t){let n=new sf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Cl.DEPTH_COMPONENT16}),i=new wt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ct.RGBA,pixelDatatype:qe.UNSIGNED_BYTE,sampler:on.NEAREST}),r=new ya({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),o=e._passes.length;for(let s=0;s<o;++s){let a=e._passes[s];a.framebuffer=r,a.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function Dmt(e,t){let n=new wt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ct.DEPTH_STENCIL,pixelDatatype:qe.UNSIGNED_INT_24_8,sampler:on.NEAREST}),i=new ya({context:t,depthStencilTexture:n,destroyAttachments:!1}),r=e._passes.length;for(let o=0;o<r;++o){let s=e._passes[o];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function Pmt(e,t){let n=new sf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Cl.DEPTH_COMPONENT16}),i=new Sc({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ct.RGBA,pixelDatatype:qe.UNSIGNED_BYTE,sampler:on.NEAREST}),r=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let o=0;o<6;++o){let s=new ya({context:t,depthRenderbuffer:n,colorTextures:[r[o]],destroyAttachments:!1}),a=e._passes[o];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function lye(e,t){e._isPointLight?Pmt(e,t):e._usesDepthTexture?Dmt(e,t):vmt(e,t)}function Imt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==Z.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,yY(e),xY(e),lye(e,t))}function Omt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(xY(e),lye(e,t),Imt(e,t),uye(e,t))}function uye(e,t,n){n=y(n,0),(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function Rmt(e,t){e._size=t;let n=e._passes,i=n.length,r=e._textureSize;if(e._isPointLight){t=Bt.maximumCubeMapSize>=t?t:Bt.maximumCubeMapSize,r.x=t,r.y=t;let o=new je(0,0,t,t);n[0].passState.viewport=o,n[1].passState.viewport=o,n[2].passState.viewport=o,n[3].passState.viewport=o,n[4].passState.viewport=o,n[5].passState.viewport=o}else i===1?(t=Bt.maximumTextureSize>=t?t:Bt.maximumTextureSize,r.x=t,r.y=t,n[0].passState.viewport=new je(0,0,t,t)):i===4&&(t=Bt.maximumTextureSize>=t*2?t:Bt.maximumTextureSize/2,r.x=t*2,r.y=t*2,n[0].passState.viewport=new je(0,0,t,t),n[1].passState.viewport=new je(t,0,t,t),n[2].passState.viewport=new je(0,t,t,t),n[3].passState.viewport=new je(t,t,t,t));e._clearPassState.viewport=new je(0,0,r.x,r.y);for(let o=0;o<i;++o){let s=n[o],a=s.passState.viewport,c=a.x/r.x,u=a.y/r.y,f=a.width/r.x,d=a.height/r.y;s.textureOffsets=new N(f,0,0,c,0,d,0,u,0,0,1,0,0,0,0,1)}}var Mmt=new je;function Bmt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube;
- varying vec2 v_textureCoordinates;
- void main()
- {
- vec2 uv = v_textureCoordinates;
- vec3 dir;
-
- if (uv.y < 0.5)
- {
- if (uv.x < 0.333)
- {
- dir.x = -1.0;
- dir.y = uv.x * 6.0 - 1.0;
- dir.z = uv.y * 4.0 - 1.0;
- }
- else if (uv.x < 0.666)
- {
- dir.y = -1.0;
- dir.x = uv.x * 6.0 - 3.0;
- dir.z = uv.y * 4.0 - 1.0;
- }
- else
- {
- dir.z = -1.0;
- dir.x = uv.x * 6.0 - 5.0;
- dir.y = uv.y * 4.0 - 1.0;
- }
- }
- else
- {
- if (uv.x < 0.333)
- {
- dir.x = 1.0;
- dir.y = uv.x * 6.0 - 1.0;
- dir.z = uv.y * 4.0 - 3.0;
- }
- else if (uv.x < 0.666)
- {
- dir.y = 1.0;
- dir.x = uv.x * 6.0 - 3.0;
- dir.z = uv.y * 4.0 - 3.0;
- }
- else
- {
- dir.z = 1.0;
- dir.x = uv.x * 6.0 - 5.0;
- dir.y = uv.y * 4.0 - 3.0;
- }
- }
-
- float shadow = czm_unpackDepth(textureCube(shadowMap_textureCube, dir));
- gl_FragColor = vec4(vec3(shadow), 1.0);
- }
- `:n=`uniform sampler2D shadowMap_texture;
- varying vec2 v_textureCoordinates;
- void main()
- {
- ${e._usesDepthTexture?` float shadow = texture2D(shadowMap_texture, v_textureCoordinates).r;
- `:` float shadow = czm_unpackDepth(texture2D(shadowMap_texture, v_textureCoordinates));
- `} gl_FragColor = vec4(vec3(shadow), 1.0);
- }
- `;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Ce.OVERLAY,i}function Lmt(e,t){let n=t.context,i=t.context.drawingBufferWidth,r=t.context.drawingBufferHeight,o=Math.min(i,r)*.3,s=Mmt;s.x=i-o,s.y=0,s.width=o,s.height=o;let a=e._debugShadowViewCommand;l(a)||(a=Bmt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!je.equals(a.renderState.viewport,s))&&(a.renderState=Ve.fromCache({viewport:je.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var vm=new Array(8);vm[0]=new se(-1,-1,-1,1);vm[1]=new se(1,-1,-1,1);vm[2]=new se(1,1,-1,1);vm[3]=new se(-1,1,-1,1);vm[4]=new se(-1,-1,1,1);vm[5]=new se(1,-1,1,1);vm[6]=new se(1,1,1,1);vm[7]=new se(-1,1,1,1);var G0=new N,CY=new Array(8);for(let e=0;e<8;++e)CY[e]=new se;function Nmt(e,t){let n=new pt({geometry:new Ch({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:Ot.fromColor(t)}}),i=new pt({geometry:new og({radius:.5}),attributes:{color:Ot.fromColor(t)}});return new Tn({geometryInstances:[n,i],appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var Fmt=[z.RED,z.GREEN,z.BLUE,z.MAGENTA],Vmt=new h;function kmt(e,t){Lmt(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new r_({camera:e._sceneCamera,color:z.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new r_({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new r_({camera:e._passes[i].camera,color:Fmt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,r=Re.IDENTITY,o=e._pointLightRadius*2,s=h.fromElements(o,o,o,Vmt),a=N.fromTranslationQuaternionRotationScale(i,r,s,G0);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=Nmt(a,z.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new r_({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function l4(){this.viewMatrix=new N,this.inverseViewMatrix=new N,this.frustum=void 0,this.positionCartographic=new me,this.positionWC=new h,this.directionWC=h.clone(h.UNIT_Z),this.upWC=h.clone(h.UNIT_Y),this.rightWC=h.clone(h.UNIT_X),this.viewProjectionMatrix=new N}l4.prototype.clone=function(e){N.clone(e.viewMatrix,this.viewMatrix),N.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),me.clone(e.positionCartographic,this.positionCartographic),h.clone(e.positionWC,this.positionWC),h.clone(e.directionWC,this.directionWC),h.clone(e.upWC,this.upWC),h.clone(e.rightWC,this.rightWC)};var Umt=new N(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);l4.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return N.multiply(t,e,this.viewProjectionMatrix),N.multiply(Umt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var zmt=new Array(5),Hmt=new bi,Gmt=new Array(4),fye=new h,dye=new h;function Wmt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=i.frustum.near,o=i.frustum.far,s=e._numberOfCascades,a,c=o-r,u=o/r,f=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,f=.9);let p=Gmt,g=zmt;for(g[0]=r,g[s]=o,a=0;a<s;++a){let L=(a+1)/s,_=r*Math.pow(u,L),E=r+c*L,v=M.lerp(E,_,f);g[a+1]=v,p[a]=v-g[a]}if(d){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let L=g[0];for(a=0;a<s-1;++a)L+=p[a],g[a+1]=L}se.unpack(g,0,e._cascadeSplits[0]),se.unpack(g,1,e._cascadeSplits[1]),se.unpack(p,0,e._cascadeDistances);let m=n.frustum,x=m.left,C=m.right,A=m.bottom,b=m.top,T=m.near,S=m.far,w=n.positionWC,D=n.directionWC,I=n.upWC,O=i.frustum.clone(Hmt),B=n.getViewProjection();for(a=0;a<s;++a){O.near=g[a],O.far=g[a+1];let L=N.multiply(O.projectionMatrix,i.viewMatrix,G0),_=N.inverse(L,G0),E=N.multiply(B,_,G0),v=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,fye),P=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,dye);for(let H=0;H<8;++H){let V=se.clone(vm[H],CY[H]);N.multiplyByVector(E,V,V),h.divideByScalar(V,V.w,V),h.minimumByComponent(V,v,v),h.maximumByComponent(V,P,P)}v.x=Math.max(v.x,0),v.y=Math.max(v.y,0),v.z=0,P.x=Math.min(P.x,1),P.y=Math.min(P.y,1),P.z=Math.min(P.z,1);let R=e._passes[a],F=R.camera;F.clone(n);let U=F.frustum;U.left=x+v.x*(C-x),U.right=x+P.x*(C-x),U.bottom=A+v.y*(b-A),U.top=A+P.y*(b-A),U.near=T+v.z*(S-T),U.far=T+P.z*(S-T),R.cullingVolume=F.frustum.computeCullingVolume(w,D,I);let k=e._cascadeMatrices[a];N.multiply(F.getViewProjection(),i.inverseViewMatrix,k),N.multiply(R.textureOffsets,k,k)}}var jmt=new N,qmt=new h,Ymt=new h,aye=new h;function Xmt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=N.multiply(i.frustum.projectionMatrix,i.viewMatrix,G0),o=N.inverse(r,G0),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,M.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,qmt);a=h.cross(c,s,Ymt),h.normalize(a,a),h.normalize(c,c);let u=h.fromElements(0,0,0,aye),f=N.computeView(u,s,a,c,jmt),d=N.multiply(f,o,G0),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,fye),g=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,dye);for(let S=0;S<8;++S){let w=se.clone(vm[S],CY[S]);N.multiplyByVector(d,w,w),h.divideByScalar(w,w.w,w),h.minimumByComponent(w,p,p),h.maximumByComponent(w,g,g)}g.z+=1e3,p.z-=10;let m=aye;m.x=-(.5*(p.x+g.x)),m.y=-(.5*(p.y+g.y)),m.z=-g.z;let x=N.fromTranslation(m,G0);f=N.multiply(x,f,f);let C=.5*(g.x-p.x),A=.5*(g.y-p.y),b=g.z-p.z,T=n.frustum;T.left=-C,T.right=C,T.bottom=-A,T.top=A,T.near=.01,T.far=b,N.clone(f,n.viewMatrix),N.inverse(f,n.inverseViewMatrix),N.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),h.clone(s,n.directionWC),h.clone(a,n.upWC),h.clone(c,n.rightWC)}var Kmt=[new h(-1,0,0),new h(0,-1,0),new h(0,0,-1),new h(1,0,0),new h(0,1,0),new h(0,0,1)],$mt=[new h(0,-1,0),new h(0,0,-1),new h(0,-1,0),new h(0,-1,0),new h(0,0,1),new h(0,-1,0)],Zmt=[new h(0,0,1),new h(1,0,0),new h(-1,0,0),new h(0,0,-1),new h(1,0,0),new h(1,0,0)];function Jmt(e,t){let n=new bi;n.fov=M.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let r=e._passes[i].camera;r.positionWC=e._shadowMapCamera.positionWC,r.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(r.positionWC,r.positionCartographic),r.directionWC=Kmt[i],r.upWC=$mt[i],r.rightWC=Zmt[i],N.computeView(r.positionWC,r.directionWC,r.upWC,r.rightWC,r.viewMatrix),N.inverse(r.viewMatrix,r.inverseViewMatrix),r.frustum=n}}var Qmt=new h,ept=new h,hye=new re,cye=hye.center;function tpt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,r=hye;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let o=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,Qmt),s=h.negate(i.directionWC,ept),a=h.dot(o,s);if(e.fadingEnabled){let c=M.clamp(a/.1,0,1);e._darkness=M.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)r.center=i.positionWC,r.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(r)===Jt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),re.clone(r,e._boundingSphere);else{let o=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,o,cye),cye);r.center=s,r.radius=o,e._outOfView=t.cullingVolume.computeVisibility(r)===Jt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),re.clone(r,e._boundingSphere)}}function npt(e,t){let n=t.camera,i=e._lightCamera,r=e._sceneCamera,o=e._shadowMapCamera;e._cascadesEnabled?h.clone(i.directionWC,o.directionWC):e._isPointLight?h.clone(i.positionWC,o.positionWC):o.clone(i);let s=e._lightDirectionEC;N.multiplyByPointAsVector(n.viewMatrix,o.directionWC,s),h.normalize(s,s),h.negate(s,s),N.multiplyByPoint(n.viewMatrix,o.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=_r.clone(n,r),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,tpt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}wm.prototype.update=function(e){if(npt(this,e),this._needsUpdate)if(Omt(this,e.context),this._isPointLight&&Jmt(this,e),this._cascadesEnabled&&(Xmt(this,e),this._numberOfCascades>1&&Wmt(this,e)),this._isPointLight)this._shadowMapCullingVolume=da.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,r=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,r),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;N.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&kmt(this,e)};wm.prototype.updatePass=function(e,t){uye(this,e,t)};var ipt=new W;function mye(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,r={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let o=ipt;return o.x=1/e._textureSize.x,o.y=1/e._textureSize.y,se.fromElements(o.x,o.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return se.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new se,combinedUniforms2:new se};return rt(t,r,!1)}function rpt(e,t,n,i,r,o){let s,a,c;if(l(o)&&(s=o.shaderProgram,a=o.renderState,c=o.uniformMap),o=Ze.shallowClone(n,o),o.castShadows=!0,o.receiveShadows=!1,!l(s)||r!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===Ce.GLOBE,d=n.pass!==Ce.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,m=c_.getShadowCastShaderKeyword(p,f,g,d);if(s=i.shaderCache.getDerivedShaderProgram(u,m),!l(s)){let C=u.vertexShaderSource,A=u.fragmentShaderSource,b=c_.createShadowCastVertexShader(C,p,f),T=c_.createShadowCastFragmentShader(A,p,g,d);s=i.shaderCache.createDerivedShaderProgram(u,m,{vertexShaderSource:b,fragmentShaderSource:T,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=$e(a,!1),a.cull=$e(a.cull,!1),a.cull.enabled=!1,a=Ve.fromCache(a)),c=mye(e,n.uniformMap,f)}return o.shaderProgram=s,o.renderState=a,o.uniformMap=c,o}wm.createReceiveDerivedCommand=function(e,t,n,i,r){l(r)||(r={});let o=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,u=t.pass===Ce.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&o){let d,p;l(r.receiveCommand)&&(d=r.receiveCommand.shaderProgram,p=r.receiveCommand.uniformMap),r.receiveCommand=Ze.shallowClone(t,r.receiveCommand),r.castShadows=!1,r.receiveShadows=!0;let g=r.receiveShaderCastShadows!==t.castShadows,m=r.receiveShaderProgramId!==t.shaderProgram.id;if(!l(d)||m||n||g){let x=c_.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(s,x),!l(d)){let C=c_.createShadowReceiveVertexShader(a,u,f),A=c_.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(s,x,{vertexShaderSource:C,fragmentShaderSource:A,attributeLocations:s._attributeLocations})}p=mye(e[0],t.uniformMap,u)}r.receiveCommand.shaderProgram=d,r.receiveCommand.uniformMap=p,r.receiveShaderProgramId=t.shaderProgram.id,r.receiveShaderCastShadows=t.castShadows}return r};wm.createCastDerivedCommand=function(e,t,n,i,r){if(l(r)||(r={}),t.castShadows){let o=r.castCommands;l(o)||(o=r.castCommands=[]);let s=r.castShaderProgramId,a=e.length;o.length=a;for(let c=0;c<a;++c)o[c]=rpt(e[c],n,t,i,s,o[c]);r.castShaderProgramId=t.shaderProgram.id}return r};wm.prototype.isDestroyed=function(){return!1};wm.prototype.destroy=function(){xY(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return ue(this)};var W0=wm;var u4=`uniform sampler2D u_opaqueDepthTexture;
- uniform sampler2D u_translucentDepthTexture;
- varying vec2 v_textureCoordinates;
- void main()
- {
- float opaqueDepth = texture2D(u_opaqueDepthTexture, v_textureCoordinates).r;
- float translucentDepth = texture2D(u_translucentDepthTexture, v_textureCoordinates).r;
- translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth);
- gl_FragColor = czm_packDepth(translucentDepth);
- }
- `;var kE=`uniform sampler2D colorTexture;
- #ifdef DEBUG_SHOW_DEPTH
- uniform sampler2D u_packedTranslucentDepth;
- #endif
- varying vec2 v_textureCoordinates;
- void main()
- {
- #ifdef DEBUG_SHOW_DEPTH
- if (v_textureCoordinates.x < 0.5)
- {
- gl_FragColor.rgb = vec3(czm_unpackDepth(texture2D(u_packedTranslucentDepth, v_textureCoordinates)));
- gl_FragColor.a = 1.0;
- }
- #else
- vec4 color = texture2D(colorTexture, v_textureCoordinates);
- #ifdef PICK
- if (color == vec4(0.0))
- {
- discard;
- }
- #else
- color.rgb /= color.a;
- #endif
- gl_FragColor = color;
- #endif
- }
- `;var opt=!1;function j0(e){this._drawClassificationFBO=new pi({createDepthAttachments:!1}),this._accumulationFBO=new pi({createDepthAttachments:!1}),this._packFBO=new pi,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new li({color:new z(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new li({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new je,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(j0.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function pye(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function _ye(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function spt(e,t,n,i){pye(e),e._translucentDepthStencilTexture=new wt({context:t,width:n,height:i,pixelFormat:ct.DEPTH_STENCIL,pixelDatatype:qe.UNSIGNED_INT_24_8,sampler:on.NEAREST})}function apt(e,t,n,i){_ye(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function cpt(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let r=e._opaqueDepthStencilTexture.width,o=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(r,o)&&(spt(e,t,r,o),apt(e,t,r,o));let s,a;if(l(e._packDepthCommand)||(s=new Fe({sources:[u4]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new Fe({sources:[kE]}),a={colorTexture:function(){return e._textureToComposite}},opt&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,d=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(d,"pick",{vertexShaderSource:d.vertexShaderSource,fragmentShaderSource:new Fe({sources:s.sources,defines:["PICK"]}),attributeLocations:d._attributeLocations}),g=Ze.shallowClone(f);g.shaderProgram=p,f.derivedCommands.pick=g}l(e._copyCommand)||(s=new Fe({sources:[kE]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Fe({sources:[kE]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=r,e._viewport.height=o;let c=!je.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,je.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=je.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!je.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!je.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:yi.EQUAL,reference:tn.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!je.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:hn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}j0.prototype.executeTranslucentCommands=function(e,t,n,i,r){let o=i.length,s,a,c=e.frameState.useLogDepth,u=e.context,f=n.framebuffer;for(a=0;a<o;++a)if(s=i[a],s=c?s.derivedCommands.logDepth.command:s,s.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}if(!!this._hasTranslucentDepth){for(cpt(this,u,n,r),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(u,n),a=0;a<o;++a){if(s=i[a],s=c?s.derivedCommands.logDepth.command:s,!s.depthForTranslucentClassification)continue;let d=s.derivedCommands.depth.depthOnlyCommand;t(d,e,u,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(u,n)),n.framebuffer=f}};j0.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let r=e.context,o=r.uniformState,s=n.framebuffer;this._frustumsDrawn===2&&(n.framebuffer=this._accumulationFBO.framebuffer,this._copyCommand.execute(r,n)),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(r,n),o.updatePass(Ce.CESIUM_3D_TILE_CLASSIFICATION);let a=o.globeDepthTexture;o.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Ce.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[Ce.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,r,n);o.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(r,n),n.framebuffer=s)};j0.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),lpt(this,e,t)};function lpt(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}j0.prototype.isSupported=function(){return this._supported};j0.prototype.isDestroyed=function(){return!1};j0.prototype.destroy=function(){return pye(this),_ye(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),ue(this)};var f4=j0;function upt(){this.command=void 0,this.near=void 0,this.far=void 0}function d4(e,t,n){let i=e.context,r;i.depthTexture&&(r=new YU);let o;e._useOIT&&i.depthTexture&&(o=new n4(i));let s=new Hc(i);s.viewport=je.clone(n),this.camera=t,this._cameraClone=_r.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new c4(i),this.pickDepthFramebuffer=new a4,this.sceneFramebuffer=new VE,this.globeDepth=r,this.globeTranslucencyFramebuffer=new XU,this.oit=o,this.translucentTileClassification=new f4(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var gye=new h,yye=new h;function fpt(e,t){let n=Math.max(Math.abs(e.x),Math.abs(t.x)),i=Math.max(Math.abs(e.y),Math.abs(t.y)),r=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(n,i),r)}function dpt(e,t,n){let i=1/Math.max(1,fpt(e.position,t.position));return h.multiplyByScalar(e.position,i,gye),h.multiplyByScalar(t.position,i,yye),h.equalsEpsilon(gye,yye,n)&&h.equalsEpsilon(e.direction,t.direction,n)&&h.equalsEpsilon(e.up,t.up,n)&&h.equalsEpsilon(e.right,t.right,n)&&N.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}d4.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return dpt(t,n,M.EPSILON15)?(this._cameraStartFired&&Bi()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Bi(),_r.clone(t,n),!0)};function hpt(e,t,n,i){let r=t.frameState,o=r.camera,s=r.useLogDepth?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,a=t.mode===te.SCENE2D,c=t.nearToFarDistance2D;i*=1+M.EPSILON2,n=Math.min(Math.max(n,o.frustum.near),o.frustum.far),i=Math.max(Math.min(i,o.frustum.far),n),isNaN(n)&&(n=o.frustum.near),isNaN(i)&&(i=o.frustum.far);let u;a?(i=Math.min(i,o.position.z+t.nearToFarDistance2D),n=Math.min(n,i),u=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):u=Math.ceil(Math.log(i/n)/Math.log(s));let f=e.frustumCommandsList;f.length=u;for(let d=0;d<u;++d){let p,g;a?(p=Math.min(i-c,n+d*c),g=Math.min(i,p+c)):(p=Math.max(n,Math.pow(s,d)*n),g=Math.min(i,s*p));let m=f[d];l(m)?(m.near=p,m.far=g):m=f[d]=new yU(p,g)}}function mpt(e,t,n,i,r){t.debugShowFrustums&&(n.debugOverlappingFrustums=0);let o=e.frustumCommandsList,s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.near,f=c.far;if(i>f)continue;if(r<u)break;let d=n.pass,p=c.indices[d]++;if(c.commands[d][p]=n,t.debugShowFrustums&&(n.debugOverlappingFrustums|=1<<a),n.executeInClosestFrustum)break}if(t.debugShowFrustums){let a=e.debugFrustumStatistics.commandsInFrustums;a[n.debugOverlappingFrustums]=l(a[n.debugOverlappingFrustums])?a[n.debugOverlappingFrustums]+1:1,++e.debugFrustumStatistics.totalCommands}t.updateDerivedCommands(n)}var xye=new da,ppt=new $c;d4.prototype.createPotentiallyVisibleSet=function(e){let t=e.frameState,n=t.camera,i=n.directionWC,r=n.positionWC,o=e._computeCommandList,s=e._overlayCommandList,a=t.commandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let c=this.frustumCommandsList,u=c.length,f=Ce.NUMBER_OF_PASSES;for(let E=0;E<u;++E)for(let v=0;v<f;++v)c[E].indices[v]=0;o.length=0,s.length=0;let d=this._commandExtents,p=d.length,g=0,m=+Number.MAX_VALUE,x=-Number.MAX_VALUE,C=t.shadowState.shadowsEnabled,A=+Number.MAX_VALUE,b=-Number.MAX_VALUE,T=Number.MAX_VALUE,S=t.mode===te.SCENE3D?t.occluder:void 0,w=t.cullingVolume,D=xye.planes;for(let E=0;E<5;++E)D[E]=w.planes[E];w=xye;let I=a.length;for(let E=0;E<I;++E){let v=a[E],P=v.pass;if(P===Ce.COMPUTE)o.push(v);else if(P===Ce.OVERLAY)s.push(v);else{let R,F,U=v.boundingVolume;if(l(U)){if(!e.isVisible(v,w,S))continue;let H=U.computePlaneDistances(r,i,ppt);if(R=H.start,F=H.stop,m=Math.min(m,R),x=Math.max(x,F),C&&v.receiveShadows&&R<W0.MAXIMUM_DISTANCE&&!(P===Ce.GLOBE&&R<-100&&F>100)){let V=F-R;P!==Ce.GLOBE&&R<100&&(T=Math.min(T,V)),A=Math.min(A,R),b=Math.max(b,F)}}else v instanceof li?(R=n.frustum.near,F=n.frustum.far):(R=n.frustum.near,F=n.frustum.far,m=Math.min(m,R),x=Math.max(x,F));let k=d[g];l(k)||(k=d[g]=new upt),k.command=v,k.near=R,k.far=F,g++}}C&&(A=Math.min(Math.max(A,n.frustum.near),n.frustum.far),b=Math.max(Math.min(b,n.frustum.far),A)),C&&(t.shadowState.nearPlane=A,t.shadowState.farPlane=b,t.shadowState.closestObjectSize=T),hpt(this,e,m,x);let O,B;for(O=0;O<g;O++)B=d[O],mpt(this,e,B.command,B.near,B.far);if(g<p)for(O=g;O<p&&(B=d[O],!!l(B.command));O++)B.command=void 0;let L=c.length,_=t.frustumSplits;_.length=L+1;for(let E=0;E<L;++E)_[E]=c[E].near,E===L-1&&(_[E+1]=c[E].far)};d4.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e,t=this.pickDepths,n=t.length;for(e=0;e<n;++e)t[e].destroy()};var UE=d4;var Aye=.1,_pt=new Kd({pass:mo.MOST_DETAILED_PRELOAD}),gpt=new Kd({pass:mo.MOST_DETAILED_PICK}),AY=new Kd({pass:mo.PICK});function va(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new je(0,0,1,1),n=new _r(e);n.frustum=new en({width:Aye,aspectRatio:1,near:.1}),this._pickOffscreenView=new UE(e,n,t)}va.prototype.update=function(){this._pickPositionCacheDirty=!0};va.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new s4,n[t]=i),i};var ypt=new Xo,xpt=new h,h4=new h,Cpt=new W,Apt=new N;function Tpt(e,t,n,i,r){let o=e.camera,s=o.frustum;l(s._offCenterFrustum)&&(s=s._offCenterFrustum);let a=2*(t.x-r.x)/r.width-1;a*=(s.right-s.left)*.5;let c=2*(r.height-t.y-r.y)/r.height-1;c*=(s.top-s.bottom)*.5;let u=N.clone(o.transform,Apt);o._setTransform(N.IDENTITY);let f=h.clone(o.position,xpt);h.multiplyByScalar(o.right,a,h4),h.add(h4,f,f),h.multiplyByScalar(o.up,c,h4),h.add(h4,f,f),o._setTransform(u),e.mode===te.SCENE2D&&h.fromElements(f.z,f.x,f.y,f);let d=s.getPixelDimensions(r.width,r.height,1,1,Cpt),p=ypt;return p.right=d.x*.5,p.left=-p.right,p.top=d.y*.5,p.bottom=-p.top,p.near=s.near,p.far=s.far,p.computeCullingVolume(f,o.directionWC,o.upWC)}var bpt=new cl,Ept=new W;function Spt(e,t,n,i,r){let o=e.camera,s=o.frustum,a=s.near,c=Math.tan(s.fovy*.5),u=s.aspectRatio*c,f=2*(t.x-r.x)/r.width-1,d=2*(r.height-t.y-r.y)/r.height-1,p=f*a*u,g=d*a*c,m=s.getPixelDimensions(r.width,r.height,1,1,Ept),x=m.x*n*.5,C=m.y*i*.5,A=bpt;return A.top=g+C,A.bottom=g-C,A.right=p+x,A.left=p-x,A.near=a,A.far=s.far,A.computeCullingVolume(o.positionWC,o.directionWC,o.upWC)}function Tye(e,t,n,i,r){let o=e.camera.frustum;return o instanceof en||o instanceof Xo?Tpt(e,t,n,i,r):Spt(e,t,n,i,r)}var zE=3,L1=3,Dm=new je(0,0,zE,L1),bye=new W,TY=new z(0,0,0,0);va.prototype.pick=function(e,t,n,i){zE=y(n,3),L1=y(i,zE);let r=e.context,o=r.uniformState,s=e.frameState,a=e.defaultView;e.view=a;let c=a.viewport;c.x=0,c.y=0,c.width=r.drawingBufferWidth,c.height=r.drawingBufferHeight;let u=a.passState;u.viewport=je.clone(c,u.viewport);let f=rr.transformWindowToDrawingBuffer(e,t,bye);e.jobScheduler.disableThisFrame(),e.updateFrameState(),s.cullingVolume=Tye(e,f,zE,L1,c),s.invertClassification=!1,s.passes.pick=!0,s.tilesetPassState=AY,o.update(s),e.updateEnvironment(),Dm.x=f.x-(zE-1)*.5,Dm.y=e.drawingBufferHeight-f.y-(L1-1)*.5,Dm.width=zE,Dm.height=L1,u=a.pickFramebuffer.begin(Dm,a.viewport),e.updateAndExecuteCommands(u,TY),e.resolveFramebuffers(u);let d=a.pickFramebuffer.end(Dm);return r.endFrame(),d};function wpt(e,t){let n=e.context,i=e.frameState,r=e.environmentState,o=e.defaultView;e.view=o;let s=o.viewport;s.x=0,s.y=0,s.width=n.drawingBufferWidth,s.height=n.drawingBufferHeight;let a=o.passState;a.viewport=je.clone(s,a.viewport),e.clearPasses(i.passes),i.passes.pick=!0,i.passes.depth=!0,i.cullingVolume=Tye(e,t,1,1,s),i.tilesetPassState=AY,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,a=o.pickDepthFramebuffer.update(n,t,s),e.updateAndExecuteCommands(a,TY),e.resolveFramebuffers(a),n.endFrame()}var vpt=new bi,Dpt=new cl,Ppt=new en,Ipt=new Xo;va.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return h.clone(this._pickPositionCache[i],n);let r=e.frameState,o=e.context,s=o.uniformState,a=e.defaultView;e.view=a;let c=rr.transformWindowToDrawingBuffer(e,t,bye);e.pickTranslucentDepth?wpt(e,c):(e.updateFrameState(),s.update(r),e.updateEnvironment()),c.y=e.drawingBufferHeight-c.y;let u=e.camera,f;l(u.frustum.fov)?f=u.frustum.clone(vpt):l(u.frustum.infiniteProjectionMatrix)?f=u.frustum.clone(Dpt):l(u.frustum.width)?f=u.frustum.clone(Ppt):f=u.frustum.clone(Ipt);let d=a.frustumCommandsList,p=d.length;for(let g=0;g<p;++g){let x=this.getPickDepth(e,g).getDepth(o,c.x,c.y);if(!!l(x)&&x>0&&x<1){let C=d[g],A;return e.mode===te.SCENE2D?(A=u.position.z,u.position.z=A-C.near+1,f.far=Math.max(1,C.far-C.near),f.near=1,s.update(r),s.updateFrustum(f)):(f.near=C.near*(g!==0?e.opaqueFrustumNearOffset:1),f.far=C.far,s.updateFrustum(f)),n=rr.drawingBufferToWgs84Coordinates(e,c,x,n),e.mode===te.SCENE2D&&(u.position.z=A,s.update(r)),this._pickPositionCache[i]=h.clone(n),n}}this._pickPositionCache[i]=void 0};var Opt=new me;va.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==te.SCENE3D){h.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,r=i.ellipsoid,o=i.unproject(n,Opt);r.cartographicToCartesian(o,n)}return n};function Eye(e,t){let n,i,r=[],o=[],s=[],a=[];l(e)||(e=Number.MAX_VALUE);let c=t();for(;l(c);){let u=c.object,f=c.position,d=c.exclude;if(l(f)&&!l(u)){r.push(c);break}if(!l(u)||!l(u.primitive)||!d&&(r.push(c),0>=--e))break;let p=u.primitive,g=!1;typeof p.getGeometryInstanceAttributes=="function"&&l(u.id)&&(i=p.getGeometryInstanceAttributes(u.id),l(i)&&l(i.show)&&(g=!0,i.show=gn.toValue(!1,i.show),s.push(i))),u instanceof bo&&(g=!0,u.show=!1,a.push(u)),g||(p.show=!1,o.push(p)),c=t()}for(n=0;n<o.length;++n)o[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=gn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return r}va.prototype.drillPick=function(e,t,n,i,r){let o=this;return Eye(n,function(){let c=o.pick(e,t,i,r);if(l(c))return{object:c,position:void 0,exclude:!1}}).map(function(c){return c.object})};var Cye=new h,Rpt=new h;function Mpt(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(r=>{i._completePick=()=>{r()}})}function Sye(e,t,n,i){let r=t.direction,o=h.mostOrthogonalAxis(r,Cye),s=h.cross(r,o,Cye),a=h.cross(r,s,Rpt);return i.position=t.origin,i.direction=r,i.up=a,i.right=s,i.frustum.width=y(n,Aye),i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function Bpt(e,t,n){let i=t.frameState,r=n.ray,o=n.width,s=n.tilesets,a=e._pickOffscreenView.camera,c=Sye(e,r,o,a),u=_pt;u.camera=a,u.cullingVolume=c;let f=!0,d=s.length;for(let p=0;p<d;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}va.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)Bpt(this,e,t[n])&&t.splice(n--,1)};function wye(e,t,n){let i=e.length;for(let r=0;r<i;++r){let o=e.get(r);o.show&&(l(o.isCesium3DTileset)?(!l(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof du&&wye(o,t,n))}}function m4(e,t,n,i,r,o){let s=[];if(wye(t.primitives,i,s),s.length===0)return Promise.resolve(o());let a=new Mpt(n,r,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return o()})}function Lpt(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function Npt(e,t,n,i,r,o,s){let a=t.context,c=a.uniformState,u=t.frameState,f=e._pickOffscreenView;t.view=f,Sye(e,n,r,f.camera),Dm=je.clone(f.viewport,Dm);let d=f.pickFramebuffer.begin(Dm,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),u.invertClassification=!1,u.passes.pick=!0,u.passes.offscreen=!0,s?u.tilesetPassState=gpt:u.tilesetPassState=AY,c.update(u),t.updateEnvironment(),t.updateAndExecuteCommands(d,TY),t.resolveFramebuffers(d);let p,g=f.pickFramebuffer.end(Dm);if(t.context.depthTexture){let m=f.frustumCommandsList.length;for(let x=0;x<m;++x){let A=e.getPickDepth(t,x).getDepth(a,0,0);if(!!l(A)&&A>0&&A<1){let b=f.frustumCommandsList[x],T=b.near*(x!==0?t.opaqueFrustumNearOffset:1),S=b.far,w=T+A*(S-T);p=En.getPoint(n,w);break}}}if(t.view=t.defaultView,a.endFrame(),l(g)||l(p))return{object:g,position:p,exclude:!l(p)&&o||Lpt(g,i)}}function vye(e,t,n,i,r,o,s,a){return Eye(i,function(){return Npt(e,t,n,r,o,s,a)})}function HE(e,t,n,i,r,o,s){let a=vye(e,t,n,1,i,r,o,s);if(a.length>0)return a[0]}function Dye(e,t,n,i,r,o,s,a){return vye(e,t,n,i,r,o,s,a)}function p4(e,t){return new Promise((n,i)=>{t.then(function(r){let o=e.postRender.addEventListener(function(){o(),n(r)});e.requestRender()}).catch(function(r){i(r)})})}va.prototype.pickFromRay=function(e,t,n,i){return HE(this,e,t,n,i,!1,!1)};va.prototype.drillPickFromRay=function(e,t,n,i,r){return Dye(this,e,t,n,i,r,!1,!1)};va.prototype.pickFromRayMostDetailed=function(e,t,n,i){let r=this;return t=En.clone(t),n=l(n)?n.slice():n,p4(e,m4(r,e,t,n,i,function(){return HE(r,e,t,n,i,!1,!0)}))};va.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,r){let o=this;return t=En.clone(t),i=l(i)?i.slice():i,p4(e,m4(o,e,t,i,r,function(){return Dye(o,e,t,n,i,r,!1,!0)}))};var Fpt=new h,Vpt=new h,kpt=new En,Pye=new me;function bY(e,t){let n=e.globe,i=l(n)?n.ellipsoid:e.mapProjection.ellipsoid,r=fi._defaultMaxTerrainHeight,o=i.geodeticSurfaceNormalCartographic(t,Vpt),s=me.toCartesian(t,i,Fpt),a=kpt;a.origin=s,a.direction=o;let c=new En;return En.getPoint(a,r,c.origin),h.negate(o,c.direction),c}function Iye(e,t){let n=e.globe,i=l(n)?n.ellipsoid:e.mapProjection.ellipsoid,r=me.fromCartesian(t,i,Pye);return bY(e,r)}function Oye(e,t){let n=e.globe,i=l(n)?n.ellipsoid:e.mapProjection.ellipsoid;return me.fromCartesian(t,i,Pye).height}function Upt(e,t,n,i,r){let o=bY(t,n);return m4(e,t,o,i,r,function(){let s=HE(e,t,o,i,r,!0,!0);if(l(s))return Oye(t,s.position)})}function zpt(e,t,n,i,r,o){let s=Iye(t,n);return m4(e,t,s,i,r,function(){let a=HE(e,t,s,i,r,!0,!0);if(l(a))return h.clone(a.position,o)})}va.prototype.sampleHeight=function(e,t,n,i){let r=bY(e,t),o=HE(this,e,r,n,i,!0,!1);if(l(o))return Oye(e,o.position)};va.prototype.clampToHeight=function(e,t,n,i,r){let o=Iye(e,t),s=HE(this,e,o,n,i,!0,!1);if(l(s))return h.clone(s.position,r)};va.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let r=t.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=Upt(this,e,t[s],n,i);return p4(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};va.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let r=t.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=zpt(this,e,t[s],n,i,t[s]);return p4(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};va.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var _4=va;var Hpt={NEAREST:0,LINEAR:1},kf=Hpt;function yC(e){e=y(e,y.EMPTY_OBJECT);let t=e.fragmentShader,n=y(e.textureScale,1),i=y(e.pixelFormat,ct.RGBA);this._fragmentShader=t,this._uniforms=e.uniforms,this._textureScale=n,this._forcePowerOfTwo=y(e.forcePowerOfTwo,!1),this._sampleMode=y(e.sampleMode,kf.NEAREST),this._pixelFormat=i,this._pixelDatatype=y(e.pixelDatatype,qe.UNSIGNED_BYTE),this._clearColor=y(e.clearColor,z.BLACK),this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let r=new Hc;r.scissorTest={enabled:!0,rectangle:l(e.scissorRectangle)?je.clone(e.scissorRectangle):new je},this._passState=r,this._ready=!1;let o=e.name;l(o)||(o=Ln()),this._name=o,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(yC.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var Gpt=/uniform\s+sampler2D\s+depthTexture/g;yC.prototype._isSupported=function(e){return!Gpt.test(this._fragmentShader)||e.depthTexture};function Wpt(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(r){let o=t[n];t[n]=r;let s=e._actualUniforms,a=s[n];l(a)&&a!==o&&a instanceof wt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),o instanceof wt&&e._texturesToRelease.push(o),typeof r=="string"||r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof HTMLVideoElement||r instanceof ImageData?e._dirtyUniforms.push(n):s[n]=r}}}function jpt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function qpt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function Ypt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,r=e._actualUniforms;for(let o in i)if(i.hasOwnProperty(o)){typeof i[o]!="function"?(t[o]=jpt(e,o),n[o]=Wpt(e,i,o)):(t[o]=i[o],n[o]=i[o]),r[o]=i[o];let s=t[o]();(typeof s=="string"||s instanceof wt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${o}Dimensions`]=qpt(t,o))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=rt(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function Xpt(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let r=e._selectedIdTexture.width;n=n.replace(/varying\s+vec2\s+v_textureCoordinates;/g,""),n=`#define CZM_SELECTED_FEATURE
- uniform sampler2D czm_idTexture;
- uniform sampler2D czm_selectedIdTexture;
- uniform float czm_selectedIdTextureStep;
- varying vec2 v_textureCoordinates;
- bool czm_selected(vec2 offset)
- {
- bool selected = false;
- vec4 id = texture2D(czm_idTexture, v_textureCoordinates + offset);
- for (int i = 0; i < ${r}; ++i)
- {
- vec4 selectedId = texture2D(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5));
- if (all(equal(id, selectedId)))
- {
- return true;
- }
- }
- return false;
- }
- bool czm_selected()
- {
- return czm_selected(vec2(0.0));
- }
- ${n}`}let i=new Fe({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function Kpt(e){let t=e._sampleMode,n,i;t===kf.LINEAR?(n=It.LINEAR,i=Xi.LINEAR):(n=It.NEAREST,i=Xi.NEAREST);let r=e._sampler;(!l(r)||r.minificationFilter!==n||r.magnificationFilter!==i)&&(e._sampler=new on({wrapS:mn.CLAMP_TO_EDGE,wrapT:mn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function $pt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function Zpt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function Jpt(e,t){let n,i,r,o=e._texturesToRelease,s=o.length;for(n=0;n<s;++n)i=o[n],i=i&&i.destroy();o.length=0;let a=e._texturesToCreate;for(s=a.length,n=0;n<s;++n){let d=a[n];r=d.name;let p=d.source;e._actualUniforms[r]=new wt({context:t,source:p})}a.length=0;let c=e._dirtyUniforms;if(c.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(c.length===0||l(e._texturePromise))return;s=c.length;let u=e._uniforms,f=[];for(n=0;n<s;++n){r=c[n];let d=u[r],p=e._textureCache.getStageByName(d);if(l(p))e._actualUniforms[r]=Zpt(e,d);else if(typeof d=="string"){let g=new De({url:d});f.push(g.fetchImage().then($pt(e,r)))}else e._texturesToCreate.push({name:r,source:d})}c.length=0,f.length>0?(e._ready=!1,e._texturePromise=Promise.all(f).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function Rye(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let r in i)i.hasOwnProperty(r)&&i[r]instanceof wt&&(l(t.getStageByName(n[r]))||i[r].destroy(),e._dirtyUniforms.push(r))}function Qpt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let r=0;r<t;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}function e_t(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i,r,o=0,s=n.length;for(i=0;i<s;++i)r=n[i],l(r.pickIds)?o+=r.pickIds.length:l(r.pickId)&&++o;if(s===0||o===0){let f=new Uint8Array(4);f[0]=255,f[1]=255,f[2]=255,f[3]=255,e._selectedIdTexture=new wt({context:t,pixelFormat:ct.RGBA,pixelDatatype:qe.UNSIGNED_BYTE,source:{arrayBufferView:f,width:1,height:1},sampler:on.NEAREST});return}let a,c=0,u=new Uint8Array(o*4);for(i=0;i<s;++i)if(r=n[i],l(r.pickIds)){let f=r.pickIds,d=f.length;for(let p=0;p<d;++p)a=f[p].color,u[c]=z.floatToByte(a.red),u[c+1]=z.floatToByte(a.green),u[c+2]=z.floatToByte(a.blue),u[c+3]=z.floatToByte(a.alpha),c+=4}else l(r.pickId)&&(a=r.pickId.color,u[c]=z.floatToByte(a.red),u[c+1]=z.floatToByte(a.green),u[c+2]=z.floatToByte(a.blue),u[c+3]=z.floatToByte(a.alpha),c+=4);e._selectedIdTexture=new wt({context:t,pixelFormat:ct.RGBA,pixelDatatype:qe.UNSIGNED_BYTE,source:{arrayBufferView:u,width:o,height:1},sampler:on.NEAREST})}yC.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&Rye(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=Qpt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,e_t(this,e),Ypt(this),Jpt(this,e),Xpt(this,e),Kpt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),r;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(r=this._renderState,(!l(r)||i.width!==r.viewport.width||i.height!==r.viewport.height)&&(this._renderState=Ve.fromCache({viewport:new je(0,0,i.width,i.height)}))),this._command.renderState=r};yC.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,on.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let r=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(r)&&(r.context=e),this._command.execute(e,r)};yC.prototype.isDestroyed=function(){return!1};yC.prototype.destroy=function(){return Rye(this),ue(this)};var Sr=yC;var g4=`uniform sampler2D colorTexture;
- varying vec2 v_textureCoordinates;
- #ifdef AUTO_EXPOSURE
- uniform sampler2D autoExposure;
- #endif
- void main()
- {
- vec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);
- vec3 color = fragmentColor.rgb;
- #ifdef AUTO_EXPOSURE
- color /= texture2D(autoExposure, vec2(0.5)).r;
- #endif
- color = czm_acesTonemapping(color);
- color = czm_inverseGamma(color);
- gl_FragColor = vec4(color, fragmentColor.a);
- }
- `;var y4=`uniform sampler2D randomTexture;
- uniform sampler2D depthTexture;
- uniform float intensity;
- uniform float bias;
- uniform float lengthCap;
- uniform float stepSize;
- uniform float frustumLength;
- varying vec2 v_textureCoordinates;
- vec4 clipToEye(vec2 uv, float depth)
- {
- vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));
- vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0);
- posEC = posEC / posEC.w;
- return posEC;
- }
- vec3 getNormalXEdge(vec3 posInCamera, float depthU, float depthD, float depthL, float depthR, vec2 pixelSize)
- {
- vec4 posInCameraUp = clipToEye(v_textureCoordinates - vec2(0.0, pixelSize.y), depthU);
- vec4 posInCameraDown = clipToEye(v_textureCoordinates + vec2(0.0, pixelSize.y), depthD);
- vec4 posInCameraLeft = clipToEye(v_textureCoordinates - vec2(pixelSize.x, 0.0), depthL);
- vec4 posInCameraRight = clipToEye(v_textureCoordinates + vec2(pixelSize.x, 0.0), depthR);
- vec3 up = posInCamera.xyz - posInCameraUp.xyz;
- vec3 down = posInCameraDown.xyz - posInCamera.xyz;
- vec3 left = posInCamera.xyz - posInCameraLeft.xyz;
- vec3 right = posInCameraRight.xyz - posInCamera.xyz;
- vec3 DX = length(left) < length(right) ? left : right;
- vec3 DY = length(up) < length(down) ? up : down;
- return normalize(cross(DY, DX));
- }
- void main(void)
- {
- float depth = czm_readDepth(depthTexture, v_textureCoordinates);
- vec4 posInCamera = clipToEye(v_textureCoordinates, depth);
- if (posInCamera.z > frustumLength)
- {
- gl_FragColor = vec4(1.0);
- return;
- }
- vec2 pixelSize = czm_pixelRatio / czm_viewport.zw;
- float depthU = czm_readDepth(depthTexture, v_textureCoordinates - vec2(0.0, pixelSize.y));
- float depthD = czm_readDepth(depthTexture, v_textureCoordinates + vec2(0.0, pixelSize.y));
- float depthL = czm_readDepth(depthTexture, v_textureCoordinates - vec2(pixelSize.x, 0.0));
- float depthR = czm_readDepth(depthTexture, v_textureCoordinates + vec2(pixelSize.x, 0.0));
- vec3 normalInCamera = getNormalXEdge(posInCamera.xyz, depthU, depthD, depthL, depthR, pixelSize);
- float ao = 0.0;
- vec2 sampleDirection = vec2(1.0, 0.0);
- float gapAngle = 90.0 * czm_radiansPerDegree;
- float randomVal = texture2D(randomTexture, v_textureCoordinates).x;
- for (int i = 0; i < 4; i++)
- {
- float newGapAngle = gapAngle * (float(i) + randomVal);
- float cosVal = cos(newGapAngle);
- float sinVal = sin(newGapAngle);
- vec2 rotatedSampleDirection = vec2(cosVal * sampleDirection.x - sinVal * sampleDirection.y, sinVal * sampleDirection.x + cosVal * sampleDirection.y);
- float localAO = 0.0;
- float localStepSize = stepSize;
- for (int j = 0; j < 6; j++)
- {
- vec2 newCoords = v_textureCoordinates + rotatedSampleDirection * localStepSize * pixelSize;
- if(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0)
- {
- break;
- }
- float stepDepthInfo = czm_readDepth(depthTexture, newCoords);
- vec4 stepPosInCamera = clipToEye(newCoords, stepDepthInfo);
- vec3 diffVec = stepPosInCamera.xyz - posInCamera.xyz;
- float len = length(diffVec);
- if (len > lengthCap)
- {
- break;
- }
- float dotVal = clamp(dot(normalInCamera, normalize(diffVec)), 0.0, 1.0 );
- float weight = len / lengthCap;
- weight = 1.0 - weight * weight;
- if (dotVal < bias)
- {
- dotVal = 0.0;
- }
- localAO = max(localAO, dotVal * weight);
- localStepSize += stepSize;
- }
- ao += localAO;
- }
- ao /= 4.0;
- ao = 1.0 - clamp(ao, 0.0, 1.0);
- ao = pow(ao, intensity);
- gl_FragColor = vec4(vec3(ao), 1.0);
- }
- `;var x4=`uniform sampler2D colorTexture;
- uniform sampler2D ambientOcclusionTexture;
- uniform bool ambientOcclusionOnly;
- varying vec2 v_textureCoordinates;
- void main(void)
- {
- vec3 color = texture2D(colorTexture, v_textureCoordinates).rgb;
- vec3 ao = texture2D(ambientOcclusionTexture, v_textureCoordinates).rgb;
- gl_FragColor.rgb = ambientOcclusionOnly ? ao : ao * color;
- }
- `;var C4=`uniform sampler2D colorTexture;
- uniform float gradations;
- varying vec2 v_textureCoordinates;
- void main(void)
- {
- vec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;
- #ifdef CZM_SELECTED_FEATURE
- if (czm_selected()) {
- gl_FragColor = vec4(rgb, 1.0);
- return;
- }
- #endif
- float luminance = czm_luminance(rgb);
- float darkness = luminance * gradations;
- darkness = (darkness - fract(darkness)) / gradations;
- gl_FragColor = vec4(vec3(darkness), 1.0);
- }
- `;var A4=`uniform sampler2D colorTexture;
- uniform sampler2D bloomTexture;
- uniform bool glowOnly;
- varying vec2 v_textureCoordinates;
- void main(void)
- {
- vec4 color = texture2D(colorTexture, v_textureCoordinates);
- #ifdef CZM_SELECTED_FEATURE
- if (czm_selected()) {
- gl_FragColor = color;
- return;
- }
- #endif
- vec4 bloom = texture2D(bloomTexture, v_textureCoordinates);
- gl_FragColor = glowOnly ? bloom : bloom + color;
- }
- `;var T4=`uniform sampler2D colorTexture;
- uniform float brightness;
- varying vec2 v_textureCoordinates;
- void main(void)
- {
- vec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;
- vec3 target = vec3(0.0);
- gl_FragColor = vec4(mix(target, rgb, brightness), 1.0);
- }
- `;var b4=`uniform sampler2D colorTexture;
- uniform float contrast;
- uniform float brightness;
- varying vec2 v_textureCoordinates;
- void main(void)
- {
- vec3 sceneColor = texture2D(colorTexture, v_textureCoordinates).xyz;
- sceneColor = czm_RGBToHSB(sceneColor);
- sceneColor.z += brightness;
- sceneColor = czm_HSBToRGB(sceneColor);
- float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast));
- sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5);
- gl_FragColor = vec4(sceneColor, 1.0);
- }
- `;var E4=`uniform sampler2D colorTexture;
- uniform sampler2D blurTexture;
- uniform sampler2D depthTexture;
- uniform float focalDistance;
- varying vec2 v_textureCoordinates;
- vec4 toEye(vec2 uv, float depth)
- {
- vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));
- vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);
- posInCamera = posInCamera / posInCamera.w;
- return posInCamera;
- }
- float computeDepthBlur(float depth)
- {
- float f;
- if (depth < focalDistance)
- {
- f = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x);
- }
- else
- {
- f = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance);
- f = pow(f, 0.1);
- }
- f *= f;
- f = clamp(f, 0.0, 1.0);
- return pow(f, 0.5);
- }
- void main(void)
- {
- float depth = czm_readDepth(depthTexture, v_textureCoordinates);
- vec4 posInCamera = toEye(v_textureCoordinates, depth);
- float d = computeDepthBlur(-posInCamera.z);
- gl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), texture2D(blurTexture, v_textureCoordinates), d);
- }
- `;var S4=`uniform sampler2D depthTexture;
- varying vec2 v_textureCoordinates;
- void main(void)
- {
- float depth = czm_readDepth(depthTexture, v_textureCoordinates);
- gl_FragColor = vec4(vec3(depth), 1.0);
- }
- `;var w4=`uniform sampler2D depthTexture;
- uniform float length;
- uniform vec4 color;
- varying vec2 v_textureCoordinates;
- void main(void)
- {
- float directions[3];
- directions[0] = -1.0;
- directions[1] = 0.0;
- directions[2] = 1.0;
- float scalars[3];
- scalars[0] = 3.0;
- scalars[1] = 10.0;
- scalars[2] = 3.0;
- float padx = czm_pixelRatio / czm_viewport.z;
- float pady = czm_pixelRatio / czm_viewport.w;
- #ifdef CZM_SELECTED_FEATURE
- bool selected = false;
- for (int i = 0; i < 3; ++i)
- {
- float dir = directions[i];
- selected = selected || czm_selected(vec2(-padx, dir * pady));
- selected = selected || czm_selected(vec2(padx, dir * pady));
- selected = selected || czm_selected(vec2(dir * padx, -pady));
- selected = selected || czm_selected(vec2(dir * padx, pady));
- if (selected)
- {
- break;
- }
- }
- if (!selected)
- {
- gl_FragColor = vec4(color.rgb, 0.0);
- return;
- }
- #endif
- float horizEdge = 0.0;
- float vertEdge = 0.0;
- for (int i = 0; i < 3; ++i)
- {
- float dir = directions[i];
- float scale = scalars[i];
- horizEdge -= texture2D(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale;
- horizEdge += texture2D(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale;
- vertEdge -= texture2D(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale;
- vertEdge += texture2D(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale;
- }
- float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge);
- gl_FragColor = vec4(color.rgb, len > length ? color.a : 0.0);
- }
- `;var v4=`uniform sampler2D colorTexture;
- varying vec2 v_textureCoordinates;
- #ifdef AUTO_EXPOSURE
- uniform sampler2D autoExposure;
- #endif
- void main()
- {
- vec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);
- vec3 color = fragmentColor.rgb;
- #ifdef AUTO_EXPOSURE
- float exposure = texture2D(autoExposure, vec2(0.5)).r;
- color /= exposure;
- #endif
- const float A = 0.22;
- const float B = 0.30;
- const float C = 0.10;
- const float D = 0.20;
- const float E = 0.01;
- const float F = 0.30;
- const float white = 11.2;
- vec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F;
- float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F;
- c = czm_inverseGamma(c / w);
- gl_FragColor = vec4(c, fragmentColor.a);
- }
- `;var D4=`varying vec2 v_textureCoordinates;
- uniform sampler2D colorTexture;
- const float fxaaQualitySubpix = 0.5;
- const float fxaaQualityEdgeThreshold = 0.125;
- const float fxaaQualityEdgeThresholdMin = 0.0833;
- void main()
- {
- vec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw;
- vec4 color = FxaaPixelShader(
- v_textureCoordinates,
- colorTexture,
- fxaaQualityRcpFrame,
- fxaaQualitySubpix,
- fxaaQualityEdgeThreshold,
- fxaaQualityEdgeThresholdMin);
- float alpha = texture2D(colorTexture, v_textureCoordinates).a;
- gl_FragColor = vec4(color.rgb, alpha);
- }
- `;var xC=`#define SAMPLES 8
- uniform float delta;
- uniform float sigma;
- uniform float direction;
- uniform sampler2D colorTexture;
- #ifdef USE_STEP_SIZE
- uniform float stepSize;
- #else
- uniform vec2 step;
- #endif
- varying vec2 v_textureCoordinates;
- void main()
- {
- vec2 st = v_textureCoordinates;
- vec2 dir = vec2(1.0 - direction, direction);
- #ifdef USE_STEP_SIZE
- vec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw));
- #else
- vec2 step = step;
- #endif
- vec3 g;
- g.x = 1.0 / (sqrt(czm_twoPi) * sigma);
- g.y = exp((-0.5 * delta * delta) / (sigma * sigma));
- g.z = g.y * g.y;
- vec4 result = texture2D(colorTexture, st) * g.x;
- for (int i = 1; i < SAMPLES; ++i)
- {
- g.xy *= g.yz;
- vec2 offset = float(i) * dir * step;
- result += texture2D(colorTexture, st - offset) * g.x;
- result += texture2D(colorTexture, st + offset) * g.x;
- }
- gl_FragColor = result;
- }
- `;var P4=`uniform sampler2D colorTexture;
- uniform sampler2D dirtTexture;
- uniform sampler2D starTexture;
- uniform vec2 dirtTextureDimensions;
- uniform float distortion;
- uniform float ghostDispersal;
- uniform float haloWidth;
- uniform float dirtAmount;
- uniform float earthRadius;
- uniform float intensity;
- varying vec2 v_textureCoordinates;
- #define DISTANCE_TO_SPACE 6500000.0
- vec4 getNDCFromWC(vec3 WC, float earthRadius)
- {
- vec4 positionEC = czm_view * vec4(WC, 1.0);
- positionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0);
- vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
- return czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);
- }
- float isInEarth(vec2 texcoord, vec2 sceneSize)
- {
- vec2 NDC = texcoord * 2.0 - 1.0;
- vec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0);
- vec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5);
- NDC.xy -= earthPosSC.xy;
- float X = abs(NDC.x) * sceneSize.x;
- float Y = abs(NDC.y) * sceneSize.y;
- return clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0));
- }
- vec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace)
- {
- vec2 sceneSize = czm_viewport.zw;
- vec3 color;
- if(isSpace)
- {
- color.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture2D(tex, texcoord + direction * distortion.r).r;
- color.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture2D(tex, texcoord + direction * distortion.g).g;
- color.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture2D(tex, texcoord + direction * distortion.b).b;
- }
- else
- {
- color.r = texture2D(tex, texcoord + direction * distortion.r).r;
- color.g = texture2D(tex, texcoord + direction * distortion.g).g;
- color.b = texture2D(tex, texcoord + direction * distortion.b).b;
- }
- return vec4(clamp(color, 0.0, 1.0), 0.0);
- }
- void main(void)
- {
- vec4 originalColor = texture2D(colorTexture, v_textureCoordinates);
- vec3 rgb = originalColor.rgb;
- bool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE;
- vec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0);
- vec4 sunPositionEC = czm_view * sunPos;
- vec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC);
- sunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0);
- if(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1)))
- {
- gl_FragColor = originalColor;
- return;
- }
- vec2 texcoord = vec2(1.0) - v_textureCoordinates;
- vec2 pixelSize = czm_pixelRatio / czm_viewport.zw;
- vec2 invPixelSize = 1.0 / pixelSize;
- vec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion);
- vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal;
- vec3 direction = normalize(vec3(ghostVec, 0.0));
- vec4 result = vec4(0.0);
- vec4 ghost = vec4(0.0);
- for (int i = 0; i < 4; ++i)
- {
- vec2 offset = fract(texcoord + ghostVec * float(i));
- ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace);
- }
- result += ghost;
- vec2 haloVec = normalize(ghostVec) * haloWidth;
- float weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));
- weightForHalo = pow(1.0 - weightForHalo, 5.0);
- result += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5;
- vec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions;
- if (dirtTexCoords.x > 1.0)
- {
- dirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) : fract(dirtTexCoords.x);
- }
- if (dirtTexCoords.y > 1.0)
- {
- dirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y);
- }
- result += dirtAmount * texture2D(dirtTexture, dirtTexCoords);
- float camrot = czm_view[0].z + czm_view[1].y;
- float cosValue = cos(camrot);
- float sinValue = sin(camrot);
- mat3 rotation = mat3(
- cosValue, -sinValue, 0.0,
- sinValue, cosValue, 0.0,
- 0.0, 0.0, 1.0
- );
- vec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0);
- vec3 st2 = vec3((rotation * st1).xy, 1.0);
- vec3 st3 = st2 * 0.5 + vec3(0.5);
- vec2 lensStarTexcoord = st3.xy;
- float weightForLensFlare = length(vec3(sunPos.xy, 0.0));
- float oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0);
- if (!isSpace)
- {
- result *= oneMinusWeightForLensFlare * intensity * 0.2;
- }
- else
- {
- result *= oneMinusWeightForLensFlare * intensity;
- result *= texture2D(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0;
- }
- result += texture2D(colorTexture, v_textureCoordinates);
- gl_FragColor = result;
- }
- `;var I4=`uniform sampler2D colorTexture;
- uniform vec3 white;
- varying vec2 v_textureCoordinates;
- #ifdef AUTO_EXPOSURE
- uniform sampler2D autoExposure;
- #endif
- void main()
- {
- vec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);
- vec3 color = fragmentColor.rgb;
- #ifdef AUTO_EXPOSURE
- float exposure = texture2D(autoExposure, vec2(0.5)).r;
- color /= exposure;
- #endif
- color = (color * (1.0 + color / white)) / (1.0 + color);
- color = czm_inverseGamma(color);
- gl_FragColor = vec4(color, fragmentColor.a);
- }
- `;var O4=`uniform sampler2D colorTexture;
- varying vec2 v_textureCoordinates;
- float rand(vec2 co)
- {
- return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);
- }
- void main(void)
- {
- float noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1;
- vec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;
- vec3 green = vec3(0.0, 1.0, 0.0);
- gl_FragColor = vec4((noiseValue + rgb) * green, 1.0);
- }
- `;var R4=`uniform sampler2D colorTexture;
- varying vec2 v_textureCoordinates;
- #ifdef AUTO_EXPOSURE
- uniform sampler2D autoExposure;
- #endif
- void main()
- {
- vec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);
- vec3 color = fragmentColor.rgb;
- #ifdef AUTO_EXPOSURE
- float exposure = texture2D(autoExposure, vec2(0.5)).r;
- color /= exposure;
- #endif
- color = color / (1.0 + color);
- color = czm_inverseGamma(color);
- gl_FragColor = vec4(color, fragmentColor.a);
- }
- `;var M4=`uniform sampler2D colorTexture;
- uniform sampler2D silhouetteTexture;
- varying vec2 v_textureCoordinates;
- void main(void)
- {
- vec4 silhouetteColor = texture2D(silhouetteTexture, v_textureCoordinates);
- vec4 color = texture2D(colorTexture, v_textureCoordinates);
- gl_FragColor = mix(color, silhouetteColor, silhouetteColor.a);
- }
- `;/**
- * @license
- * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of NVIDIA CORPORATION nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */var B4=`#if (FXAA_QUALITY_PRESET == 10)
- #define FXAA_QUALITY_PS 3
- #define FXAA_QUALITY_P0 1.5
- #define FXAA_QUALITY_P1 3.0
- #define FXAA_QUALITY_P2 12.0
- #endif
- #if (FXAA_QUALITY_PRESET == 11)
- #define FXAA_QUALITY_PS 4
- #define FXAA_QUALITY_P0 1.0
- #define FXAA_QUALITY_P1 1.5
- #define FXAA_QUALITY_P2 3.0
- #define FXAA_QUALITY_P3 12.0
- #endif
- #if (FXAA_QUALITY_PRESET == 12)
- #define FXAA_QUALITY_PS 5
- #define FXAA_QUALITY_P0 1.0
- #define FXAA_QUALITY_P1 1.5
- #define FXAA_QUALITY_P2 2.0
- #define FXAA_QUALITY_P3 4.0
- #define FXAA_QUALITY_P4 12.0
- #endif
- #if (FXAA_QUALITY_PRESET == 13)
- #define FXAA_QUALITY_PS 6
- #define FXAA_QUALITY_P0 1.0
- #define FXAA_QUALITY_P1 1.5
- #define FXAA_QUALITY_P2 2.0
- #define FXAA_QUALITY_P3 2.0
- #define FXAA_QUALITY_P4 4.0
- #define FXAA_QUALITY_P5 12.0
- #endif
- #if (FXAA_QUALITY_PRESET == 14)
- #define FXAA_QUALITY_PS 7
- #define FXAA_QUALITY_P0 1.0
- #define FXAA_QUALITY_P1 1.5
- #define FXAA_QUALITY_P2 2.0
- #define FXAA_QUALITY_P3 2.0
- #define FXAA_QUALITY_P4 2.0
- #define FXAA_QUALITY_P5 4.0
- #define FXAA_QUALITY_P6 12.0
- #endif
- #if (FXAA_QUALITY_PRESET == 15)
- #define FXAA_QUALITY_PS 8
- #define FXAA_QUALITY_P0 1.0
- #define FXAA_QUALITY_P1 1.5
- #define FXAA_QUALITY_P2 2.0
- #define FXAA_QUALITY_P3 2.0
- #define FXAA_QUALITY_P4 2.0
- #define FXAA_QUALITY_P5 2.0
- #define FXAA_QUALITY_P6 4.0
- #define FXAA_QUALITY_P7 12.0
- #endif
- #if (FXAA_QUALITY_PRESET == 20)
- #define FXAA_QUALITY_PS 3
- #define FXAA_QUALITY_P0 1.5
- #define FXAA_QUALITY_P1 2.0
- #define FXAA_QUALITY_P2 8.0
- #endif
- #if (FXAA_QUALITY_PRESET == 21)
- #define FXAA_QUALITY_PS 4
- #define FXAA_QUALITY_P0 1.0
- #define FXAA_QUALITY_P1 1.5
- #define FXAA_QUALITY_P2 2.0
- #define FXAA_QUALITY_P3 8.0
- #endif
- #if (FXAA_QUALITY_PRESET == 22)
- #define FXAA_QUALITY_PS 5
- #define FXAA_QUALITY_P0 1.0
- #define FXAA_QUALITY_P1 1.5
- #define FXAA_QUALITY_P2 2.0
- #define FXAA_QUALITY_P3 2.0
- #define FXAA_QUALITY_P4 8.0
- #endif
- #if (FXAA_QUALITY_PRESET == 23)
- #define FXAA_QUALITY_PS 6
- #define FXAA_QUALITY_P0 1.0
- #define FXAA_QUALITY_P1 1.5
- #define FXAA_QUALITY_P2 2.0
- #define FXAA_QUALITY_P3 2.0
- #define FXAA_QUALITY_P4 2.0
- #define FXAA_QUALITY_P5 8.0
- #endif
- #if (FXAA_QUALITY_PRESET == 24)
- #define FXAA_QUALITY_PS 7
- #define FXAA_QUALITY_P0 1.0
- #define FXAA_QUALITY_P1 1.5
- #define FXAA_QUALITY_P2 2.0
- #define FXAA_QUALITY_P3 2.0
- #define FXAA_QUALITY_P4 2.0
- #define FXAA_QUALITY_P5 3.0
- #define FXAA_QUALITY_P6 8.0
- #endif
- #if (FXAA_QUALITY_PRESET == 25)
- #define FXAA_QUALITY_PS 8
- #define FXAA_QUALITY_P0 1.0
- #define FXAA_QUALITY_P1 1.5
- #define FXAA_QUALITY_P2 2.0
- #define FXAA_QUALITY_P3 2.0
- #define FXAA_QUALITY_P4 2.0
- #define FXAA_QUALITY_P5 2.0
- #define FXAA_QUALITY_P6 4.0
- #define FXAA_QUALITY_P7 8.0
- #endif
- #if (FXAA_QUALITY_PRESET == 26)
- #define FXAA_QUALITY_PS 9
- #define FXAA_QUALITY_P0 1.0
- #define FXAA_QUALITY_P1 1.5
- #define FXAA_QUALITY_P2 2.0
- #define FXAA_QUALITY_P3 2.0
- #define FXAA_QUALITY_P4 2.0
- #define FXAA_QUALITY_P5 2.0
- #define FXAA_QUALITY_P6 2.0
- #define FXAA_QUALITY_P7 4.0
- #define FXAA_QUALITY_P8 8.0
- #endif
- #if (FXAA_QUALITY_PRESET == 27)
- #define FXAA_QUALITY_PS 10
- #define FXAA_QUALITY_P0 1.0
- #define FXAA_QUALITY_P1 1.5
- #define FXAA_QUALITY_P2 2.0
- #define FXAA_QUALITY_P3 2.0
- #define FXAA_QUALITY_P4 2.0
- #define FXAA_QUALITY_P5 2.0
- #define FXAA_QUALITY_P6 2.0
- #define FXAA_QUALITY_P7 2.0
- #define FXAA_QUALITY_P8 4.0
- #define FXAA_QUALITY_P9 8.0
- #endif
- #if (FXAA_QUALITY_PRESET == 28)
- #define FXAA_QUALITY_PS 11
- #define FXAA_QUALITY_P0 1.0
- #define FXAA_QUALITY_P1 1.5
- #define FXAA_QUALITY_P2 2.0
- #define FXAA_QUALITY_P3 2.0
- #define FXAA_QUALITY_P4 2.0
- #define FXAA_QUALITY_P5 2.0
- #define FXAA_QUALITY_P6 2.0
- #define FXAA_QUALITY_P7 2.0
- #define FXAA_QUALITY_P8 2.0
- #define FXAA_QUALITY_P9 4.0
- #define FXAA_QUALITY_P10 8.0
- #endif
- #if (FXAA_QUALITY_PRESET == 29)
- #define FXAA_QUALITY_PS 12
- #define FXAA_QUALITY_P0 1.0
- #define FXAA_QUALITY_P1 1.5
- #define FXAA_QUALITY_P2 2.0
- #define FXAA_QUALITY_P3 2.0
- #define FXAA_QUALITY_P4 2.0
- #define FXAA_QUALITY_P5 2.0
- #define FXAA_QUALITY_P6 2.0
- #define FXAA_QUALITY_P7 2.0
- #define FXAA_QUALITY_P8 2.0
- #define FXAA_QUALITY_P9 2.0
- #define FXAA_QUALITY_P10 4.0
- #define FXAA_QUALITY_P11 8.0
- #endif
- #if (FXAA_QUALITY_PRESET == 39)
- #define FXAA_QUALITY_PS 12
- #define FXAA_QUALITY_P0 1.0
- #define FXAA_QUALITY_P1 1.0
- #define FXAA_QUALITY_P2 1.0
- #define FXAA_QUALITY_P3 1.0
- #define FXAA_QUALITY_P4 1.0
- #define FXAA_QUALITY_P5 1.5
- #define FXAA_QUALITY_P6 2.0
- #define FXAA_QUALITY_P7 2.0
- #define FXAA_QUALITY_P8 2.0
- #define FXAA_QUALITY_P9 2.0
- #define FXAA_QUALITY_P10 4.0
- #define FXAA_QUALITY_P11 8.0
- #endif
- #define FxaaBool bool
- #define FxaaFloat float
- #define FxaaFloat2 vec2
- #define FxaaFloat3 vec3
- #define FxaaFloat4 vec4
- #define FxaaHalf float
- #define FxaaHalf2 vec2
- #define FxaaHalf3 vec3
- #define FxaaHalf4 vec4
- #define FxaaInt2 vec2
- #define FxaaTex sampler2D
- #define FxaaSat(x) clamp(x, 0.0, 1.0)
- #define FxaaTexTop(t, p) texture2D(t, p)
- #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r))
- FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }
- FxaaFloat4 FxaaPixelShader(
- FxaaFloat2 pos,
- FxaaTex tex,
- FxaaFloat2 fxaaQualityRcpFrame,
- FxaaFloat fxaaQualitySubpix,
- FxaaFloat fxaaQualityEdgeThreshold,
- FxaaFloat fxaaQualityEdgeThresholdMin
- ) {
- FxaaFloat2 posM;
- posM.x = pos.x;
- posM.y = pos.y;
- FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
- #define lumaM rgbyM.y
- FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));
- FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));
- FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));
- FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));
- FxaaFloat maxSM = max(lumaS, lumaM);
- FxaaFloat minSM = min(lumaS, lumaM);
- FxaaFloat maxESM = max(lumaE, maxSM);
- FxaaFloat minESM = min(lumaE, minSM);
- FxaaFloat maxWN = max(lumaN, lumaW);
- FxaaFloat minWN = min(lumaN, lumaW);
- FxaaFloat rangeMax = max(maxWN, maxESM);
- FxaaFloat rangeMin = min(minWN, minESM);
- FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;
- FxaaFloat range = rangeMax - rangeMin;
- FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);
- FxaaBool earlyExit = range < rangeMaxClamped;
- if(earlyExit)
- return rgbyM;
- FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));
- FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));
- FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));
- FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
- FxaaFloat lumaNS = lumaN + lumaS;
- FxaaFloat lumaWE = lumaW + lumaE;
- FxaaFloat subpixRcpRange = 1.0/range;
- FxaaFloat subpixNSWE = lumaNS + lumaWE;
- FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;
- FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;
- FxaaFloat lumaNESE = lumaNE + lumaSE;
- FxaaFloat lumaNWNE = lumaNW + lumaNE;
- FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;
- FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;
- FxaaFloat lumaNWSW = lumaNW + lumaSW;
- FxaaFloat lumaSWSE = lumaSW + lumaSE;
- FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);
- FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);
- FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;
- FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;
- FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;
- FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;
- FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;
- FxaaFloat lengthSign = fxaaQualityRcpFrame.x;
- FxaaBool horzSpan = edgeHorz >= edgeVert;
- FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;
- if(!horzSpan) lumaN = lumaW;
- if(!horzSpan) lumaS = lumaE;
- if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;
- FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;
- FxaaFloat gradientN = lumaN - lumaM;
- FxaaFloat gradientS = lumaS - lumaM;
- FxaaFloat lumaNN = lumaN + lumaM;
- FxaaFloat lumaSS = lumaS + lumaM;
- FxaaBool pairN = abs(gradientN) >= abs(gradientS);
- FxaaFloat gradient = max(abs(gradientN), abs(gradientS));
- if(pairN) lengthSign = -lengthSign;
- FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);
- FxaaFloat2 posB;
- posB.x = posM.x;
- posB.y = posM.y;
- FxaaFloat2 offNP;
- offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;
- offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;
- if(!horzSpan) posB.x += lengthSign * 0.5;
- if( horzSpan) posB.y += lengthSign * 0.5;
- FxaaFloat2 posN;
- posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;
- posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;
- FxaaFloat2 posP;
- posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;
- posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;
- FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;
- FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));
- FxaaFloat subpixE = subpixC * subpixC;
- FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));
- if(!pairN) lumaNN = lumaSS;
- FxaaFloat gradientScaled = gradient * 1.0/4.0;
- FxaaFloat lumaMM = lumaM - lumaNN * 0.5;
- FxaaFloat subpixF = subpixD * subpixE;
- FxaaBool lumaMLTZero = lumaMM < 0.0;
- lumaEndN -= lumaNN * 0.5;
- lumaEndP -= lumaNN * 0.5;
- FxaaBool doneN = abs(lumaEndN) >= gradientScaled;
- FxaaBool doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;
- FxaaBool doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;
- if(doneNP) {
- if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
- if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
- if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
- if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
- doneN = abs(lumaEndN) >= gradientScaled;
- doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;
- doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;
- #if (FXAA_QUALITY_PS > 3)
- if(doneNP) {
- if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
- if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
- if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
- if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
- doneN = abs(lumaEndN) >= gradientScaled;
- doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;
- doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;
- #if (FXAA_QUALITY_PS > 4)
- if(doneNP) {
- if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
- if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
- if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
- if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
- doneN = abs(lumaEndN) >= gradientScaled;
- doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;
- doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;
- #if (FXAA_QUALITY_PS > 5)
- if(doneNP) {
- if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
- if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
- if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
- if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
- doneN = abs(lumaEndN) >= gradientScaled;
- doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;
- doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;
- #if (FXAA_QUALITY_PS > 6)
- if(doneNP) {
- if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
- if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
- if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
- if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
- doneN = abs(lumaEndN) >= gradientScaled;
- doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;
- doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;
- #if (FXAA_QUALITY_PS > 7)
- if(doneNP) {
- if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
- if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
- if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
- if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
- doneN = abs(lumaEndN) >= gradientScaled;
- doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;
- doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;
- #if (FXAA_QUALITY_PS > 8)
- if(doneNP) {
- if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
- if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
- if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
- if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
- doneN = abs(lumaEndN) >= gradientScaled;
- doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;
- doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;
- #if (FXAA_QUALITY_PS > 9)
- if(doneNP) {
- if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
- if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
- if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
- if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
- doneN = abs(lumaEndN) >= gradientScaled;
- doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;
- doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;
- #if (FXAA_QUALITY_PS > 10)
- if(doneNP) {
- if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
- if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
- if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
- if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
- doneN = abs(lumaEndN) >= gradientScaled;
- doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;
- doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;
- #if (FXAA_QUALITY_PS > 11)
- if(doneNP) {
- if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
- if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
- if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
- if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
- doneN = abs(lumaEndN) >= gradientScaled;
- doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;
- doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;
- #if (FXAA_QUALITY_PS > 12)
- if(doneNP) {
- if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
- if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
- if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
- if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
- doneN = abs(lumaEndN) >= gradientScaled;
- doneP = abs(lumaEndP) >= gradientScaled;
- if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;
- if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;
- doneNP = (!doneN) || (!doneP);
- if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;
- if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;
- }
- #endif
- }
- #endif
- }
- #endif
- }
- #endif
- }
- #endif
- }
- #endif
- }
- #endif
- }
- #endif
- }
- #endif
- }
- #endif
- }
- FxaaFloat dstN = posM.x - posN.x;
- FxaaFloat dstP = posP.x - posM.x;
- if(!horzSpan) dstN = posM.y - posN.y;
- if(!horzSpan) dstP = posP.y - posM.y;
- FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;
- FxaaFloat spanLength = (dstP + dstN);
- FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;
- FxaaFloat spanLengthRcp = 1.0/spanLength;
- FxaaBool directionN = dstN < dstP;
- FxaaFloat dst = min(dstN, dstP);
- FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;
- FxaaFloat subpixG = subpixF * subpixF;
- FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;
- FxaaFloat subpixH = subpixG * fxaaQualitySubpix;
- FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;
- FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);
- if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;
- if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;
- return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);
- }
- `;function CC(e){e=y(e,y.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=y(e.inputPreviousStageTexture,!0);let t=e.name;l(t)||(t=Ln()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(CC.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});CC.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};CC.prototype.get=function(e){return this._stages[e]};function t_t(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let r=0;r<t;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}CC.prototype.update=function(e,t){this._selectedDirty=t_t(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let r=0;r<i;++r){let o=n[r];this._selectedDirty&&(o.parentSelected=this._combinedSelected),o.update(e,t)}};CC.prototype.isDestroyed=function(){return!1};CC.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var Ml=CC;var Uo={};function L4(e){let r=`#define USE_STEP_SIZE
- ${xC}`,o=new Sr({name:`${e}_x_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:kf.LINEAR}),s=new Sr({name:`${e}_y_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:kf.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return o.uniforms.delta},set:function(c){let u=o.uniforms,f=s.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return o.uniforms.sigma},set:function(c){let u=o.uniforms,f=s.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return o.uniforms.stepSize},set:function(c){let u=o.uniforms,f=s.uniforms;u.stepSize=f.stepSize=c}}}),new Ml({name:e,stages:[o,s],uniforms:a})}Uo.createBlurStage=function(){return L4("czm_blur")};Uo.createDepthOfFieldStage=function(){let e=L4("czm_depth_of_field_blur"),t=new Sr({name:"czm_depth_of_field_composite",fragmentShader:E4,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new Ml({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Uo.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Uo.createEdgeDetectionStage=function(){let e=Ln();return new Sr({name:`czm_edge_detection_${e}`,fragmentShader:w4,uniforms:{length:.25,color:z.clone(z.BLACK)}})};Uo.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function n_t(e){if(!l(e))return Uo.createEdgeDetectionStage();let t=new Ml({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",r="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a};
- `,r+=` vec4 edge${a} = texture2D(edgeTexture${a}, v_textureCoordinates);
- if (edge${a}.a > 0.0)
- {
- color = edge${a};
- break;
- }
- `,n[`edgeTexture${a}`]=e[a].name;let o=`${i}varying vec2 v_textureCoordinates;
- void main() {
- vec4 color = vec4(0.0);
- for (int i = 0; i < ${e.length}; i++)
- {
- ${r} }
- gl_FragColor = color;
- }
- `,s=new Sr({name:"czm_edge_detection_combine",fragmentShader:o,uniforms:n});return new Ml({name:"czm_edge_detection_composite",stages:[t,s]})}Uo.createSilhouetteStage=function(e){let t=n_t(e),n=new Sr({name:"czm_silhouette_color_edges",fragmentShader:M4,uniforms:{silhouetteTexture:t.name}});return new Ml({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Uo.isSilhouetteSupported=function(e){return e.context.depthTexture};Uo.createBloomStage=function(){let e=new Sr({name:"czm_bloom_contrast_bias",fragmentShader:b4,uniforms:{contrast:128,brightness:-.3}}),t=L4("czm_bloom_blur"),n=new Ml({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new Sr({name:"czm_bloom_generate_composite",fragmentShader:A4,uniforms:{glowOnly:!1,bloomTexture:n.name}}),r={};return Object.defineProperties(r,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(o){i.uniforms.glowOnly=o}},contrast:{get:function(){return e.uniforms.contrast},set:function(o){e.uniforms.contrast=o}},brightness:{get:function(){return e.uniforms.brightness},set:function(o){e.uniforms.brightness=o}},delta:{get:function(){return t.uniforms.delta},set:function(o){t.uniforms.delta=o}},sigma:{get:function(){return t.uniforms.sigma},set:function(o){t.uniforms.sigma=o}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(o){t.uniforms.stepSize=o}}}),new Ml({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})};Uo.createAmbientOcclusionStage=function(){let e=new Sr({name:"czm_ambient_occlusion_generate",fragmentShader:y4,uniforms:{intensity:3,bias:.1,lengthCap:.26,stepSize:1.95,frustumLength:1e3,randomTexture:void 0}}),t=L4("czm_ambient_occlusion_blur");t.uniforms.stepSize=.86;let n=new Ml({name:"czm_ambient_occlusion_generate_blur",stages:[e,t]}),i=new Sr({name:"czm_ambient_occlusion_composite",fragmentShader:x4,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:n.name}}),r={};return Object.defineProperties(r,{intensity:{get:function(){return e.uniforms.intensity},set:function(o){e.uniforms.intensity=o}},bias:{get:function(){return e.uniforms.bias},set:function(o){e.uniforms.bias=o}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(o){e.uniforms.lengthCap=o}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(o){e.uniforms.stepSize=o}},frustumLength:{get:function(){return e.uniforms.frustumLength},set:function(o){e.uniforms.frustumLength=o}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(o){e.uniforms.randomTexture=o}},delta:{get:function(){return t.uniforms.delta},set:function(o){t.uniforms.delta=o}},sigma:{get:function(){return t.uniforms.sigma},set:function(o){t.uniforms.sigma=o}},blurStepSize:{get:function(){return t.uniforms.stepSize},set:function(o){t.uniforms.stepSize=o}},ambientOcclusionOnly:{get:function(){return i.uniforms.ambientOcclusionOnly},set:function(o){i.uniforms.ambientOcclusionOnly=o}}}),new Ml({name:"czm_ambient_occlusion",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})};Uo.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var i_t=`#define FXAA_QUALITY_PRESET 39
- ${B4}
- ${D4}`;Uo.createFXAAStage=function(){return new Sr({name:"czm_FXAA",fragmentShader:i_t,sampleMode:kf.LINEAR})};Uo.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
- `:"";return t+=g4,new Sr({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0}})};Uo.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
- `:"";return t+=v4,new Sr({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0}})};Uo.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
- `:"";return t+=R4,new Sr({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0}})};Uo.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
- `:"";return t+=I4,new Sr({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:z.WHITE,autoExposure:void 0}})};Uo.createAutoExposureStage=function(){return new yk};Uo.createBlackAndWhiteStage=function(){return new Sr({name:"czm_black_and_white",fragmentShader:C4,uniforms:{gradations:5}})};Uo.createBrightnessStage=function(){return new Sr({name:"czm_brightness",fragmentShader:T4,uniforms:{brightness:.5}})};Uo.createNightVisionStage=function(){return new Sr({name:"czm_night_vision",fragmentShader:O4})};Uo.createDepthViewStage=function(){return new Sr({name:"czm_depth_view",fragmentShader:S4})};Uo.createLensFlareStage=function(){return new Sr({name:"czm_lens_flare",fragmentShader:P4,uniforms:{dirtTexture:Qt("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:Qt("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:oe.WGS84.maximumRadius}})};var nh=Uo;function l_(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function F1(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function EY(e,t,n,i,r){if(!i.enabled||!i._isSupported(t))return r;let o=n[i.name]={};if(l(r)){let a=e.getStageByName(r);o[F1(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let u=0;u<c;++u){let f=s[a[u]];if(typeof f=="string"){let d=e.getStageByName(f);l(d)&&(o[F1(d)]=!0)}}}return i.name}function N1(e,t,n,i,r){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return r;let o=r,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=r,c=i.length;for(let d=0;d<c;++d){let p=i.get(d);l(p.length)?a=N1(e,t,n,p,r):a=EY(e,t,n,p,r),s&&(r=a)}let u,f;if(s)for(u=1;u<c;++u)f=F1(i.get(u)),l(n[f])||(n[f]={}),n[f][o]=!0;else for(u=1;u<c;++u){f=F1(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[F1(i.get(p))]=!0}return a}function r_t(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,r=e.bloom,o=e._tonemapping,s=e.fxaa,a=N1(e,t,n,i,void 0);a=N1(e,t,n,r,a),a=EY(e,t,n,o,a),a=N1(e,t,n,e,a),EY(e,t,n,s,a)}else N1(e,t,n,e,void 0);return n}function o_t(e,t,n){let r=e._collection.getStageByName(t),o=r._textureScale,s=r._forcePowerOfTwo,a=r._pixelFormat,c=r._pixelDatatype,u=r._clearColor,f,d,p=e._framebuffers,g=p.length;for(f=0;f<g;++f){if(d=p[f],o!==d.textureScale||s!==d.forcePowerOfTwo||a!==d.pixelFormat||c!==d.pixelDatatype||!z.equals(u,d.clearColor))continue;let m=d.stages,x=m.length,C=!1;for(let A=0;A<x;++A)if(n[m[A]]){C=!0;break}if(!C)break}return l(d)&&f<g?(d.stages.push(t),d):(d={textureScale:o,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:u,stages:[t],buffer:new pi({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(d),d)}function s_t(e,t){let n=r_t(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=o_t(e,i,n[i]))}function SY(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function a_t(e,t){let n=e._width,i=e._height,r=e._framebuffers,o=r.length;for(let s=0;s<o;++s){let a=r[s],c=a.textureScale,u=Math.ceil(n*c),f=Math.ceil(i*c),d=Math.min(u,f);a.forcePowerOfTwo&&(M.isPowerOfTwo(d)||(d=M.nextPowerOfTwo(d)),u=d,f=d),a.buffer.update(t,u,f),a.clear=new li({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}l_.prototype.updateDependencies=function(){this._updateDependencies=!0};l_.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),r=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),o=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||r||o||s;if((n||!a&&this._framebuffers.length>0)&&(SY(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&s_t(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,SY(this),a_t(this,e))};l_.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};l_.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};l_.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};l_.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(!!l(t))return t.buffer.framebuffer};l_.prototype.isDestroyed=function(){return!1};l_.prototype.destroy=function(){return SY(this),ue(this)};var GE=l_;var V1={REINHARD:0,MODIFIED_REINHARD:1,FILMIC:2,ACES:3,validate:function(e){return e===V1.REINHARD||e===V1.MODIFIED_REINHARD||e===V1.FILMIC||e===V1.ACES}},AC=Object.freeze(V1);var wY=[];function Wc(){let e=nh.createFXAAStage(),t=nh.createAmbientOcclusionStage(),n=nh.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=nh.createAutoExposureStage(),this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=AC.ACES;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let r=new GE(this),o={},s=wY;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();o[c.name]=c,c._textureCache=r;let u=c.length;if(l(u))for(let f=0;f<u;++f)s.push(c.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=o,this._textureCache=r}Object.defineProperties(Wc.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,r=this._ao,o=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||r.ready&&r.enabled,e=e||o.ready&&o.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return vY(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let r=this._bloom;if(r.enabled&&r.ready)return this.getOutputTexture(r.name);let o=this._ao;if(o.enabled&&o.ready)return this.getOutputTexture(o.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case AC.REINHARD:n=nh.createReinhardTonemappingStage(t);break;case AC.MODIFIED_REINHARD:n=nh.createModifiedReinhardTonemappingStage(t);break;case AC.FILMIC:n=nh.createFilmicTonemappingStage(t);break;default:n=nh.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}}});function vY(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];s&&(s._index=o++,t.push(s))}e._stages=t}Wc.prototype.add=function(e){let t=this._stageNames,n=wY;for(n.push(e);n.length>0;){let r=n.pop();t[r.name]=r,r._textureCache=this._textureCache;let o=r.length;if(l(o))for(let s=0;s<o;++s)n.push(r.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};Wc.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=wY;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let r=i.length;if(l(r))for(let o=0;o<r;++o)n.push(i.get(o))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};Wc.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};Wc.prototype.get=function(e){return vY(this),this._stages[e]};Wc.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};Wc.prototype.getStageByName=function(e){return this._stageNames[e]};Wc.prototype.update=function(e,t,n){vY(this);let i=this._activeStages,r=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let o=this._stages,s=r.length=o.length,a,c,u=0;for(a=0;a<s;++a)c=o[a],c.ready&&c.enabled&&c._isSupported(e)&&(r[u++]=c);r.length=u;let f=u!==i.length;if(!f){for(a=0;a<u;++a)if(r[a]!==i[a]){f=!0;break}}let d=this._ao,p=this._bloom,g=this._autoExposure,m=this._tonemapping,x=this._fxaa;m.enabled=n;let C=d.enabled&&d._isSupported(e),A=p.enabled&&p._isSupported(e),b=m.enabled&&m._isSupported(e),T=x.enabled&&x._isSupported(e);if((f||this._textureCacheDirty||C!==this._aoEnabled||A!==this._bloomEnabled||b!==this._tonemappingEnabled||T!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=C,this._bloomEnabled=A,this._tonemappingEnabled=b,this._fxaaEnabled=T,this._textureCacheDirty=!1),l(this._randomTexture)&&!C&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&C){s=256*256*3;let S=new Uint8Array(s);for(a=0;a<s;a+=3)S[a]=Math.floor(Math.random()*255);this._randomTexture=new wt({context:e,pixelFormat:ct.RGB,pixelDatatype:qe.UNSIGNED_BYTE,source:{arrayBufferView:S,width:256,height:256},sampler:new on({wrapS:mn.REPEAT,wrapT:mn.REPEAT,minificationFilter:It.NEAREST,magnificationFilter:Xi.NEAREST})})}for(this._textureCache.update(e),x.update(e,t),d.update(e,t),p.update(e,t),m.update(e,t),this._autoExposureEnabled&&g.update(e,t),s=o.length,a=0;a<s;++a)o[a].update(e,t);for(u=0,a=0;a<s;++a)c=o[a],c.ready&&c.enabled&&c._isSupported(e)&&u++;f=u!==r.length,f&&this.update(e,t,n)};Wc.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function TC(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}Wc.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(!!l(t))return TC(t)};function Pm(e,t,n,i,r){if(l(e.execute)){e.execute(t,n,i,r);return}let o=e.length,s;if(e.inputPreviousStageTexture)for(Pm(e.get(0),t,n,i,r),s=1;s<o;++s)Pm(e.get(s),t,TC(e.get(s-1)),i,r);else for(s=0;s<o;++s)Pm(e.get(s),t,n,i,r)}Wc.prototype.execute=function(e,t,n,i){let r=this._activeStages,o=r.length,s=this._fxaa,a=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,d=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,m=f.enabled&&f._isSupported(e),x=s.enabled&&s._isSupported(e);if(!x&&!d&&!p&&!m&&o===0)return;let C=t;d&&a.ready&&(Pm(a,e,C,n,i),C=TC(a)),p&&c.ready&&(Pm(c,e,C,n,i),C=TC(c)),g&&u.ready&&Pm(u,e,C,n,i),m&&f.ready&&(Pm(f,e,C,n,i),C=TC(f));let A=C;if(o>0){Pm(r[0],e,C,n,i);for(let b=1;b<o;++b)Pm(r[b],e,TC(r[b-1]),n,i);A=TC(r[o-1])}x&&s.ready&&Pm(s,e,A,n,i)};Wc.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(vu,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Wc.prototype.isDestroyed=function(){return!1};Wc.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),ue(this)};var N4=Wc;function Du(){ye.throwInstantiationError()}Du.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(Du.prototype,{quadtree:{get:ye.throwInstantiationError,set:ye.throwInstantiationError},ready:{get:ye.throwInstantiationError},tilingScheme:{get:ye.throwInstantiationError},errorEvent:{get:ye.throwInstantiationError}});Du.prototype.update=ye.throwInstantiationError;Du.prototype.beginUpdate=ye.throwInstantiationError;Du.prototype.endUpdate=ye.throwInstantiationError;Du.prototype.getLevelMaximumGeometricError=ye.throwInstantiationError;Du.prototype.loadTile=ye.throwInstantiationError;Du.prototype.computeTileVisibility=ye.throwInstantiationError;Du.prototype.showTileThisFrame=ye.throwInstantiationError;Du.prototype.computeDistanceToTile=ye.throwInstantiationError;Du.prototype.isDestroyed=ye.throwInstantiationError;Du.prototype.destroy=ye.throwInstantiationError;var Mye=Du;function bC(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}bC.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};bC.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof en,!(this._previousMode===te.SCENE2D||this._previousMode===te.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,te.SCENE2D,!0),n._mode=te.MORPHING,n.camera._setTransform(N.IDENTITY),this._previousMode===te.COLUMBUS_VIEW?U_t(this,e):Y_t(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var c_t=new h,l_t=new h,u_t=new h,f_t=new h,d_t=new h,h_t=new h,m_t=new h,p_t=new me,__t=new N,g_t=new bi,y_t=new en,x_t={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};bC.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===te.COLUMBUS_VIEW||this._previousMode===te.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,te.COLUMBUS_VIEW,!0),n.camera._setTransform(N.IDENTITY);let i=c_t,r=l_t,o=u_t;if(e>0)i.x=0,i.y=-1,i.z=1,i=h.multiplyByScalar(h.normalize(i,i),5*t.maximumRadius,i),h.negate(h.normalize(i,r),r),h.cross(h.UNIT_X,r,o);else{let u=n.camera;if(this._previousMode===te.SCENE2D)h.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,h.negate(h.UNIT_Z,r),h.clone(h.UNIT_Y,o);else{h.clone(u.positionWC,i),h.clone(u.directionWC,r),h.clone(u.upWC,o);let f=t.scaleToGeodeticSurface(i,m_t),d=yt.eastNorthUpToFixedFrame(f,t,__t);N.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,p_t),i),N.multiplyByPointAsVector(d,r,r),N.multiplyByPointAsVector(d,o,o)}}let s;this._morphToOrthographic?(s=y_t,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=g_t,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=M.toRadians(60));let a=x_t;a.position=i,a.direction=r,a.up=o,a.frustum=s;let c=K_t(a);k1(this,c),this._previousMode===te.SCENE2D?X_t(this,e,a,c):(a.position2D=N.multiplyByPoint(_r.TRANSFORM_2D,i,f_t),a.direction2D=N.multiplyByPointAsVector(_r.TRANSFORM_2D,r,d_t),a.up2D=N.multiplyByPointAsVector(_r.TRANSFORM_2D,o,h_t),n._mode=te.MORPHING,Wye(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var IY={position:new h,direction:new h,up:new h,frustum:void 0},Lye=new bi;bC.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===te.SCENE3D||this._previousMode===te.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,te.SCENE3D,!0),n._mode=te.MORPHING,n.camera._setTransform(N.IDENTITY),this._previousMode===te.SCENE2D)I_t(this,e,t);else{let i;e>0?(i=IY,h.fromDegrees(0,0,5*t.maximumRadius,t,i.position),h.negate(i.position,i.direction),h.normalize(i.direction,i.direction),h.clone(h.UNIT_Z,i.up)):i=Nye(this,t);let r,o=n.camera;o.frustum instanceof en?r=o.frustum.clone():(r=Lye,r.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,r.fov=M.toRadians(60)),i.frustum=r;let s=qye(i);k1(this,s),PY(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};bC.prototype.isDestroyed=function(){return!1};bC.prototype.destroy=function(){return F4(this),ue(this)};function k1(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new Ku(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,_n.LEFT_DOWN),e._morphHandler.setInputAction(n,_n.MIDDLE_DOWN),e._morphHandler.setInputAction(n,_n.RIGHT_DOWN),e._morphHandler.setInputAction(n,_n.WHEEL)}}function F4(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var C_t=new me,A_t=new h,T_t=new N;function Nye(e,t){let n=e._scene,i=n.camera,r=IY,o=r.position,s=r.direction,a=r.up,c=n.mapProjection.unproject(i.position,C_t);t.cartographicToCartesian(c,o);let u=t.scaleToGeodeticSurface(o,A_t),f=yt.eastNorthUpToFixedFrame(u,t,T_t);return N.multiplyByPointAsVector(f,i.direction,s),N.multiplyByPointAsVector(f,i.up,a),r}var b_t=new h,E_t=new h,S_t=new h,w_t=new h,v_t=new h,D_t=new h;function PY(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=h.clone(o.position,b_t),a=h.clone(o.direction,E_t),c=h.clone(o.up,S_t),u=N.multiplyByPoint(_r.TRANSFORM_2D_INVERSE,n.position,w_t),f=N.multiplyByPointAsVector(_r.TRANSFORM_2D_INVERSE,n.direction,v_t),d=N.multiplyByPointAsVector(_r.TRANSFORM_2D_INVERSE,n.up,D_t);function p(m){Uf(s,u,m.time,o.position),Uf(a,f,m.time,o.direction),Uf(c,d,m.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right)}let g=r.tweens.add({duration:t,easingFunction:qo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){jye(e,r,0,1,t,i)}});e._currentTweens.push(g)}var P_t=new en,Fye=new h,Vye=new h,kye=new h,OY=new h,Uye=new h,zye=new h;function I_t(e,t,n){t/=3;let i=e._scene,r=i.camera,o;t>0?(o=IY,h.fromDegrees(0,0,5*n.maximumRadius,n,o.position),h.negate(o.position,o.direction),h.normalize(o.direction,o.direction),h.clone(h.UNIT_Z,o.up)):(r.position.z=r.frustum.right-r.frustum.left,o=Nye(e,n));let s;e._morphToOrthographic?(s=P_t,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=r.frustum.right-r.frustum.left):(s=Lye,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=M.toRadians(60)),o.frustum=s;let a=qye(o);k1(e,a);let c;e._morphToOrthographic?c=function(){PY(e,t,o,a)}:c=function(){Gye(e,t,o,function(){PY(e,t,o,a)})},t>0?(i._mode=te.SCENE2D,r.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,OY),complete:function(){i._mode=te.MORPHING,c()}})):c()}function Uf(e,t,n,i){return h.lerp(e,t,n,i)}function Hye(e,t,n,i,r){let o=e._scene,s=o.camera;if(s.frustum instanceof en)return;let a=s.frustum.fov,c=M.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(c*.5)+1e7;function f(p){s.frustum.fov=M.lerp(a,c,p.time);let g=u/Math.tan(s.frustum.fov*.5);i(s,g)}let d=o.tweens.add({duration:t,easingFunction:qo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),r(e)}});e._currentTweens.push(d)}var O_t=new h,R_t=new h,M_t=new h,DY=new h,B_t=new h,L_t=new h,N_t=new Xo,F_t=new En,V_t=new h,k_t={position:void 0,direction:void 0,up:void 0,frustum:void 0};function U_t(e,t){t*=.5;let n=e._scene,i=n.camera,r=h.clone(i.position,O_t),o=h.clone(i.direction,R_t),s=h.clone(i.up,M_t),a=h.negate(h.UNIT_Z,B_t),c=h.clone(h.UNIT_Y,L_t),u=DY;if(t>0)h.clone(h.ZERO,DY),u.z=5*n.mapProjection.ellipsoid.maximumRadius;else{h.clone(r,DY);let C=F_t;N.multiplyByPoint(_r.TRANSFORM_2D,r,C.origin),N.multiplyByPointAsVector(_r.TRANSFORM_2D,o,C.direction);let A=n.globe;if(l(A)){let b=A.pickWorldCoordinates(C,n,!0,V_t);l(b)&&(N.multiplyByPoint(_r.TRANSFORM_2D_INVERSE,b,u),u.z+=h.distance(r,u))}}let f=N_t;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=k_t;d.position=u,d.direction=a,d.up=c,d.frustum=f;let p=Yye(d);k1(e,p);function g(C){Uf(r,u,C.time,i.position),Uf(o,a,C.time,i.direction),Uf(s,c,C.time,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function m(C,A){C.position.z=A}let x=n.tweens.add({duration:t,easingFunction:qo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){Hye(e,t,d,m,p)}});e._currentTweens.push(x)}var Bye=new me,z_t={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new Xo},H_t={position:new h,direction:new h,up:new h,frustum:void 0},G_t=new h,W_t=new En,j_t=new N,q_t=new h;function Y_t(e,t,n){t*=.5;let i=e._scene,r=i.camera,o=z_t;if(t>0)h.clone(h.ZERO,o.position),o.position.z=5*n.maximumRadius,h.negate(h.UNIT_Z,o.direction),h.clone(h.UNIT_Y,o.up);else{n.cartesianToCartographic(r.positionWC,Bye),i.mapProjection.project(Bye,o.position),h.negate(h.UNIT_Z,o.direction),h.clone(h.UNIT_Y,o.up);let d=W_t;h.clone(o.position2D,d.origin);let p=h.clone(r.directionWC,d.direction),g=n.scaleToGeodeticSurface(r.positionWC,q_t),m=yt.eastNorthUpToFixedFrame(g,n,j_t);N.inverseTransformation(m,m),N.multiplyByPointAsVector(m,p,p),N.multiplyByPointAsVector(_r.TRANSFORM_2D,p,p);let x=i.globe;if(l(x)){let C=x.pickWorldCoordinates(d,i,!0,G_t);if(l(C)){let A=h.distance(o.position2D,C);C.x+=A,h.clone(C,o.position2D)}}}function s(d,p){d.position.x=p}N.multiplyByPoint(_r.TRANSFORM_2D,o.position,o.position2D),N.multiplyByPointAsVector(_r.TRANSFORM_2D,o.direction,o.direction2D),N.multiplyByPointAsVector(_r.TRANSFORM_2D,o.up,o.up2D);let a=o.frustum;a.right=o.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=H_t;N.multiplyByPoint(_r.TRANSFORM_2D_INVERSE,o.position2D,c.position),h.clone(o.direction,c.direction),h.clone(o.up,c.up),c.frustum=a;let u=Yye(c);k1(e,u);function f(){Hye(e,t,o,s,u)}Wye(e,t,o,f)}function Gye(e,t,n,i){let r=e._scene,o=r.camera,s=o.frustum.right-o.frustum.left;o.frustum=n.frustum.clone();let a=o.frustum.fov,c=M.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);o.frustum.far=u/Math.tan(c*.5)+1e7,o.frustum.fov=c;function f(p){o.frustum.fov=M.lerp(c,a,p.time),o.position.z=u/Math.tan(o.frustum.fov*.5)}let d=r.tweens.add({duration:t,easingFunction:qo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function X_t(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=h.clone(n.position,OY),a=h.clone(n.direction,Uye),c=h.clone(n.up,zye);r._mode=te.MORPHING;function u(){o.frustum=n.frustum.clone();let f=h.clone(o.position,Fye),d=h.clone(o.direction,Vye),p=h.clone(o.up,kye);f.z=s.z;function g(x){Uf(f,s,x.time,o.position),Uf(d,a,x.time,o.direction),Uf(p,c,x.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right)}let m=r.tweens.add({duration:t,easingFunction:qo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():Gye(e,0,n,u)}function Wye(e,t,n,i){let r=e._scene,o=r.camera,s=h.clone(o.position,Fye),a=h.clone(o.direction,Vye),c=h.clone(o.up,kye),u=h.clone(n.position2D,OY),f=h.clone(n.direction2D,Uye),d=h.clone(n.up2D,zye);function p(m){Uf(s,u,m.time,o.position),Uf(a,f,m.time,o.direction),Uf(c,d,m.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right),o._adjustOrthographicFrustum(!0)}let g=r.tweens.add({duration:t,easingFunction:qo.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){jye(e,r,1,0,t,i)}});e._currentTweens.push(g)}function jye(e,t,n,i,r,o){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:r,easingFunction:qo.QUARTIC_OUT};l(o)&&(s.complete=function(){o(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function qye(e){return function(t){let n=t._scene;n._mode=te.SCENE3D,n.morphTime=te.getMorphTime(te.SCENE3D),F4(t);let i=n.camera;(t._previousMode!==te.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone());let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,te.SCENE3D,o)}}function Yye(e){return function(t){let n=t._scene;n._mode=te.SCENE2D,n.morphTime=te.getMorphTime(te.SCENE2D),F4(t);let i=n.camera;h.clone(e.position,i.position),i.position.z=n.mapProjection.ellipsoid.maximumRadius*2,h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone();let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,te.SCENE2D,r)}}function K_t(e){return function(t){let n=t._scene;n._mode=te.COLUMBUS_VIEW,n.morphTime=te.getMorphTime(te.COLUMBUS_VIEW),F4(t);let i=n.camera;(t._previousModeMode!==te.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right));let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,te.COLUMBUS_VIEW,o)}}var V4=bC;function k4(e,t,n,i,r,o,s,a,c,u){this._tweens=e,this._tweenjs=t,this._startObject=$e(n),this._stopObject=$e(i),this._duration=r,this._delay=o,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(k4.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});k4.prototype.cancelTween=function(){this._tweens.remove(this)};function ih(){this._tweens=[]}Object.defineProperties(ih.prototype,{length:{get:function(){return this._tweens.length}}});ih.prototype.add=function(e){if(e=y(e,y.EMPTY_OBJECT),e.duration===0)return l(e.complete)&&e.complete(),new k4(this);let t=e.duration/Yn.SECONDS_PER_MILLISECOND,n=y(e.delay,0),i=n/Yn.SECONDS_PER_MILLISECOND,r=y(e.easingFunction,qo.LINEAR_NONE),o=e.startObject,s=new Ti.default.Tween(o);s.to($e(e.stopObject),t),s.delay(i),s.easing(r),l(e.update)&&s.onUpdate(function(){e.update(o)}),s.onComplete(y(e.complete,null)),s.repeat(y(e._repeat,0));let a=new k4(this,s,e.startObject,e.stopObject,e.duration,n,r,e.update,e.complete,e.cancel);return this._tweens.push(a),a};ih.prototype.addProperty=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.object,n=e.property,i=e.startValue,r=e.stopValue;function o(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:r},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:o,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};ih.prototype.addAlpha=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.material,n=[];for(let r in t.uniforms)t.uniforms.hasOwnProperty(r)&&l(t.uniforms[r])&&l(t.uniforms[r].alpha)&&n.push(r);function i(r){let o=n.length;for(let s=0;s<o;++s)t.uniforms[n[s]].alpha=r.alpha}return this.add({startObject:{alpha:y(e.startValue,0)},stopObject:{alpha:y(e.stopValue,1)},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};ih.prototype.addOffsetIncrement=function(e){e=y(e,y.EMPTY_OBJECT);let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};ih.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};ih.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};ih.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};ih.prototype.get=function(e){return this._tweens[e]};ih.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/Yn.SECONDS_PER_MILLISECOND:Bi();n<t.length;){let i=t[n],r=i.tweenjs;i.needsStart?(i.needsStart=!1,r.start(e)):r.update(e)?n++:(r.stop(),t.splice(n,1))}};var WE=ih;function z1(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=ki.LEFT_DRAG,this.zoomEventTypes=[ki.RIGHT_DRAG,ki.WHEEL,ki.PINCH],this.rotateEventTypes=ki.LEFT_DRAG,this.tiltEventTypes=[ki.MIDDLE_DRAG,ki.PINCH,{eventType:ki.LEFT_DRAG,modifier:ha.CTRL},{eventType:ki.RIGHT_DRAG,modifier:ha.CTRL}],this.lookEventTypes={eventType:ki.LEFT_DRAG,modifier:ha.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=e,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new Rk(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new WE,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new W(-1,-1),this._tiltCenter=new h,this._rotateMousePosition=new W(-1,-1),this._rotateStartPosition=new h,this._strafeStartPosition=new h,this._strafeMousePosition=new W,this._strafeEndMousePosition=new W,this._zoomMouseStart=new W(-1,-1),this._zoomWorldPosition=new h,this._useZoomWorldPosition=!1,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let t=e.mapProjection;this._maxCoord=t.project(new me(Math.PI,M.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function $_t(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function Z_t(e){return W.equalsEpsilon(e.startPosition,e.endPosition,M.EPSILON14)}var J_t=.4;function Q_t(e,t,n,i,r,o,s){let a=o[s];l(a)||(a=o[s]={startPosition:new W,endPosition:new W,motion:new W,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,d=new Date,p=u&&(d.getTime()-u.getTime())/1e3;if(c&&u&&f<J_t){let g=$_t(p,i),m=e.getLastMovement(t,n);if(!l(m)||Z_t(m)||!a.inertiaEnabled||(a.motion.x=(m.endPosition.x-m.startPosition.x)*.5,a.motion.y=(m.endPosition.y-m.startPosition.y)*.5,a.startPosition=W.clone(m.startPosition,a.startPosition),a.endPosition=W.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=W.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||W.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let x=e.getStartMousePosition(t,n);r(o,x,a)}}}function egt(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let r=i.length;for(let o=0;o<r;++o)n=e[i[o]],l(n)&&(n.inertiaEnabled=!1)}}}var Xye=[];function jc(e,t,n,i,r,o){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(Xye[0]=n,n=Xye);let a=n.length;for(let c=0;c<a;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,d=u.modifier,p=s.isMoving(f,d)&&s.getMovement(f,d),g=s.getStartMousePosition(f,d);e.enableInputs&&t&&(p?(i(e,g,p),egt(e,o)):r<1&&Q_t(s,f,d,r,i,e,o))}}var U4=new En,tgt=new h,ngt=new W,igt=new h,rgt=new W,ogt=new h,sgt=new h,agt=new h,cgt=new h,lgt=new h,ugt=new h,fgt=new h,dgt=new h,hgt=new h,mgt=new h,pgt=new h,_gt=new h,ggt=new h,ygt=new h,xgt=new h,EC=new h,Kye=new h,$ye=new h,RY={orientation:new Yf};function UY(e,t,n,i,r,o){let s=1;l(o)&&(s=M.clamp(Math.abs(o),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,d=r-u,p=i*d;p=M.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let m=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(m>0&&Math.abs(r-u)<1||m<0&&Math.abs(r-f)<1)return;r-m<u?m=r-u-1:r-m>f&&(m=r-f)}let x=e._scene,C=x.camera,A=x.mode,b=RY.orientation;if(b.heading=C.heading,b.pitch=C.pitch,b.roll=C.roll,C.frustum instanceof en){Math.abs(m)>0&&(C.zoomIn(m),C._adjustOrthographicFrustum());return}let T=W.equals(t,e._zoomMouseStart),S=e._zoomingOnVector,w=e._rotatingZoom,D;if(T||(e._zoomMouseStart=W.clone(t,e._zoomMouseStart),l(e._globe)&&(A===te.SCENE2D?(D=C.getPickRay(t,U4).origin,D=h.fromElements(D.y,D.z,D.x)):D=q0(e,t,tgt)),l(D)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=h.clone(D,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,S=e._zoomingOnVector=!1,w=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){C.zoomIn(m);return}let I=A===te.COLUMBUS_VIEW;if(C.positionCartographic.height<2e6&&(w=!0),!T||w){if(A===te.SCENE2D){let O=e._zoomWorldPosition,B=C.position;if(!h.equals(O,B)&&C.positionCartographic.height<e._maxCoord.x*2){let L=C.position.x,_=h.subtract(O,B,igt);h.normalize(_,_);let E=h.distance(O,B)*m/(C.getMagnitude()*.5);C.move(_,E*.5),(C.position.x<0&&L>0||C.position.x>0&&L<0)&&(D=C.getPickRay(t,U4).origin,D=h.fromElements(D.y,D.z,D.x),e._zoomWorldPosition=h.clone(D,e._zoomWorldPosition))}}else if(A===te.SCENE3D){let O=h.normalize(C.position,lgt);if(e._cameraUnderground||e._zoomingUnderground||C.positionCartographic.height<3e3&&Math.abs(h.dot(C.direction,O))<.6)I=!0;else{let B=x.canvas,L=rgt;L.x=B.clientWidth/2,L.y=B.clientHeight/2;let _=q0(e,L,ogt);if(!l(_))I=!0;else if(C.positionCartographic.height<1e6)if(h.dot(C.direction,O)>=-.5)I=!0;else{let E=fgt;h.clone(C.position,E);let v=e._zoomWorldPosition,P=ugt;if(P=h.normalize(v,P),h.dot(P,O)<0)return;let R=xgt,F=mgt;h.clone(C.direction,F),h.add(E,h.multiplyByScalar(F,1e3,EC),R);let U=pgt,k=_gt;h.subtract(v,E,U),h.normalize(U,k);let H=h.dot(O,k);if(H>=0){e._zoomMouseStart.x=-1;return}let V=Math.acos(-H),q=h.magnitude(E),j=h.magnitude(v),X=q-m,G=h.magnitude(U),$=Math.asin(M.clamp(G/j*Math.sin(V),-1,1)),J=Math.asin(M.clamp(X/j*Math.sin(V),-1,1)),ce=$-J+V,de=dgt;h.normalize(E,de);let ie=hgt;ie=h.cross(k,de,ie),ie=h.normalize(ie,ie),h.normalize(h.cross(de,ie,EC),F),h.multiplyByScalar(h.normalize(R,EC),h.magnitude(R)-m,R),h.normalize(E,E),h.multiplyByScalar(E,X,E);let ae=ggt;h.multiplyByScalar(h.add(h.multiplyByScalar(de,Math.cos(ce)-1,Kye),h.multiplyByScalar(F,Math.sin(ce),$ye),EC),X,ae),h.add(E,ae,E),h.normalize(R,de),h.normalize(h.cross(de,ie,EC),F);let _e=ygt;h.multiplyByScalar(h.add(h.multiplyByScalar(de,Math.cos(ce)-1,Kye),h.multiplyByScalar(F,Math.sin(ce),$ye),EC),h.magnitude(R),_e),h.add(R,_e,R),h.clone(E,C.position),h.normalize(h.subtract(R,E,EC),C.direction),h.clone(C.direction,C.direction),h.cross(C.direction,C.up,C.right),h.cross(C.right,C.direction,C.up),C.setView(RY);return}else{let E=h.normalize(_,sgt),v=h.normalize(e._zoomWorldPosition,agt),P=h.dot(v,E);if(P>0&&P<1){let R=M.acosClamped(P),F=h.cross(v,E,cgt),U=Math.abs(R)>M.toRadians(20)?C.positionCartographic.height*.75:C.positionCartographic.height-m,k=m/U;C.rotate(F,R*k)}}}}e._rotatingZoom=!I}if(!T&&I||S){let O,B=rr.wgs84ToWindowCoordinates(x,e._zoomWorldPosition,ngt);A!==te.COLUMBUS_VIEW&&W.equals(t,e._zoomMouseStart)&&l(B)?O=C.getPickRay(B,U4):O=C.getPickRay(t,U4);let L=O.direction;(A===te.COLUMBUS_VIEW||A===te.SCENE2D)&&h.fromElements(L.y,L.z,L.x,L),C.move(L,m),e._zoomingOnVector=!0}else C.zoomIn(m);e._cameraUnderground||C.setView(RY)}var Cgt=new En,Agt=new En,Tgt=new h;function bgt(e,t,n){let r=e._scene.camera,o=r.getPickRay(n.startPosition,Cgt).origin,s=r.getPickRay(n.endPosition,Agt).origin;o=h.fromElements(o.y,o.z,o.x,o),s=h.fromElements(s.y,s.z,s.x,s);let a=h.subtract(o,s,Tgt),c=h.magnitude(a);c>0&&(h.normalize(a,a),r.move(a,c))}function Zye(e,t,n){l(n.distance)&&(n=n.distance);let r=e._scene.camera;UY(e,t,n,e._zoomFactor,r.getMagnitude())}var Egt=new W,Sgt=new W;function Jye(e,t,n){if(l(n.angleAndHeight)){wgt(e,t,n.angleAndHeight);return}let i=e._scene,r=i.camera,o=i.canvas,s=o.clientWidth,a=o.clientHeight,c=Egt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=W.normalize(c,c);let u=Sgt;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=W.normalize(u,u);let f=M.acosClamped(c.x);c.y<0&&(f=M.TWO_PI-f);let d=M.acosClamped(u.x);u.y<0&&(d=M.TWO_PI-d);let p=d-f;r.twistRight(p)}function wgt(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let r=e._scene,o=r.camera,s=r.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;o.twistRight(c)}function vgt(e){let t=e._scene.mapMode2D===bu.ROTATE;N.equals(N.IDENTITY,e._scene.camera.transform)?(jc(e,e.enableTranslate,e.translateEventTypes,bgt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),jc(e,e.enableZoom,e.zoomEventTypes,Zye,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&jc(e,e.enableRotate,e.tiltEventTypes,Jye,e.inertiaSpin,"_lastInertiaTiltMovement")):(jc(e,e.enableZoom,e.zoomEventTypes,Zye,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&jc(e,e.enableRotate,e.translateEventTypes,Jye,e.inertiaSpin,"_lastInertiaSpinMovement"))}var ixe=new En,Dgt=new h,Pgt=new h;function q0(e,t,n){let i=e._scene,r=e._globe,o=i.camera;if(!l(r))return;let s=!e._cameraUnderground,a;i.pickPositionSupported&&(a=i.pickPositionWorldCoordinates(t,Dgt));let c=o.getPickRay(t,ixe),u=r.pickWorldCoordinates(c,i,s,Pgt),f=l(a)?h.distance(a,o.positionWC):Number.POSITIVE_INFINITY,d=l(u)?h.distance(u,o.positionWC):Number.POSITIVE_INFINITY;return f<d?h.clone(a,n):h.clone(u,n)}var Igt=new me;function q4(e){let t=e._ellipsoid,n=e._scene,i=n.camera,r=n.mode,o=0;if(r===te.SCENE3D){let c=t.cartesianToCartographic(i.position,Igt);l(c)&&(o=c.height)}else o=i.position.z;let s=y(e._scene.globeHeight,0);return Math.abs(s-o)}var Ogt=new h;function rxe(e,t){let n=t.origin,i=t.direction,r=q4(e),o=h.normalize(n,Ogt),s=Math.abs(h.dot(o,i));return s=Math.max(s,.5)*2,r*s}function oxe(e,t,n,i){let r=h.distance(t.origin,n),o=q4(e),s=M.clamp(o*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return r>s&&(r=Math.min(r,o/5),r=Math.max(r,100)),En.getPoint(t,r,i)}function sxe(e,t,n,i){let r;return l(n)?(r=h.distance(t.origin,n),r>e._maximumUndergroundPickDistance&&(r=q4(e))):r=q4(e),En.getPoint(t,r,i)}var Rgt=new W;function axe(e,t){let n=t.endPosition,i=W.subtract(t.endPosition,t.startPosition,Rgt),r=e._strafeEndMousePosition;W.add(r,i,r),t.endPosition=r,zY(e,t,e._strafeStartPosition),t.endPosition=n}var Qye=new En,Mgt=new En,MY=new h,Bgt=new h,Lgt=new h,Ngt=new h,Fgt=new an(h.UNIT_X,0),Vgt=new W,kgt=new W;function Ugt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){Iu(e,t,n);return}if(e._strafing){axe(e,n);return}let r=e._scene.camera,o=e._cameraUnderground,s=W.clone(n.startPosition,Vgt),a=W.clone(n.endPosition,kgt),c=r.getPickRay(s,Qye),u=h.clone(h.ZERO,Ngt),f=h.UNIT_X,d;if(r.position.z<e._minimumPickingTerrainHeight&&(d=q0(e,s,MY),l(d)&&(u.x=d.x)),o||u.x>r.position.z&&l(d)){let T=d;o&&(T=sxe(e,c,d,MY)),W.clone(t,e._strafeMousePosition),W.clone(t,e._strafeEndMousePosition),h.clone(T,e._strafeStartPosition),e._strafing=!0,zY(e,n,e._strafeStartPosition);return}let p=an.fromPointNormal(u,f,Fgt);c=r.getPickRay(s,Qye);let g=er.rayPlane(c,p,MY),m=r.getPickRay(a,Mgt),x=er.rayPlane(m,p,Bgt);if(!l(g)||!l(x)){e._looking=!0,Iu(e,t,n),W.clone(t,e._translateMousePosition);return}let C=h.subtract(g,x,Lgt),A=C.x;C.x=C.y,C.y=C.z,C.z=A;let b=h.magnitude(C);b>M.EPSILON6&&(h.normalize(C,C),r.move(C,b))}var cxe=new W,H4=new En,G4=new h,zgt=new h,lxe=new N,Hgt=new N,Ggt=new h,Wgt=new an(h.UNIT_X,0),BY=new h,FY=new me,uxe=new N,jgt=new Re,qgt=new Q,W4=new h;function Ygt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),W.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){Iu(e,t,n);return}let r=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(r.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,Xgt(e,t,n)):Kgt(e,t,n)}function Xgt(e,t,n){let i=e._scene,r=i.camera,o=i.canvas,s=cxe;s.x=o.clientWidth/2,s.y=o.clientHeight/2;let a=r.getPickRay(s,H4),c=h.UNIT_X,u=a.origin,f=a.direction,d,p=h.dot(c,f);if(Math.abs(p)>M.EPSILON6&&(d=-h.dot(c,u)/p),!l(d)||d<=0){e._looking=!0,Iu(e,t,n),W.clone(t,e._tiltCenterMousePosition);return}let g=h.multiplyByScalar(f,d,G4);h.add(u,g,g);let m=i.mapProjection,x=m.ellipsoid;h.fromElements(g.y,g.z,g.x,g);let C=m.unproject(g,FY);x.cartographicToCartesian(C,g);let A=yt.eastNorthUpToFixedFrame(g,x,lxe),b=e._globe,T=e._ellipsoid;e._globe=void 0,e._ellipsoid=oe.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=N.clone(r.transform,uxe);r._setTransform(A),Pu(e,t,n,h.UNIT_Z),r._setTransform(S),e._globe=b,e._ellipsoid=T;let w=T.maximumRadius;e._rotateFactor=1/w,e._rotateRateRangeAdjustment=w}function Kgt(e,t,n){let i=e._scene,r=i.camera,o=e._cameraUnderground,s,a,c=h.UNIT_X;if(W.equals(t,e._tiltCenterMousePosition))s=h.clone(e._tiltCenter,G4);else{if(r.position.z<e._minimumPickingTerrainHeight&&(s=q0(e,t,G4)),!l(s)){a=r.getPickRay(t,H4);let _=a.origin,E=a.direction,v,P=h.dot(c,E);if(Math.abs(P)>M.EPSILON6&&(v=-h.dot(c,_)/P),!l(v)||v<=0){e._looking=!0,Iu(e,t,n),W.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(E,v,G4),h.add(_,s,s)}o&&(l(a)||(a=r.getPickRay(t,H4)),oxe(e,a,s,s)),W.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let u=i.canvas,f=cxe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=r.getPickRay(f,H4);let d=h.clone(h.ZERO,Ggt);d.x=s.x;let p=an.fromPointNormal(d,c,Wgt),g=er.rayPlane(a,p,zgt),m=r._projection,x=m.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let C=m.unproject(s,FY);x.cartographicToCartesian(C,s);let A=yt.eastNorthUpToFixedFrame(s,x,lxe),b;l(g)?(h.fromElements(g.y,g.z,g.x,g),C=m.unproject(g,FY),x.cartographicToCartesian(C,g),b=yt.eastNorthUpToFixedFrame(g,x,Hgt)):b=A;let T=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=oe.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let w=h.UNIT_Z,D=N.clone(r.transform,uxe);r._setTransform(A);let I=h.cross(h.UNIT_Z,h.normalize(r.position,BY),BY),O=h.dot(r.right,I);if(Pu(e,t,n,w,!1,!0),r._setTransform(b),O<0){let _=n.startPosition.y-n.endPosition.y;(o&&_<0||!o&&_>0)&&(w=void 0);let E=r.constrainedAxis;r.constrainedAxis=void 0,Pu(e,t,n,w,!0,!1),r.constrainedAxis=E}else Pu(e,t,n,w,!0,!1);if(l(r.constrainedAxis)){let _=h.cross(r.direction,r.constrainedAxis,W4);h.equalsEpsilon(_,h.ZERO,M.EPSILON6)||(h.dot(_,r.right)<0&&h.negate(_,_),h.cross(_,r.direction,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.up,r.up),h.normalize(r.right,r.right))}r._setTransform(D),e._globe=T,e._ellipsoid=S;let B=S.maximumRadius;e._rotateFactor=1/B,e._rotateRateRangeAdjustment=B;let L=h.clone(r.positionWC,BY);if(e.enableCollisionDetection&&WY(e),!h.equals(r.positionWC,L)){r._setTransform(b),r.worldToCameraCoordinatesPoint(L,L);let _=h.magnitudeSquared(L);h.magnitudeSquared(r.position)>_&&(h.normalize(r.position,r.position),h.multiplyByScalar(r.position,Math.sqrt(_),r.position));let E=h.angleBetween(L,r.position),v=h.cross(L,r.position,L);h.normalize(v,v);let P=Re.fromAxisAngle(v,E,jgt),R=Q.fromQuaternion(P,qgt);Q.multiplyByVector(R,r.direction,r.direction),Q.multiplyByVector(R,r.up,r.up),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up),r._setTransform(D)}}var fxe=new W,dxe=new En,hxe=new h;function $gt(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,r=i.camera,o=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=fxe,a.x=o.clientWidth/2,a.y=o.clientHeight/2);let c=r.getPickRay(a,dxe),u=c.origin,f=c.direction,d=r.position.z,p;d<e._minimumPickingTerrainHeight&&(p=q0(e,a,hxe));let g;if(l(p)&&(g=h.distance(u,p)),s){let m=rxe(e,c,d);l(g)?g=Math.min(g,m):g=m}if(!l(g)){let m=h.UNIT_X;g=-h.dot(m,u)/h.dot(m,f)}UY(e,t,n,e._zoomFactor,g)}function Zgt(e){let n=e._scene.camera;if(!N.equals(N.IDENTITY,n.transform))jc(e,e.enableRotate,e.rotateEventTypes,Pu,e.inertiaSpin,"_lastInertiaSpinMovement"),jc(e,e.enableZoom,e.zoomEventTypes,mxe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),jc(e,e.enableTilt,e.tiltEventTypes,Ygt,e.inertiaSpin,"_lastInertiaTiltMovement"),jc(e,e.enableTranslate,e.translateEventTypes,Ugt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),jc(e,e.enableZoom,e.zoomEventTypes,$gt,e.inertiaZoom,"_lastInertiaZoomMovement"),jc(e,e.enableLook,e.lookEventTypes,Iu),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let r=n.createCorrectPositionTween(e.bounceAnimationTime);l(r)&&(e._tween=i.add(r))}i.update()}}var Jgt=new En,Qgt=new an(h.UNIT_X,0),e0t=new h,t0t=new h,n0t=new h;function zY(e,t,n){let i=e._scene,r=i.camera,o=r.getPickRay(t.endPosition,Jgt),s=h.clone(r.direction,t0t);i.mode===te.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=an.fromPointNormal(n,s,Qgt),c=er.rayPlane(o,a,e0t);!l(c)||(s=h.subtract(n,c,s),i.mode===te.COLUMBUS_VIEW&&h.fromElements(s.y,s.z,s.x,s),h.add(r.position,s,r.position))}var exe=new h,i0t=new me,VY=new h,kY=new oe,r0t=new h,o0t=new h;function s0t(e,t,n){let r=e._scene.camera,o=e._cameraUnderground,s=e._ellipsoid;if(!N.equals(r.transform,N.IDENTITY)){Pu(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(r.position,r0t);if(W.equals(t,e._rotateMousePosition)){if(e._looking)Iu(e,t,n,u);else if(e._rotating)Pu(e,t,n);else if(e._strafing)axe(e,n);else{if(h.magnitude(r.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=VY,c.x=c.y=c.z=a,s=oe.fromCartesian3(c,kY),NY(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(r.positionWC,i0t).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=q0(e,n.startPosition,n0t);if(l(p)){let g=!1,m=r.getPickRay(n.startPosition,ixe);if(o)g=!0,sxe(e,m,p,p);else{let x=s.geodeticSurfaceNormal(p,o0t);Math.abs(h.dot(m.direction,x))<.05?g=!0:g=h.magnitude(r.position)<h.magnitude(p)}g?(W.clone(t,e._strafeEndMousePosition),h.clone(p,e._strafeStartPosition),e._strafing=!0,zY(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=VY,c.x=c.y=c.z=a,s=oe.fromCartesian3(c,kY),NY(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,Iu(e,t,n,u)}else l(r.pickEllipsoid(n.startPosition,e._ellipsoid,exe))?(NY(e,t,n,e._ellipsoid),h.clone(exe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,Pu(e,t,n)):(e._looking=!0,Iu(e,t,n,u));W.clone(t,e._rotateMousePosition)}function Pu(e,t,n,i,r,o){r=y(r,!1),o=y(o,!1);let s=e._scene,a=s.camera,c=s.canvas,u=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let f=h.magnitude(a.position),d=e._rotateFactor*(f-e._rotateRateRangeAdjustment);d>e._maximumRotateRate&&(d=e._maximumRotateRate),d<e._minimumRotateRate&&(d=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,g=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let m=d*p*Math.PI*2,x=d*g*Math.PI;r||a.rotateRight(m),o||a.rotateUp(x),a.constrainedAxis=u}var a0t=se.clone(se.UNIT_W),c0t=se.clone(se.UNIT_W),z4=new h,LY=new h,l0t=new h,u0t=new h,f0t=new W,d0t=new W;function NY(e,t,n,i){let o=e._scene.camera,s=W.clone(n.startPosition,f0t),a=W.clone(n.endPosition,d0t),c=o.pickEllipsoid(s,i,a0t),u=o.pickEllipsoid(a,i,c0t);if(!l(c)||!l(u)){e._rotating=!0,Pu(e,t,n);return}if(c=o.worldToCameraCoordinates(c,c),u=o.worldToCameraCoordinates(u,u),l(o.constrainedAxis)){let f=o.constrainedAxis,d=h.mostOrthogonalAxis(f,z4);h.cross(d,f,d),h.normalize(d,d);let p=h.cross(f,d,LY),g=h.magnitude(c),m=h.dot(f,c),x=Math.acos(m/g),C=h.multiplyByScalar(f,m,l0t);h.subtract(c,C,C),h.normalize(C,C);let A=h.magnitude(u),b=h.dot(f,u),T=Math.acos(b/A),S=h.multiplyByScalar(f,b,u0t);h.subtract(u,S,S),h.normalize(S,S);let w=Math.acos(h.dot(C,d));h.dot(C,p)<0&&(w=M.TWO_PI-w);let D=Math.acos(h.dot(S,d));h.dot(S,p)<0&&(D=M.TWO_PI-D);let I=w-D,O;h.equalsEpsilon(f,o.position,M.EPSILON2)?O=o.right:O=h.cross(f,o.position,z4);let B=h.cross(f,O,z4),L=h.dot(B,h.subtract(c,f,LY)),_=h.dot(B,h.subtract(u,f,LY)),E;L>0&&_>0?E=T-x:L>0&&_<=0?h.dot(o.position,f)>0?E=-x-T:E=x+T:E=x-T,o.rotateRight(I),o.rotateUp(E)}else{h.normalize(c,c),h.normalize(u,u);let f=h.dot(c,u),d=h.cross(c,u,z4);if(f<1&&!h.equalsEpsilon(d,h.ZERO,M.EPSILON14)){let p=Math.acos(f);o.rotate(d,p)}}}var h0t=new h,m0t=new me;function mxe(e,t,n){l(n.distance)&&(n=n.distance);let i=e._ellipsoid,r=e._scene,o=r.camera,s=r.canvas,a=e._cameraUnderground,c;a?c=t:(c=fxe,c.x=s.clientWidth/2,c.y=s.clientHeight/2);let u=o.getPickRay(c,dxe),f,d=i.cartesianToCartographic(o.position,m0t).height;d<e._minimumPickingTerrainHeight&&(f=q0(e,c,hxe));let p;if(l(f)&&(p=h.distance(u.origin,f)),a){let m=rxe(e,u,d);l(p)?p=Math.min(p,m):p=m}l(p)||(p=d);let g=h.normalize(o.position,h0t);UY(e,t,n,e._zoomFactor,p,h.dot(g,o.direction))}var pxe=new W,j4=new En,U1=new h,p0t=new h,_xe=new N,_0t=new N,gxe=new N,g0t=new Re,y0t=new Q,HY=new me,GY=new h;function x0t(e,t,n){let r=e._scene.camera;if(!N.equals(r.transform,N.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),W.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(r.position,GY);Iu(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(r.position,HY);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,A0t(e,t,n)):T0t(e,t,n)}var C0t=new me;function A0t(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(o.positionWC,C0t).height;if(a-s-1<M.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=r.canvas,u=pxe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=o.getPickRay(u,j4),d,p=er.rayEllipsoid(f,i);if(l(p))d=En.getPoint(f,p.start,U1);else if(a>e._minimumTrackBallHeight){let b=er.grazingAltitudeLocation(f,i);if(!l(b))return;let T=i.cartesianToCartographic(b,HY);T.height=0,d=i.cartographicToCartesian(T,U1)}else{e._looking=!0;let b=e._ellipsoid.geodeticSurfaceNormal(o.position,GY);Iu(e,t,n,b),W.clone(t,e._tiltCenterMousePosition);return}let g=yt.eastNorthUpToFixedFrame(d,i,_xe),m=e._globe,x=e._ellipsoid;e._globe=void 0,e._ellipsoid=oe.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let C=N.clone(o.transform,gxe);o._setTransform(g),Pu(e,t,n,h.UNIT_Z),o._setTransform(C),e._globe=m,e._ellipsoid=x;let A=x.maximumRadius;e._rotateFactor=1/A,e._rotateRateRangeAdjustment=A}function T0t(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e._cameraUnderground,a,c,u;if(W.equals(t,e._tiltCenterMousePosition))a=h.clone(e._tiltCenter,U1);else{if(a=q0(e,t,U1),!l(a)){if(c=o.getPickRay(t,j4),u=er.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(o.position,HY).height<=e._minimumTrackBallHeight){e._looking=!0;let E=e._ellipsoid.geodeticSurfaceNormal(o.position,GY);Iu(e,t,n,E),W.clone(t,e._tiltCenterMousePosition)}return}a=En.getPoint(c,u.start,U1)}s&&(l(c)||(c=o.getPickRay(t,j4)),oxe(e,c,a,a)),W.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let f=r.canvas,d=pxe;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=o.getPickRay(d,j4);let p=h.magnitude(a),g=h.fromElements(p,p,p,VY),m=oe.fromCartesian3(g,kY);if(u=er.rayEllipsoid(c,m),!l(u))return;let x=h.magnitude(c.origin)>p?u.start:u.stop,C=En.getPoint(c,x,p0t),A=yt.eastNorthUpToFixedFrame(a,i,_xe),b=yt.eastNorthUpToFixedFrame(C,m,_0t),T=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=oe.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let w=h.UNIT_Z,D=N.clone(o.transform,gxe);o._setTransform(b);let I=h.cross(C,o.positionWC,W4);if(h.dot(o.rightWC,I)<0){let _=n.startPosition.y-n.endPosition.y;(s&&_<0||!s&&_>0)&&(w=void 0);let E=o.constrainedAxis;o.constrainedAxis=void 0,Pu(e,t,n,w,!0,!1),o.constrainedAxis=E}else Pu(e,t,n,w,!0,!1);if(o._setTransform(A),Pu(e,t,n,w,!1,!0),l(o.constrainedAxis)){let _=h.cross(o.direction,o.constrainedAxis,W4);h.equalsEpsilon(_,h.ZERO,M.EPSILON6)||(h.dot(_,o.right)<0&&h.negate(_,_),h.cross(_,o.direction,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.up,o.up),h.normalize(o.right,o.right))}o._setTransform(D),e._globe=T,e._ellipsoid=S;let B=S.maximumRadius;e._rotateFactor=1/B,e._rotateRateRangeAdjustment=B;let L=h.clone(o.positionWC,W4);if(e.enableCollisionDetection&&WY(e),!h.equals(o.positionWC,L)){o._setTransform(b),o.worldToCameraCoordinatesPoint(L,L);let _=h.magnitudeSquared(L);h.magnitudeSquared(o.position)>_&&(h.normalize(o.position,o.position),h.multiplyByScalar(o.position,Math.sqrt(_),o.position));let E=h.angleBetween(L,o.position),v=h.cross(L,o.position,L);h.normalize(v,v);let P=Re.fromAxisAngle(v,E,g0t),R=Q.fromQuaternion(P,y0t);Q.multiplyByVector(R,o.direction,o.direction),Q.multiplyByVector(R,o.up,o.up),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up),o._setTransform(D)}}var b0t=new W,E0t=new W,txe=new En,nxe=new En,S0t=new h,w0t=new h;function Iu(e,t,n,i){let o=e._scene.camera,s=b0t;s.x=n.startPosition.x,s.y=0;let a=E0t;a.x=n.endPosition.x,a.y=0;let c=o.getPickRay(s,txe),u=o.getPickRay(a,nxe),f=0,d,p;o.frustum instanceof en?(d=c.origin,p=u.origin,h.add(o.direction,d,d),h.add(o.direction,p,p),h.subtract(d,o.position,d),h.subtract(p,o.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction);let g=h.dot(d,p);g<1&&(f=Math.acos(g)),f=n.startPosition.x>n.endPosition.x?-f:f;let m=e._horizontalRotationAxis;if(l(i)?o.look(i,-f):l(m)?o.look(m,-f):o.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=o.getPickRay(s,txe),u=o.getPickRay(a,nxe),f=0,o.frustum instanceof en?(d=c.origin,p=u.origin,h.add(o.direction,d,d),h.add(o.direction,p,p),h.subtract(d,o.position,d),h.subtract(p,o.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction),g=h.dot(d,p),g<1&&(f=Math.acos(g)),f=n.startPosition.y>n.endPosition.y?-f:f,i=y(i,m),l(i)){let x=o.direction,C=h.negate(i,S0t),A=h.equalsEpsilon(x,i,M.EPSILON2),b=h.equalsEpsilon(x,C,M.EPSILON2);if(!A&&!b){g=h.dot(x,i);let T=M.acosClamped(g);f>0&&f>T&&(f=T-M.EPSILON4),g=h.dot(x,C),T=M.acosClamped(g),f<0&&-f>T&&(f=-T+M.EPSILON4);let S=h.cross(i,x,w0t);o.look(S,f)}else(A&&f<0||b&&f>0)&&o.look(o.right,-f)}else o.lookUp(f)}function v0t(e){jc(e,e.enableRotate,e.rotateEventTypes,s0t,e.inertiaSpin,"_lastInertiaSpinMovement"),jc(e,e.enableZoom,e.zoomEventTypes,mxe,e.inertiaZoom,"_lastInertiaZoomMovement"),jc(e,e.enableTilt,e.tiltEventTypes,x0t,e.inertiaSpin,"_lastInertiaTiltMovement"),jc(e,e.enableLook,e.lookEventTypes,Iu)}var D0t=new N,P0t=new me;function WY(e){e._adjustedHeightForTerrain=!0;let t=e._scene,n=t.mode,i=t.globe;if(!l(i)||n===te.SCENE2D||n===te.MORPHING)return;let r=t.camera,o=i.ellipsoid,s=t.mapProjection,a,c;N.equals(r.transform,N.IDENTITY)||(a=N.clone(r.transform,D0t),c=h.magnitude(r.position),r._setTransform(N.IDENTITY));let u=P0t;n===te.SCENE3D?o.cartesianToCartographic(r.position,u):s.unproject(r.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let d=e._scene.globeHeight;if(l(d)){let p=d+e.minimumZoomDistance;u.height<p&&(u.height=p,n===te.SCENE3D?o.cartographicToCartesian(u,r.position):s.project(u,r.position),f=!0)}}l(a)&&(r._setTransform(a),f&&(h.normalize(r.position,r.position),h.negate(r.position,r.direction),h.multiplyByScalar(r.position,Math.max(c,e.minimumZoomDistance),r.position),h.normalize(r.direction,r.direction),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up)))}z1.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===te.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var I0t=new h,O0t=new h;z1.prototype.update=function(){let e=this._scene,t=e.camera,n=e.globe,i=e.mode;N.equals(t.transform,N.IDENTITY)?(this._globe=n,this._ellipsoid=l(this._globe)?this._globe.ellipsoid:e.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=oe.UNIT_SPHERE);let r=l(this._globe)?this._globe.terrainExaggeration:1,o=l(this._globe)?this._globe.terrainExaggerationRelativeHeight:0;this._minimumCollisionTerrainHeight=el.getHeight(this.minimumCollisionTerrainHeight,r,o),this._minimumPickingTerrainHeight=el.getHeight(this.minimumPickingTerrainHeight,r,o),this._minimumTrackBallHeight=el.getHeight(this.minimumTrackBallHeight,r,o),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=h.clone(t.positionWC,I0t),c=h.clone(t.directionWC,O0t);i===te.SCENE2D?vgt(this):i===te.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,Zgt(this)):i===te.SCENE3D&&(this._horizontalRotationAxis=void 0,v0t(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain&&(!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC))&&WY(this),this._aggregator.reset()};z1.prototype.isDestroyed=function(){return!1};z1.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ue(this)};var Y4=z1;var X4=`uniform sampler2D colorTexture;
- uniform sampler2D colorTexture2;
- uniform vec2 center;
- uniform float radius;
- varying vec2 v_textureCoordinates;
- void main()
- {
- vec4 color0 = texture2D(colorTexture, v_textureCoordinates);
- vec4 color1 = texture2D(colorTexture2, v_textureCoordinates);
- float x = length(gl_FragCoord.xy - center) / radius;
- float t = smoothstep(0.5, 0.8, x);
- gl_FragColor = mix(color0 + color1, color1, t);
- }
- `;var K4=`uniform sampler2D colorTexture;
- uniform float avgLuminance;
- uniform float threshold;
- uniform float offset;
- varying vec2 v_textureCoordinates;
- float key(float avg)
- {
- float guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));
- return max(0.0, guess) + 0.1;
- }
- void main()
- {
- vec4 color = texture2D(colorTexture, v_textureCoordinates);
- vec3 xyz = czm_RGBToXYZ(color.rgb);
- float luminance = xyz.r;
- float scaledLum = key(avgLuminance) * luminance / avgLuminance;
- float brightLum = max(scaledLum - threshold, 0.0);
- float brightness = brightLum / (offset + brightLum);
- xyz.r = brightness;
- gl_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);
- }
- `;function u_(){this._sceneFramebuffer=new VE;let e=.125,t=new Array(6);t[0]=new Sr({fragmentShader:vu,textureScale:e,forcePowerOfTwo:!0,sampleMode:kf.LINEAR});let n=t[1]=new Sr({fragmentShader:K4,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new W,t[2]=new Sr({fragmentShader:xC,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new Sr({fragmentShader:xC,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new Sr({fragmentShader:vu,sampleMode:kf.LINEAR}),this._uCenter=new W,this._uRadius=void 0,t[5]=new Sr({fragmentShader:X4,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new Ml({stages:t});let r=new GE(this),o=t.length;for(let s=0;s<o;++s)t[s]._textureCache=r;this._textureCache=r,this.length=t.length}u_.prototype.get=function(e){return this._stages.get(e)};u_.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var R0t=new se,yxe=new W,M0t=new W,xxe=new N;function B0t(e,t,n){let i=t.uniformState,r=i.sunPositionWC,o=i.view,s=i.viewProjection,a=i.projection,c=N.computeViewportTransformation(n,0,1,xxe),u=N.multiplyByPoint(o,r,R0t),f=yt.pointToGLWindowCoordinates(s,c,r,yxe);u.x+=M.SOLAR_RADIUS;let d=yt.pointToGLWindowCoordinates(a,c,u,u),p=W.magnitude(W.subtract(d,f,d))*30*2,g=M0t;g.x=p,g.y=p,e._uCenter=W.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let m=t.drawingBufferWidth,x=t.drawingBufferHeight,C=e._stages,A=C.get(0),b=A.outputTexture.width,T=A.outputTexture.height,S=new je;S.width=b,S.height=T,c=N.computeViewportTransformation(S,0,1,xxe),f=yt.pointToGLWindowCoordinates(s,c,r,yxe),g.x*=b/m,g.y*=T/x;let w=A.scissorRectangle;w.x=Math.max(f.x-g.x*.5,0),w.y=Math.max(f.y-g.y*.5,0),w.width=Math.min(g.x,m),w.height=Math.min(g.y,x);for(let D=1;D<4;++D)je.clone(w,C.get(D).scissorRectangle)}u_.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};u_.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let r=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),B0t(this,t,n),r};u_.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let r=1;r<i;++r)n.get(r).execute(e,n.get(r-1).outputTexture)};u_.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(vu,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};u_.prototype.isDestroyed=function(){return!1};u_.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ue(this)};var $4=u_;var J4=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function Ki(e){e=y(e,y.EMPTY_OBJECT);let t=e.canvas,n=e.creditContainer,i=e.creditViewport,r=$e(e.contextOptions);l(r)||(r={}),l(r.webgl)||(r.webgl={}),r.webgl.powerPreference=y(r.webgl.powerPreference,"high-performance");let o=l(n),s=new pk(t,r);o||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=Ln(),this._jobScheduler=new ZU,this._frameState=new gU(s,new Qk(n," \u2022 ",i),this._jobScheduler),this._frameState.scene3DOnly=y(e.scene3DOnly,!1),this._removeCreditContainer=!o,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new fk(s),this._globe=void 0,this._globeTranslucencyState=new KU,this._primitives=new du,this._groundPrimitives=new du,this._globeHeight=void 0,this._cameraUnderground=!1,this._logDepthBuffer=s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new WE,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=y(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new aU(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new li({color:new z,stencil:0,owner:this}),this._depthClearCommand=new li({depth:1,owner:this}),this._stencilClearCommand=new li({stencil:0}),this._classificationStencilClearCommand=new li({stencil:0,renderState:Ve.fromCache({stencilMask:tn.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new V4(this),this._preUpdate=new ge,this._postUpdate=new ge,this._renderError=new ge,this._preRender=new ge,this._postRender=new ge,this._minimumDisableDepthTestDistance=0,this._debugInspector=new tU,this._msaaSamples=y(e.msaaSamples,1),this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new ge,this.morphComplete=new ge,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=z.clone(z.BLACK),this._mode=te.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Ii,this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.fog=new pU,this._shadowMapCamera=new _r(this),this.shadowMap=new W0({context:s,lightCamera:this._shadowMapCamera,enabled:y(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=z.clone(z.WHITE),this._actualInvertClassificationColor=z.clone(this._invertClassificationColor),this._invertClassification=new v1,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new N4,this._brdfLutGenerator=new bk,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new Y4(this),this._cameraUnderground=!1,this._mapMode2D=y(e.mapMode2D,bu.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=y(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=y(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=uc.requestCompletedEvent.addEventListener(J4(this)),this._removeTaskProcessorListenerCallback=Mi.taskCompletedEvent.addEventListener(J4(this)),this._removeGlobeCallbacks=[];let a=new je(0,0,s.drawingBufferWidth,s.drawingBufferHeight),c=new _r(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new _r(this),this.preloadFlightCullingVolume=void 0,this._picking=new _4(this),this._defaultView=new UE(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentMapAtlas=void 0,this.light=new I0,bxe(this,0,ee.now()),this.updateFrameState(),this.initializeFrame()}function L0t(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(J4(e))),n.push(t.terrainProviderChanged.addEventListener(J4(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(Ki.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return Bt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Bt.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return Xl.isSupported(this._context)}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,L0t(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(!!l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(!!l(this.globe))return this.globe.terrainProvider},set:function(e){l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(!!l(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===te.SCENE2D?this.morphTo2D(0):e===te.SCENE3D?this.morphTo3D(0):e===te.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new _r(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new lU(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,Bt.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});Ki.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function Cxe(e,t,n){let i=e._frameState,r=e._context,o=e._view.oit,s=i.shadowState.lightShadowMaps,a=i.shadowState.lightShadowsEnabled,c=t.derivedCommands;l(t.pickId)&&(c.picking=V0.createPickDerivedCommand(e,t,r,c.picking)),t.pickOnly||(c.depth=V0.createDepthOnlyDerivedCommand(e,t,r,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=V0.createHdrCommand(t,r,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=W0.createReceiveDerivedCommand(s,t,n,r,c.shadows)),t.pass===Ce.TRANSLUCENT&&l(o)&&o.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=o.createDerivedCommands(c.shadows.receiveCommand,r,c.oit.shadows)):c.oit=o.createDerivedCommands(t,r,c.oit))}Ki.prototype.updateDerivedCommands=function(e){if(!l(e.derivedCommands))return;let t=this._frameState,n=this._context,i=!1,r=t.shadowState.lastDirtyTime;e.lastDirtyTime!==r&&(e.lastDirtyTime=r,e.dirty=!0,i=!0);let o=t.useLogDepth,s=this._hdr,a=e.derivedCommands,c=l(a.logDepth),u=l(a.hdr),f=l(a.originalCommand),d=o&&!c,p=s&&!u,g=(!o||!s)&&!f;if(e.dirty=e.dirty||d||p||g,e.dirty){e.dirty=!1;let m=t.shadowState.shadowMaps;t.shadowState.shadowsEnabled&&e.castShadows&&(a.shadows=W0.createCastDerivedCommand(m,e,i,n,a.shadows)),(c||d)&&(a.logDepth=V0.createLogDepthCommand(e,n,a.logDepth),Cxe(this,a.logDepth.command,i)),(f||g)&&Cxe(this,e,i)}};var N0t=new Kd({pass:mo.RENDER}),jY=new Kd({pass:mo.PRELOAD}),qY=new Kd({pass:mo.PRELOAD_FLIGHT}),F0t=new Kd({pass:mo.REQUEST_RENDER_MODE_DEFER_CHECK}),Axe=new re,YY;function V0t(e){let t=e.globe;if(e._mode===te.SCENE3D&&l(t)&&t.show&&!e._cameraUnderground&&!e._globeTranslucencyState.translucent){let n=t.ellipsoid,i=e.frameState.minimumTerrainHeight;return Axe.radius=n.minimumRadius+i,YY=DO.fromBoundingSphere(Axe,e.camera.positionWC,YY),YY}}Ki.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function bxe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=ee.clone(n,i.time)}Ki.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=V0t(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof en||this.camera.frustum instanceof Xo),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState,l(this.globe)&&(t.terrainExaggeration=this.globe.terrainExaggeration,t.terrainExaggerationRelativeHeight=this.globe.terrainExaggerationRelativeHeight),l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready?(t.specularEnvironmentMaps=this._specularEnvironmentMapAtlas.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentMapAtlas.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=z.clone(this.invertClassificationColor,this._actualInvertClassificationColor),v1.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};Ki.prototype.isVisible=function(e,t,n){return l(e)&&(!l(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==Jt.OUTSIDE&&(!l(n)||!e.occlude||!e.boundingVolume.isOccluded(n)))};var Z4=new N(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);Z4=N.inverseTransformation(Z4,Z4);function k0t(e,t,n,i){let r=t._frameState,o=r.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a,c=h.clone(s.center);if(r.mode!==te.SCENE3D){c=N.multiplyByPoint(Z4,c,c);let p=r.mapProjection,g=p.unproject(c);c=p.ellipsoid.cartographicToCartesian(g)}if(l(s.radius)){let p=s.radius;a=Bn.toWireframe(Us.createGeometry(new Us({radii:new h(p,p,p),vertexFormat:rn.FLAT_VERTEX_FORMAT}))),t._debugVolume=new Tn({geometryInstances:new pt({geometry:a,modelMatrix:N.fromTranslation(c),attributes:{color:new Ot(1,0,0,1)}}),appearance:new rn({flat:!0,translucent:!1}),asynchronous:!1})}else{let p=s.halfAxes;a=Bn.toWireframe(Vl.createGeometry(Vl.fromDimensions({dimensions:new h(2,2,2),vertexFormat:rn.FLAT_VERTEX_FORMAT}))),t._debugVolume=new Tn({geometryInstances:new pt({geometry:a,modelMatrix:N.fromRotationTranslation(p,c,new N),attributes:{color:new Ot(1,0,0,1)}}),appearance:new rn({flat:!0,translucent:!1}),asynchronous:!1})}let u=r.commandList,f=r.commandList=[];t._debugVolume.update(r),e=f[0],r.useLogDepth&&(e=V0.createLogDepthCommand(e,o).command);let d;l(i)&&(d=n.framebuffer,n.framebuffer=i),e.execute(o,n),l(d)&&(n.framebuffer=d),r.commandList=u}function ac(e,t,n,i,r){let o=t._frameState;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof li){e.execute(n,i);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&k0t(e,t,i,r),o.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(n,i);return}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(n,i);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,i);return}o.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(n,i):e.execute(n,i)}function H1(e,t,n,i){let r=t._frameState,o=e.derivedCommands;!l(o)||(r.useLogDepth&&l(o.logDepth)&&(e=o.logDepth.command),o=e.derivedCommands,l(o.picking)?(e=o.picking.pickCommand,e.execute(n,i)):l(o.depth)&&(e=o.depth.depthOnlyCommand,e.execute(n,i)))}function U0t(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function z0t(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+M.EPSILON12}function H0t(e,t,n,i,r){let o=e.context;By(i,U0t,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,o,n);let s=i.length;for(let a=0;a<s;++a)t(i[a],e,o,n)}function G0t(e,t,n,i,r){let o=e.context;By(i,z0t,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,o,n);let s=i.length;for(let a=0;a<s;++a)t(i[a],e,o,n)}var W0t=new bi,j0t=new cl,q0t=new en,Y0t=new Xo;function XY(e,t){let n=e.camera,i=e.context,r=e.frameState,o=i.uniformState;o.updateCamera(n);let s;l(n.frustum.fov)?s=n.frustum.clone(W0t):l(n.frustum.infiniteProjectionMatrix)?s=n.frustum.clone(j0t):l(n.frustum.width)?s=n.frustum.clone(q0t):s=n.frustum.clone(Y0t),s.near=n.frustum.near,s.far=n.frustum.far,o.updateFrustum(s),o.updatePass(Ce.ENVIRONMENT);let a=r.passes,c=a.pick,u=e._environmentState,f=e._view,d=u.renderTranslucentDepthForPick,p=u.useWebVR;if(!c){let E=u.skyBoxCommand;if(l(E)&&ac(E,e,i,t),u.isSkyAtmosphereVisible&&ac(u.skyAtmosphereCommand,e,i,t),u.isSunVisible&&(u.sunDrawCommand.execute(i,t),e.sunBloom&&!p)){let v;u.useGlobeDepthFramebuffer?v=f.globeDepth.framebuffer:u.usePostProcess?v=f.sceneFramebuffer.framebuffer:v=u.originalFramebuffer,e._sunPostProcess.execute(i),e._sunPostProcess.copy(i,v),t.framebuffer=v}u.isMoonVisible&&u.moonCommand.execute(i,t)}let g;u.useOIT?(l(e._executeOITFunction)||(e._executeOITFunction=function(E,v,P,R,F){f.globeDepth.prepareColorTextures(i),f.oit.executeCommands(E,v,P,R,F)}),g=e._executeOITFunction):a.render?g=H0t:g=G0t;let m=f.frustumCommandsList,x=m.length,C=u.clearGlobeDepth,A=u.useDepthPlane,b=e._globeTranslucencyState,T=b.translucent,S=e._view.globeTranslucencyFramebuffer,w=e._depthClearCommand,D=e._stencilClearCommand,I=e._classificationStencilClearCommand,O=e._depthPlane,B=u.usePostProcessSelected,L=n.position.z,_;for(let E=0;E<x;++E){let v=x-E-1,P=m[v];e.mode===te.SCENE2D?(n.position.z=L-P.near+1,s.far=Math.max(1,P.far-P.near),s.near=1,o.update(r),o.updateFrustum(s)):(s.near=v!==0?P.near*e.opaqueFrustumNearOffset:P.near,s.far=P.far,o.updateFrustum(s)),w.execute(i,t),i.stencilBuffer&&D.execute(i,t),o.updatePass(Ce.GLOBE);let R=P.commands[Ce.GLOBE],F=P.indices[Ce.GLOBE];if(T)b.executeGlobeCommands(P,ac,S,e,t);else for(_=0;_<F;++_)ac(R[_],e,i,t);let U=f.globeDepth;if(l(U)&&u.useGlobeDepthFramebuffer&&U.executeCopyDepth(i,t),!u.renderTranslucentDepthForPick)if(o.updatePass(Ce.TERRAIN_CLASSIFICATION),R=P.commands[Ce.TERRAIN_CLASSIFICATION],F=P.indices[Ce.TERRAIN_CLASSIFICATION],T)b.executeGlobeClassificationCommands(P,ac,S,e,t);else for(_=0;_<F;++_)ac(R[_],e,i,t);if(C&&(w.execute(i,t),A&&O.execute(i,t)),!u.useInvertClassification||c||u.renderTranslucentDepthForPick){for(o.updatePass(Ce.CESIUM_3D_TILE),R=P.commands[Ce.CESIUM_3D_TILE],F=P.indices[Ce.CESIUM_3D_TILE],_=0;_<F;++_)ac(R[_],e,i,t);if(F>0&&(l(U)&&u.useGlobeDepthFramebuffer&&(U.prepareColorTextures(i,C),U.executeUpdateDepth(i,t,C,U.depthStencilTexture)),!u.renderTranslucentDepthForPick))for(o.updatePass(Ce.CESIUM_3D_TILE_CLASSIFICATION),R=P.commands[Ce.CESIUM_3D_TILE_CLASSIFICATION],F=P.indices[Ce.CESIUM_3D_TILE_CLASSIFICATION],_=0;_<F;++_)ac(R[_],e,i,t)}else{e._invertClassification.clear(i,t);let q=t.framebuffer;for(t.framebuffer=e._invertClassification._fbo.framebuffer,o.updatePass(Ce.CESIUM_3D_TILE),R=P.commands[Ce.CESIUM_3D_TILE],F=P.indices[Ce.CESIUM_3D_TILE],_=0;_<F;++_)ac(R[_],e,i,t);for(l(U)&&u.useGlobeDepthFramebuffer&&(e._invertClassification.prepareTextures(i),U.executeUpdateDepth(i,t,C,e._invertClassification._fbo.getDepthStencilTexture())),o.updatePass(Ce.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),R=P.commands[Ce.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],F=P.indices[Ce.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],_=0;_<F;++_)ac(R[_],e,i,t);for(t.framebuffer=q,e._invertClassification.executeClassified(i,t),r.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),F>0&&i.stencilBuffer&&I.execute(i,t),o.updatePass(Ce.CESIUM_3D_TILE_CLASSIFICATION),R=P.commands[Ce.CESIUM_3D_TILE_CLASSIFICATION],F=P.indices[Ce.CESIUM_3D_TILE_CLASSIFICATION],_=0;_<F;++_)ac(R[_],e,i,t)}for(F>0&&i.stencilBuffer&&D.execute(i,t),o.updatePass(Ce.OPAQUE),R=P.commands[Ce.OPAQUE],F=P.indices[Ce.OPAQUE],_=0;_<F;++_)ac(R[_],e,i,t);v!==0&&e.mode!==te.SCENE2D&&(s.near=P.near,o.updateFrustum(s));let k;if(!c&&u.useInvertClassification&&r.invertClassificationColor.alpha<1&&(k=e._invertClassification),o.updatePass(Ce.TRANSLUCENT),R=P.commands[Ce.TRANSLUCENT],R.length=P.indices[Ce.TRANSLUCENT],g(e,ac,t,R,k),P.indices[Ce.CESIUM_3D_TILE_CLASSIFICATION]>0&&f.translucentTileClassification.isSupported()&&(f.translucentTileClassification.executeTranslucentCommands(e,ac,t,R,U.depthStencilTexture),f.translucentTileClassification.executeClassificationCommands(e,ac,t,P)),i.depthTexture&&e.useDepthPicking&&(u.useGlobeDepthFramebuffer||d)){let q=U.depthStencilTexture,j=e._picking.getPickDepth(e,v);j.update(i,q),j.executeCopyDepth(i,t)}if(c||!B)continue;let V=t.framebuffer;if(t.framebuffer=f.sceneFramebuffer.getIdFramebuffer(),s.near=v!==0?P.near*e.opaqueFrustumNearOffset:P.near,s.far=P.far,o.updateFrustum(s),o.updatePass(Ce.GLOBE),R=P.commands[Ce.GLOBE],F=P.indices[Ce.GLOBE],T)b.executeGlobeCommands(P,H1,S,e,t);else for(_=0;_<F;++_)H1(R[_],e,i,t);for(C&&(w.framebuffer=t.framebuffer,w.execute(i,t),w.framebuffer=void 0),C&&A&&O.execute(i,t),o.updatePass(Ce.CESIUM_3D_TILE),R=P.commands[Ce.CESIUM_3D_TILE],F=P.indices[Ce.CESIUM_3D_TILE],_=0;_<F;++_)H1(R[_],e,i,t);for(o.updatePass(Ce.OPAQUE),R=P.commands[Ce.OPAQUE],F=P.indices[Ce.OPAQUE],_=0;_<F;++_)H1(R[_],e,i,t);for(o.updatePass(Ce.TRANSLUCENT),R=P.commands[Ce.TRANSLUCENT],F=P.indices[Ce.TRANSLUCENT],_=0;_<F;++_)H1(R[_],e,i,t);t.framebuffer=V}}function Exe(e){e.context.uniformState.updatePass(Ce.COMPUTE);let n=e._environmentState.sunComputeCommand;l(n)&&n.execute(e._computeEngine);let i=e._computeCommandList,r=i.length;for(let o=0;o<r;++o)i[o].execute(e._computeEngine)}function X0t(e,t){e.context.uniformState.updatePass(Ce.OVERLAY);let i=e.context,r=e._overlayCommandList,o=r.length;for(let s=0;s<o;++s)r[s].execute(i,t)}function K0t(e,t,n){let i=n.shadowMapCullingVolume,r=n.isPointLight,o=n.passes,s=o.length,a=t.length;for(let c=0;c<a;++c){let u=t[c];if(e.updateDerivedCommands(u),u.castShadows&&(u.pass===Ce.GLOBE||u.pass===Ce.CESIUM_3D_TILE||u.pass===Ce.OPAQUE||u.pass===Ce.TRANSLUCENT)&&e.isVisible(u,i))if(r)for(let f=0;f<s;++f)o[f].commandList.push(u);else if(s===1)o[0].commandList.push(u);else{let f=!1;for(let d=s-1;d>=0;--d){let p=o[d].cullingVolume;if(e.isVisible(u,p))o[d].commandList.push(u),f=!0;else if(f)break}}}}function Sxe(e){let t=e.frameState,n=t.shadowState.shadowMaps,i=n.length;if(!t.shadowState.shadowsEnabled)return;let r=e.context,o=r.uniformState;for(let s=0;s<i;++s){let a=n[s];if(a.outOfView)continue;let c=a.passes,u=c.length;for(let d=0;d<u;++d)c[d].commandList.length=0;let f=e.frameState.commandList;K0t(e,f,a);for(let d=0;d<u;++d){let p=a.passes[d];o.updateCamera(p.camera),a.updatePass(r,d);let g=p.commandList.length;for(let m=0;m<g;++m){let x=p.commandList[m];o.updatePass(x.pass),ac(x.derivedCommands.shadows.castCommands[s],e,r,p.passState)}}}}var $0t=new h;Ki.prototype.updateAndExecuteCommands=function(e,t){let i=this._frameState.mode;this._environmentState.useWebVR?Z0t(this,e,t):i!==te.SCENE2D||this._mapMode2D===bu.ROTATE?(J0t(this,e),Y0(!0,this,e,t)):(KY(this,e,t),ayt(this,e))};function Z0t(e,t,n){let i=e._view,r=i.camera,s=e._environmentState.renderTranslucentDepthForPick;KY(e,t,n),wxe(e),i.createPotentiallyVisibleSet(e),Exe(e),s||Sxe(e);let a=t.viewport;a.x=0,a.y=0,a.width=a.width*.5;let c=_r.clone(r,e._cameraVR);c.frustum=r.frustum;let u=r.frustum.near,f=u*y(e.focalLength,5),d=y(e.eyeSeparation,f/30),p=h.multiplyByScalar(c.right,d*.5,$0t);r.frustum.aspectRatio=a.width/a.height;let g=.5*d*u/f;h.add(c.position,p,r.position),r.frustum.xOffset=g,XY(e,t),a.x=a.width,h.subtract(c.position,p,r.position),r.frustum.xOffset=-g,XY(e,t),_r.clone(c,r)}function J0t(e,t){let n=t.viewport;n.x!==0&&(n.width=n.width*2,n.x=0)}var Q0t=new me(Math.PI,M.PI_OVER_TWO),eyt=new h,tyt=new h,nyt=new N,iyt=new N,ryt=new h,oyt=new h,syt=new je;function ayt(e,t){let n=e.context,i=e.frameState,r=e.camera,o=t.viewport,s=je.clone(o,syt);t.viewport=s;let a=Q0t,c=eyt;e.mapProjection.project(a,c);let f=h.clone(r.position,tyt),d=N.clone(r.transform,iyt),p=r.frustum.clone();r._setTransform(N.IDENTITY);let g=N.computeViewportTransformation(s,0,1,nyt),m=r.frustum.projectionMatrix,x=r.positionWC.y,C=h.fromElements(M.sign(x)*c.x-x,0,-r.positionWC.x,ryt),A=yt.pointToGLWindowCoordinates(m,g,C,oyt);A.x=Math.floor(A.x);let b=s.x,T=s.width;if(x===0||A.x<=b||A.x>=b+T)Y0(!0,e,t);else if(Math.abs(b+T*.5-A.x)<1)s.width=A.x-s.x,r.position.x*=M.sign(r.position.x),r.frustum.right=0,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),Y0(!0,e,t),s.x=A.x,r.position.x=-r.position.x,r.frustum.right=-r.frustum.left,r.frustum.left=0,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),Y0(!1,e,t);else if(A.x>b+T*.5){s.width=A.x-b;let S=r.frustum.right;r.frustum.right=c.x-x,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),Y0(!0,e,t),s.x=A.x,s.width=b+T-A.x,r.position.x=-r.position.x,r.frustum.left=-r.frustum.right,r.frustum.right=S-r.frustum.right*2,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),Y0(!1,e,t)}else{s.x=A.x,s.width=b+T-A.x;let S=r.frustum.left;r.frustum.left=-c.x-x,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),Y0(!0,e,t),s.x=b,s.width=A.x-b,r.position.x=-r.position.x,r.frustum.right=-r.frustum.left,r.frustum.left=S-r.frustum.left*2,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),Y0(!1,e,t)}r._setTransform(d),h.clone(f,r.position),r.frustum=p.clone(),t.viewport=o}function Y0(e,t,n,i){let r=t._environmentState,o=t._view,s=r.renderTranslucentDepthForPick;e||(t.frameState.commandList.length=0),wxe(t),o.createPotentiallyVisibleSet(t),e&&(l(i)&&KY(t,n,i),Exe(t),s||Sxe(t)),XY(t,n)}var Txe=new da;Ki.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,r=e.passes.offscreen,o=this.skyAtmosphere,s=this.globe,a=this._globeTranslucencyState;if(!i||this._mode!==te.SCENE2D&&t.camera.frustum instanceof en||!a.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{l(o)?(l(s)&&(o.setDynamicAtmosphereColor(s.enableLighting&&s.dynamicAtmosphereLighting,s.dynamicAtmosphereLightingFromSun),n.isReadyForAtmosphere=n.isReadyForAtmosphere||s._surface._tilesToRender.length>0),n.skyAtmosphereCommand=o.update(e,s),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)):n.skyAtmosphereCommand=void 0,n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let x=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(x)?x.drawCommand:void 0,n.sunComputeCommand=l(x)?x.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let c=n.clearGlobeDepth=l(s)&&s.show&&(!s.depthTestAgainstTerrain||this.mode===te.SCENE2D);(n.useDepthPlane=c&&this.mode===te.SCENE3D&&a.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==te.SCENE2D&&!r;let f=e.mode===te.SCENE3D&&!a.sunVisibleThroughGlobe?e.occluder:void 0,d=e.cullingVolume,p=Txe.planes;for(let x=0;x<5;++x)p[x]=d.planes[x];d=Txe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(n.sunDrawCommand,d,f),n.isMoonVisible=this.isVisible(n.moonCommand,d,f);let g=this.specularEnvironmentMaps,m=this._specularEnvironmentMapAtlas;l(g)&&(!l(m)||m.url!==g)?(m=m&&m.destroy(),this._specularEnvironmentMapAtlas=new Xl(g)):!l(g)&&l(m)&&(m.destroy(),this._specularEnvironmentMapAtlas=void 0),l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e)};function cyt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new r_({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function lyt(e){let t=e._frameState,n=t.shadowMaps,i=n.length,r=i>0&&!t.passes.pick&&e.mode===te.SCENE3D;if(r!==t.shadowState.shadowsEnabled&&(++t.shadowState.lastDirtyTime,t.shadowState.shadowsEnabled=r),t.shadowState.lightShadowsEnabled=!1,!!r){for(let o=0;o<i;++o)if(n[o]!==t.shadowState.shadowMaps[o]){++t.shadowState.lastDirtyTime;break}t.shadowState.shadowMaps.length=0,t.shadowState.lightShadowMaps.length=0;for(let o=0;o<i;++o){let s=n[o];s.update(t),t.shadowState.shadowMaps.push(s),s.fromLightSource&&(t.shadowState.lightShadowMaps.push(s),t.shadowState.lightShadowsEnabled=!0),s.dirty&&(++t.shadowState.lastDirtyTime,s.dirty=!1)}}}function wxe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),cyt(e),lyt(e),e._globe&&e._globe.render(t)}function KY(e,t,n){let i=e._context,r=e._frameState,o=e._environmentState,s=e._view,c=e._frameState.passes.pick;l(s.globeDepth)&&(s.globeDepth.picking=c);let u=o.useWebVR;o.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new $4:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;z.clone(n,f.color),f.execute(i,t);let d=o.useGlobeDepthFramebuffer=l(s.globeDepth);d&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,o.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=o.useOIT=!c&&l(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),o.useOIT=p.isSupported());let m=e.postProcessStages,x=o.usePostProcess=!c&&(e._hdr||m.length>0||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);if(o.usePostProcessSelected=!1,x&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),m.update(i,r.useLogDepth,e._hdr),m.clear(i),x=o.usePostProcess=m.ready,o.usePostProcessSelected=x&&m.hasSelected),o.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):d?t.framebuffer=s.globeDepth.framebuffer:x&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.execute(i,t),o.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification){let A;if(e.frameState.invertClassificationColor.alpha===1&&o.useGlobeDepthFramebuffer&&(A=s.globeDepth.framebuffer),l(A)||i.depthTexture){if(e._invertClassification.previousFramebuffer=A,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),e.frameState.invertClassificationColor.alpha<1&&g){let b=e._invertClassification.unclassifiedCommand,T=b.derivedCommands;T.oit=p.createDerivedCommands(b,i,T.oit)}}else o.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}Ki.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,r=i.globeDepth;l(r)&&r.prepareColorTextures(t);let o=n.useOIT,s=n.useGlobeDepthFramebuffer,a=n.usePostProcess,c=n.originalFramebuffer,u=s?r.colorFramebufferManager:void 0,f=i.sceneFramebuffer._colorFramebuffer,d=i.sceneFramebuffer.idFramebuffer;o&&(e.framebuffer=a?f.framebuffer:c,i.oit.execute(t,e));let p=i.translucentTileClassification;if(p.hasTranslucentDepth&&p.isSupported()&&p.execute(this,e),a){i.sceneFramebuffer.prepareColorTextures(t);let g=f;s&&!o&&(g=u);let m=this.postProcessStages,x=g.getColorTexture(0),C=d.getColorTexture(0),A=y(u,f).getDepthStencilTexture();m.execute(t,x,A,C),m.copy(t,c)}!o&&!a&&s&&(e.framebuffer=c,r.executeCopyColor(t,e))};function uyt(e){let t=e._frameState.afterRender;for(let n=0,i=t.length;n<i;++n)t[n](),e.requestRender();t.length=0}function fyt(e){let t=e._globe,i=e.camera.positionCartographic;if(l(t)&&t.show&&l(i))return t.getHeight(i)}function dyt(e){let t=e.camera,n=e._mode,i=e.globe,r=e._screenSpaceCameraController,o=t.positionCartographic;if(!l(o))return!1;if(!r.onMap()&&o.height<0)return!0;if(!l(i)||!i.show||n===te.SCENE2D||n===te.MORPHING)return!1;let s=e._globeHeight;return l(s)&&o.height<s}Ki.prototype.initializeFrame=function(){this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeight=fyt(this),this._cameraUnderground=dyt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function hyt(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let r=new H0({container:n});e._performanceDisplay=r,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function myt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function pyt(e){let t=e._frameState;e.primitives.postPassesUpdate(t),uc.update()}var _yt=new z;function gyt(e){let t=e._frameState,n=e.context,i=n.uniformState,r=e._defaultView;e._view=r,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=N0t;let o=y(e.backgroundColor,z.BLACK);e._hdr&&(o=z.clone(o,_yt),o.red=Math.pow(o.red,e.gamma),o.green=Math.pow(o.green,e.gamma),o.blue=Math.pow(o.blue,e.gamma)),t.backgroundColor=o,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof I0?h.negate(i.sunDirectionWC,e._shadowMapCamera.direction):h.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=r.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=r.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=je.clone(a,c.viewport),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,o),e.resolveFramebuffers(c),c.framebuffer=void 0,X0t(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function SC(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function yyt(e){return e._picking.updateMostDetailedRayPicks(e)}Ki.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=ee.now());let n=this._view.checkForCameraUpdates(this),i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===te.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let r=Math.abs(ee.secondsDifference(this._lastRenderTime,e));i=i||r>this.maximumRenderTimeChange}if(i){this._lastRenderTime=ee.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let r=M.incrementWrap(t.frameNumber,15e6,1);bxe(this,r,e),t.newFrame=!0}SC(this,myt),this.primitives.show&&(SC(this,yyt),SC(this,xyt),SC(this,Cyt),i||SC(this,Ayt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),SC(this,gyt)),hyt(this,i),SC(this,pyt),uyt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};Ki.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};Ki.prototype.requestRender=function(){this._renderRequested=!0};Ki.prototype.clampLineWidth=function(e){return Math.max(Bt.minimumAliasedLineWidth,Math.min(e,Bt.maximumAliasedLineWidth))};Ki.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};Ki.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};Ki.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};Ki.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function xyt(e){let t=e._frameState;jY.camera=t.camera,jY.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,jY)}function Cyt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;qY.camera=e.preloadFlightCamera,qY.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,qY)}function Ayt(e){e.primitives.updateForPass(e._frameState,F0t)}Ki.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};Ki.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};Ki.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};Ki.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};Ki.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};Ki.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};Ki.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};Ki.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};Ki.prototype.cartesianToCanvasCoordinates=function(e,t){return rr.wgs84ToWindowCoordinates(this,e,t)};Ki.prototype.completeMorph=function(){this._transitioner.completeMorph()};Ki.prototype.morphTo2D=function(e){let t,n=this.globe;l(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=y(e,2),this._transitioner.morphTo2D(e,t)};Ki.prototype.morphToColumbusView=function(e){let t,n=this.globe;l(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=y(e,2),this._transitioner.morphToColumbusView(e,t)};Ki.prototype.morphTo3D=function(e){let t,n=this.globe;l(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=y(e,2),this._transitioner.morphTo3D(e,t)};Ki.prototype.isDestroyed=function(){return!1};Ki.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,ue(this)};var Q4=Ki;var G1=`float interpolateByDistance(vec4 nearFarScalar, float distance)
- {
- float startDistance = nearFarScalar.x;
- float startValue = nearFarScalar.y;
- float endDistance = nearFarScalar.z;
- float endValue = nearFarScalar.w;
- float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);
- return mix(startValue, endValue, t);
- }
- vec3 getLightDirection(vec3 positionWC)
- {
- float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
- vec3 lightDirection =
- positionWC * float(lightEnum == 0.0) +
- czm_lightDirectionWC * float(lightEnum == 1.0) +
- czm_sunDirectionWC * float(lightEnum == 2.0);
- return normalize(lightDirection);
- }
- void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe)
- {
- float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z;
- float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0;
- float distanceAdjustMax = czm_ellipsoidRadii.x;
- float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0;
- float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0);
- float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust;
- float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust;
- vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
- vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
- czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);
- underTranslucentGlobe = 0.0;
- #if defined(GLOBE_TRANSLUCENT)
- czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust);
- if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) {
- vec3 direction = normalize(positionWC);
- czm_ray ellipsoidRay = czm_ray(positionWC, -direction);
- czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii);
- vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start);
- float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth));
- opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth));
- vec3 horizonColor = vec3(0.1, 0.2, 0.3);
- vec3 nearColor = vec3(0.0);
- rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity);
- underTranslucentGlobe = 1.0;
- return;
- }
- #endif
- computeScattering(
- primaryRay,
- length(cameraToPositionWC),
- lightDirection,
- atmosphereInnerRadius,
- rayleighColor,
- mieColor,
- opacity
- );
- float cameraHeight = czm_eyeHeight + atmosphereInnerRadius;
- float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
- opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0);
- float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0;
- opacity *= pow(nightAlpha, 0.5);
- }
- `;var ez=`varying vec3 v_outerPositionWC;
- uniform vec3 u_hsbShift;
- #ifndef PER_FRAGMENT_ATMOSPHERE
- varying vec3 v_mieColor;
- varying vec3 v_rayleighColor;
- varying float v_opacity;
- varying float v_translucent;
- #endif
- void main (void)
- {
- vec3 lightDirection = getLightDirection(v_outerPositionWC);
- vec3 mieColor;
- vec3 rayleighColor;
- float opacity;
- float translucent;
- #ifdef PER_FRAGMENT_ATMOSPHERE
- computeAtmosphereScattering(
- v_outerPositionWC,
- lightDirection,
- rayleighColor,
- mieColor,
- opacity,
- translucent
- );
- #else
- mieColor = v_mieColor;
- rayleighColor = v_rayleighColor;
- opacity = v_opacity;
- translucent = v_translucent;
- #endif
- vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity);
- #ifndef HDR
- color.rgb = czm_acesTonemapping(color.rgb);
- color.rgb = czm_inverseGamma(color.rgb);
- #endif
- #ifdef COLOR_CORRECT
- vec3 hsb = czm_RGBToHSB(color.rgb);
- hsb.x += u_hsbShift.x;
- hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0);
- hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0;
- color.rgb = czm_HSBToRGB(hsb);
- #endif
- if (translucent == 0.0) {
- color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime);
- }
- gl_FragColor = color;
- }
- `;var tz=`attribute vec4 position;
- varying vec3 v_outerPositionWC;
- #ifndef PER_FRAGMENT_ATMOSPHERE
- varying vec3 v_mieColor;
- varying vec3 v_rayleighColor;
- varying float v_opacity;
- varying float v_translucent;
- #endif
- void main(void)
- {
- vec4 positionWC = czm_model * position;
- vec3 lightDirection = getLightDirection(positionWC.xyz);
- #ifndef PER_FRAGMENT_ATMOSPHERE
- computeAtmosphereScattering(
- positionWC.xyz,
- lightDirection,
- v_rayleighColor,
- v_mieColor,
- v_opacity,
- v_translucent
- );
- #endif
- v_outerPositionWC = positionWC.xyz;
- gl_Position = czm_modelViewProjection * position;
- }
- `;function jE(e){e=y(e,oe.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=h.multiplyByScalar(e.radii,t,new h);this._scaleMatrix=N.fromScale(n),this._modelMatrix=new N,this._command=new Ze({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new h;let i=new h;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let r=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return r._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return r._hueSaturationBrightness.x=r.hueShift,r._hueSaturationBrightness.y=r.saturationShift,r._hueSaturationBrightness.z=r.brightnessShift,r._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return r.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return r.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return r.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return r.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return r.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return r.atmosphereMieAnisotropy}}}Object.defineProperties(jE.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});jE.prototype.setDynamicAtmosphereColor=function(e,t){let n=e?t?2:1:0;this._radiiAndDynamicAtmosphereColor.z=n};var $Y=new N;jE.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==te.SCENE3D&&n!==te.MORPHING||!e.passes.render)return;let i=N.fromRotationTranslation(e.context.uniformState.inverseViewRotation,h.ZERO,$Y),r=N.multiplyTransformation(i,On.Y_UP_TO_Z_UP,$Y),o=N.multiply(this._scaleMatrix,r,$Y);N.clone(o,this._modelMatrix);let s=e.context,a=Tyt(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=Us.createGeometry(new Us({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Pe.POSITION_ONLY}));f.vertexArray=Qn.fromGeometry({context:s,geometry:p,attributeLocations:Bn.createAttributeLocations(p),bufferUsage:Ne.STATIC_DRAW}),f.renderState=Ve.fromCache({cull:{enabled:!0,face:Yi.FRONT},blending:hn.ALPHA_BLEND,depthMask:!1})}let d=a|u<<2|c<<3;if(d!==this._flags){this._flags=d;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new Fe({defines:p,sources:[k0,G1,tz]}),m=new Fe({defines:p,sources:[k0,G1,ez]});this._spSkyAtmosphere=Wt.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function Tyt(e){return!(M.equalsEpsilon(e.hueShift,0,M.EPSILON7)&&M.equalsEpsilon(e.saturationShift,0,M.EPSILON7)&&M.equalsEpsilon(e.brightnessShift,0,M.EPSILON7))}jE.prototype.isDestroyed=function(){return!1};jE.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),ue(this)};var nz=jE;var iz=`uniform samplerCube u_cubeMap;
- varying vec3 v_texCoord;
- void main()
- {
- vec4 color = textureCube(u_cubeMap, normalize(v_texCoord));
- gl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);
- }
- `;var rz=`attribute vec3 position;
- varying vec3 v_texCoord;
- void main()
- {
- vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));
- gl_Position = czm_projection * vec4(p, 1.0);
- v_texCoord = position.xyz;
- }
- `;function oz(e){this.sources=e.sources,this._sources=void 0,this.show=y(e.show,!0),this._command=new Ze({modelMatrix:N.clone(N.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}oz.prototype.update=function(e,t){let n=this;if(!this.show||e.mode!==te.SCENE3D&&e.mode!==te.MORPHING||!e.passes.render)return;let i=e.context;if(this._sources!==this.sources){this._sources=this.sources;let o=this.sources;typeof o.positiveX=="string"?_k(i,this._sources).then(function(s){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=s}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new Sc({context:i,source:o}))}let r=this._command;if(!l(r.vertexArray)){r.uniformMap={u_cubeMap:function(){return n._cubeMap}};let o=Vl.createGeometry(Vl.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Pe.POSITION_ONLY})),s=this._attributeLocations=Bn.createAttributeLocations(o);r.vertexArray=Qn.fromGeometry({context:i,geometry:o,attributeLocations:s,bufferUsage:Ne.STATIC_DRAW}),r.renderState=Ve.fromCache({blending:hn.ALPHA_BLEND})}if(!l(r.shaderProgram)||this._useHdr!==t){let o=new Fe({defines:[t?"HDR":""],sources:[iz]});r.shaderProgram=Wt.fromCache({context:i,vertexShaderSource:rz,fragmentShaderSource:o,attributeLocations:this._attributeLocations}),this._useHdr=t}if(!!l(this._cubeMap))return r};oz.prototype.isDestroyed=function(){return!1};oz.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),ue(this)};var sz=oz;function ZY(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(ZY.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});ZY.prototype.emit=function(e){let t=M.randomBetween(0,M.TWO_PI),n=M.randomBetween(0,M.PI),i=M.randomBetween(0,this._radius),r=i*Math.cos(t)*Math.sin(n),o=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=h.fromElements(r,o,s,e.position),e.velocity=h.normalize(e.position,e.velocity)};var vxe=ZY;function W1(){}W1.prototype.evaluate=function(e,t){ye.throwInstantiationError()};W1.prototype.evaluateColor=function(e,t){ye.throwInstantiationError()};W1.prototype.getShaderFunction=function(e,t,n,i){ye.throwInstantiationError()};W1.prototype.getVariables=function(){ye.throwInstantiationError()};var Dxe=W1;var az=`uniform sampler2D u_texture;
- varying vec2 v_textureCoordinates;
- void main()
- {
- vec4 color = texture2D(u_texture, v_textureCoordinates);
- gl_FragColor = czm_gammaCorrect(color);
- }
- `;var cz=`uniform float u_radiusTS;
- varying vec2 v_textureCoordinates;
- vec2 rotate(vec2 p, vec2 direction)
- {
- return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);
- }
- vec4 addBurst(vec2 position, vec2 direction, float lengthScalar)
- {
- vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);
- float radius = length(rotatedPosition) * lengthScalar;
- float burst = 1.0 - smoothstep(0.0, 0.55, radius);
- return vec4(burst);
- }
- void main()
- {
- float lengthScalar = 2.0 / sqrt(2.0);
- vec2 position = v_textureCoordinates - vec2(0.5);
- float radius = length(position) * lengthScalar;
- float surface = step(radius, u_radiusTS);
- vec4 color = vec4(vec2(1.0), surface + 0.2, surface);
- float glow = 1.0 - smoothstep(0.0, 0.55, radius);
- color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;
- vec4 burst = vec4(0.0);
- burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar);
- burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar);
- burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar);
- burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar);
- burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar);
- burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar);
- color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;
- gl_FragColor = clamp(color, vec4(0.0), vec4(1.0));
- }
- `;var lz=`attribute vec2 direction;
- uniform float u_size;
- varying vec2 v_textureCoordinates;
- void main()
- {
- vec4 position;
- if (czm_morphTime == 1.0)
- {
- position = vec4(czm_sunPositionWC, 1.0);
- }
- else
- {
- position = vec4(czm_sunPositionColumbusView.zxy, 1.0);
- }
- vec4 positionEC = czm_view * position;
- vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
- vec2 halfSize = vec2(u_size * 0.5);
- halfSize *= ((direction * 2.0) - 1.0);
- gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);
- v_textureCoordinates = direction;
- }
- `;function q1(){this.show=!0,this._drawCommand=new Ze({primitiveType:Me.TRIANGLES,boundingVolume:new re,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new re,this._boundingVolume2D=new re,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(q1.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var byt=new W,Eyt=new W,Syt=new se,j1=new se;q1.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===te.SCENE2D||i===te.MORPHING||!e.passes.render)return;let r=e.context,o=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||o!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=o,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let S=Math.max(o,s);S=Math.pow(2,Math.ceil(Math.log(S)/Math.log(2))-2),S=Math.max(1,S);let w=n?r.halfFloatingPointTexture?qe.HALF_FLOAT:qe.FLOAT:qe.UNSIGNED_BYTE;this._texture=new wt({context:r,width:S,height:S,pixelFormat:ct.RGBA,pixelDatatype:w}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let D=this,I={u_radiusTS:function(){return D._radiusTS}};this._commands.computeCommand=new cd({fragmentShaderSource:cz,outputTexture:this._texture,uniformMap:I,persists:!1,owner:this,postExecute:function(){D._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let S={direction:0},w=new Uint8Array(4*2);w[0]=0,w[1]=0,w[2]=255,w[3]=0,w[4]=255,w[5]=255,w[6]=0,w[7]=255;let D=at.createVertexBuffer({context:r,typedArray:w,usage:Ne.STATIC_DRAW}),I=[{index:S.direction,vertexBuffer:D,componentsPerAttribute:2,normalize:!0,componentDatatype:K.UNSIGNED_BYTE}],O=at.createIndexBuffer({context:r,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ne.STATIC_DRAW,indexDatatype:Le.UNSIGNED_SHORT});a.vertexArray=new Qn({context:r,attributes:I,indexBuffer:O}),a.shaderProgram=Wt.fromCache({context:r,vertexShaderSource:lz,fragmentShaderSource:az,attributeLocations:S}),a.renderState=Ve.fromCache({blending:hn.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=r.uniformState.sunPositionWC,u=r.uniformState.sunPositionColumbusView,f=this._boundingVolume,d=this._boundingVolume2D;h.clone(c,f.center),d.center.x=u.z,d.center.y=u.x,d.center.z=u.y,f.radius=M.SOLAR_RADIUS+M.SOLAR_RADIUS*this._glowLengthTS,d.radius=f.radius,i===te.SCENE3D?re.clone(f,a.boundingVolume):i===te.COLUMBUS_VIEW&&re.clone(d,a.boundingVolume);let p=rr.computeActualWgs84Position(e,c,j1),g=h.magnitude(h.subtract(p,e.camera.position,j1)),m=r.uniformState.projection,x=Syt;x.x=0,x.y=0,x.z=-g,x.w=1;let C=N.multiplyByVector(m,x,j1),A=rr.clipToGLWindowCoordinates(t.viewport,C,byt);x.x=M.SOLAR_RADIUS;let b=N.multiplyByVector(m,x,j1),T=rr.clipToGLWindowCoordinates(t.viewport,b,Eyt);return this._size=W.magnitude(W.subtract(T,A,j1)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};q1.prototype.isDestroyed=function(){return!1};q1.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),ue(this)};var uz=q1;function qE(){}qE.prototype.boundingVolume=void 0;qE.prototype.boundingSphere=void 0;qE.prototype.distanceToCamera=function(e){ye.throwInstantiationError()};qE.prototype.intersectPlane=function(e){ye.throwInstantiationError()};qE.prototype.createDebugVolume=function(e){ye.throwInstantiationError()};var Pxe=qE;function Y1(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Qi({ellipsoid:e.ellipsoid}),this._color=y(e.color,z.YELLOW),this._errorEvent=new ge,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._readyPromise=Promise.resolve(!0),this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0}Object.defineProperties(Y1.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});Y1.prototype.getTileCredits=function(e,t,n){};Y1.prototype.requestImage=function(e,t,n,i){let r=document.createElement("canvas");r.width=256,r.height=256;let o=r.getContext("2d"),s=this._color.toCssColorString();return o.strokeStyle=s,o.lineWidth=2,o.strokeRect(1,1,255,255),o.font="bold 25px Arial",o.textAlign="center",o.fillStyle=s,o.fillText(`L: ${n}`,124,86),o.fillText(`X: ${e}`,124,136),o.fillText(`Y: ${t}`,124,186),Promise.resolve(r)};Y1.prototype.pickFeatures=function(e,t,n,i,r){};var fz=Y1;function JY(e){ye.throwInstantiationError()}JY.prototype.isReady=ye.throwInstantiationError;JY.prototype.shouldDiscardImage=ye.throwInstantiationError;var Ixe=JY;var wyt={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},Oxe=Object.freeze(wyt);function vC(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=N.clone(y(e.modelMatrix,N.IDENTITY)),this.shadows=y(e.shadows,Zt.ENABLED),this.maximumMemoryUsage=y(e.maximumMemoryUsage,256),this.shading=new _d(e.shading),this.style=e.style,this.frameFailed=new ge,this.frameChanged=new ge,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new Lg,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._resolveReadyPromise=void 0;let t=this;this._readyPromise=new Promise(function(n){t._resolveReadyPromise=n}),this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(vC.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){vs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}},readyPromise:{get:function(){return this._readyPromise}}});function vyt(e){return`uniform vec4 czm_pickColor;
- ${e}`}function Dyt(e){return function(t){return rt(t,{czm_pickColor:function(){return e._pickId.color}})}}function Pyt(){return"czm_pickColor"}vC.prototype.makeStyleDirty=function(){this._styleDirty=!0};vC.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var Iyt=new ee;function eX(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function wC(e,t){return e._intervals.indexOf(t.start)}function Oyt(e,t){let n=e._intervals,i=e._clock,r=eX(e);if(r===0)return;let o=e._getAverageLoadTime(),s=ee.addSeconds(i.currentTime,o*r,Iyt),a=n.indexOf(s),c=wC(e,t);return a===c&&(r>=0?++a:--a),n.get(a)}function Ryt(e){let t=e._intervals,i=e._clock.currentTime,r=t.indexOf(i);return t.get(r)}function Myt(e,t,n){let i=eX(e),r=wC(e,t),o=wC(e,n);return i>=0?r>=o:r<=o}function Byt(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function Lyt(e,t,n){let i=wC(e,t),r=e._frames,o=r[i];if(!l(o)){let s=t.data.transform,a=l(s)?N.fromArray(s):void 0,c=t.data.uri;o={pointCloud:void 0,transform:a,timestamp:Bi(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber},r[i]=o,De.fetchArrayBuffer({url:c}).then(function(u){return o.pointCloud=new ob({arrayBuffer:u,cull:!0,fragmentShaderLoaded:vyt,uniformMapLoaded:Dyt(e),pickIdLoaded:Pyt}),o.pointCloud.readyPromise}).catch(Byt(e,c))}return o}function Nyt(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function Fyt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let r=t.pointCloud;if(l(r)&&!t.ready){let o=i.commandList,s=o.length;if(Mxe(e,t,n,i),r.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=r.geometryByteLength,o.length=s,t.sequential)){let a=(Bi()-t.timestamp)/1e3;Nyt(e,a)}}t.touchedFrameNumber=i.frameNumber}var Vyt=new N;function kyt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?M.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function Uyt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var zyt=new _d;function Mxe(e,t,n,i){let r=y(e.shading,zyt),o=t.pointCloud,s=y(t.transform,N.IDENTITY);o.modelMatrix=N.multiplyTransformation(e.modelMatrix,s,Vyt),o.style=e.style,o.time=n.timeSinceLoad,o.shadows=e.shadows,o.clippingPlanes=e._clippingPlanes,o.isClipped=n.isClipped,o.attenuation=r.attenuation,o.backFaceCulling=r.backFaceCulling,o.normalShading=r.normalShading,o.geometricError=kyt(e,o),o.geometricErrorScale=r.geometricErrorScale,o.maximumAttenuation=Uyt(e),o.update(i),t.touchedFrameNumber=i.frameNumber}function QY(e,t,n,i){let r=Lyt(e,t,i);Fyt(e,r,n,i)}function Hyt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function Bxe(e,t){let n=e._frames,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(l(o)&&(!l(t)||t(o))){let s=o.pointCloud;o.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),o===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[r]=void 0}}}function Gyt(e,t){let n=wC(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function Rxe(e,t,n,i,r){return l(n)?n.ready?!0:(QY(e,t,i,r),n.ready):!1}function Wyt(e,t,n,i,r){let o,s,a,c=e._intervals,u=e._frames,f=wC(e,n),d=wC(e,t);if(f>=d){for(o=f;o>=d;--o)if(s=c.get(o),a=u[o],Rxe(e,s,a,i,r))return s}else for(o=f;o<=d;++o)if(s=c.get(o),a=u[o],Rxe(e,s,a,i,r))return s;return t}function jyt(e,t,n){let i=e._frames,r=i.length;for(let o=0;o<r;++o){let s=i[o];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var YE={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};vC.prototype.update=function(e){if(e.mode===te.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=ee.clone(e.time));let t=Math.max(ee.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,r=!1,o=l(n)&&n.enabled;o&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,r=!0);let s=this._styleDirty;this._styleDirty=!1,(r||s)&&jyt(this,r,s),YE.timeSinceLoad=t,YE.isClipped=o;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,g=Ryt(this);if(!l(g))return;let m=!1,x=eX(this),C=x===0;x!==this._clockMultiplier&&(m=!0,this._clockMultiplier=x),(!l(d)||C)&&(d=g),(!l(p)||m||Myt(this,g,p))&&(p=Oyt(this,g)),d=Wyt(this,d,g,YE,e);let A=Gyt(this,d);l(A)||(QY(this,d,YE,e),A=this._lastRenderedFrame),l(A)&&Mxe(this,A,YE,e),l(p)&&QY(this,p,YE,e);let b=this;l(A)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){b._resolveReadyPromise(b)}),l(A)&&A!==this._lastRenderedFrame&&b.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){b.frameChanged.raiseEvent(b)}),this._previousInterval=d,this._nextInterval=p,this._lastRenderedFrame=A;let T=this._totalMemoryUsageInBytes,S=this.maximumMemoryUsage*1024*1024;T>S&&Bxe(this,Hyt(e));let D=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&D>0&&c.update(e,f,a,this.boundingSphere)};vC.prototype.isDestroyed=function(){return!1};vC.prototype.destroy=function(){return Bxe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var X1=vC;var dz=`varying vec2 v_textureCoordinates;
- void main()
- {
- czm_materialInput materialInput;
- materialInput.s = v_textureCoordinates.s;
- materialInput.st = v_textureCoordinates;
- materialInput.str = vec3(v_textureCoordinates, 0.0);
- materialInput.normalEC = vec3(0.0, 0.0, -1.0);
- czm_material material = czm_getMaterial(materialInput);
- gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);
- }
- `;function hz(e,t){this.show=!0,l(e)||(e=new je),this.rectangle=je.clone(e),l(t)||(t=cr.fromType(cr.ColorType,{color:new z(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}hz.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!je.equals(t.viewport,this.rectangle))&&(this._rs=Ve.fromCache({blending:hn.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let r=new Fe({sources:[this._material.shaderSource,dz]});this._overlayCommand=i.createViewportQuadCommand(r,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Ce.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};hz.prototype.isDestroyed=function(){return!1};hz.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ue(this)};var Lxe=hz;var K1;typeof ko<"u"&&(K1=ko);(function(){/*!
- * Knockout JavaScript library v3.5.1
- * (c) The Knockout.js team - http://knockoutjs.com/
- * License: MIT (http://www.opensource.org/licenses/mit-license.php)
- */(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,r=t.jQuery,o=t.JSON;r||typeof jQuery>"u"||(r=jQuery),function(s){s(t.ko={})}(function(s,a){function c(_,E){return _===null||typeof _ in x?_===E:!1}function u(_,E){var v;return function(){v||(v=m.a.setTimeout(function(){v=e,_()},E))}}function f(_,E){var v;return function(){clearTimeout(v),v=m.a.setTimeout(_,E)}}function d(_,E){E&&E!=="change"?E==="beforeChange"?this.pc(_):this.gb(_,E):this.qc(_)}function p(_,E){E!==null&&E.s&&E.s()}function g(_,E){var v=this.qd,P=v[S];P.ra||(this.Qb&&this.mb[E]?(v.uc(E,_,this.mb[E]),this.mb[E]=null,--this.Qb):P.I[E]||v.uc(E,_,P.J?{da:_}:v.$c(_)),_.Ja&&_.gd())}var m=typeof s<"u"?s:{};m.b=function(_,E){for(var v=_.split("."),P=m,R=0;R<v.length-1;R++)P=P[v[R]];P[v[v.length-1]]=E},m.L=function(_,E,v){_[E]=v},m.version="3.5.1",m.b("version",m.version),m.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},m.a=function(){function _(G,$){for(var J in G)R.call(G,J)&&$(J,G[J])}function E(G,$){if($)for(var J in $)R.call($,J)&&(G[J]=$[J]);return G}function v(G,$){return G.__proto__=$,G}function P(G,$,J,ce){var de=G[$].match(j)||[];m.a.D(J.match(j),function(ie){m.a.Na(de,ie,ce)}),G[$]=de.join(" ")}var R=Object.prototype.hasOwnProperty,F={__proto__:[]}instanceof Array,U=typeof Symbol=="function",k={},H={};k[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],k.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),_(k,function(G,$){if($.length)for(var J=0,ce=$.length;J<ce;J++)H[$[J]]=G});var V={propertychange:!0},q=n&&function(){for(var G=3,$=n.createElement("div"),J=$.getElementsByTagName("i");$.innerHTML="<!--[if gt IE "+ ++G+"]><i></i><![endif]-->",J[0];);return 4<G?G:e}(),j=/\S+/g,X;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(G,$,J){for(var ce=0,de=G.length;ce<de;ce++)$.call(J,G[ce],ce,G)},A:typeof Array.prototype.indexOf=="function"?function(G,$){return Array.prototype.indexOf.call(G,$)}:function(G,$){for(var J=0,ce=G.length;J<ce;J++)if(G[J]===$)return J;return-1},Lb:function(G,$,J){for(var ce=0,de=G.length;ce<de;ce++)if($.call(J,G[ce],ce,G))return G[ce];return e},Pa:function(G,$){var J=m.a.A(G,$);0<J?G.splice(J,1):J===0&&G.shift()},wc:function(G){var $=[];return G&&m.a.D(G,function(J){0>m.a.A($,J)&&$.push(J)}),$},Mb:function(G,$,J){var ce=[];if(G)for(var de=0,ie=G.length;de<ie;de++)ce.push($.call(J,G[de],de));return ce},jb:function(G,$,J){var ce=[];if(G)for(var de=0,ie=G.length;de<ie;de++)$.call(J,G[de],de)&&ce.push(G[de]);return ce},Nb:function(G,$){if($ instanceof Array)G.push.apply(G,$);else for(var J=0,ce=$.length;J<ce;J++)G.push($[J]);return G},Na:function(G,$,J){var ce=m.a.A(m.a.bc(G),$);0>ce?J&&G.push($):J||G.splice(ce,1)},Ba:F,extend:E,setPrototypeOf:v,Ab:F?v:E,P:_,Ga:function(G,$,J){if(!G)return G;var ce={},de;for(de in G)R.call(G,de)&&(ce[de]=$.call(J,G[de],de,G));return ce},Tb:function(G){for(;G.firstChild;)m.removeNode(G.firstChild)},Yb:function(G){G=m.a.la(G);for(var $=(G[0]&&G[0].ownerDocument||n).createElement("div"),J=0,ce=G.length;J<ce;J++)$.appendChild(m.oa(G[J]));return $},Ca:function(G,$){for(var J=0,ce=G.length,de=[];J<ce;J++){var ie=G[J].cloneNode(!0);de.push($?m.oa(ie):ie)}return de},va:function(G,$){if(m.a.Tb(G),$)for(var J=0,ce=$.length;J<ce;J++)G.appendChild($[J])},Xc:function(G,$){var J=G.nodeType?[G]:G;if(0<J.length){for(var ce=J[0],de=ce.parentNode,ie=0,ae=$.length;ie<ae;ie++)de.insertBefore($[ie],ce);for(ie=0,ae=J.length;ie<ae;ie++)m.removeNode(J[ie])}},Ua:function(G,$){if(G.length){for($=$.nodeType===8&&$.parentNode||$;G.length&&G[0].parentNode!==$;)G.splice(0,1);for(;1<G.length&&G[G.length-1].parentNode!==$;)G.length--;if(1<G.length){var J=G[0],ce=G[G.length-1];for(G.length=0;J!==ce;)G.push(J),J=J.nextSibling;G.push(ce)}}return G},Zc:function(G,$){7>q?G.setAttribute("selected",$):G.selected=$},Db:function(G){return G===null||G===e?"":G.trim?G.trim():G.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(G,$){return G=G||"",$.length>G.length?!1:G.substring(0,$.length)===$},vd:function(G,$){if(G===$)return!0;if(G.nodeType===11)return!1;if($.contains)return $.contains(G.nodeType!==1?G.parentNode:G);if($.compareDocumentPosition)return($.compareDocumentPosition(G)&16)==16;for(;G&&G!=$;)G=G.parentNode;return!!G},Sb:function(G){return m.a.vd(G,G.ownerDocument.documentElement)},kd:function(G){return!!m.a.Lb(G,m.a.Sb)},R:function(G){return G&&G.tagName&&G.tagName.toLowerCase()},Ac:function(G){return m.onError?function(){try{return G.apply(this,arguments)}catch($){throw m.onError&&m.onError($),$}}:G},setTimeout:function(G,$){return setTimeout(m.a.Ac(G),$)},Gc:function(G){setTimeout(function(){throw m.onError&&m.onError(G),G},0)},B:function(G,$,J){var ce=m.a.Ac(J);if(J=V[$],m.options.useOnlyNativeEvents||J||!r)if(J||typeof G.addEventListener!="function")if(typeof G.attachEvent<"u"){var de=function(ae){ce.call(G,ae)},ie="on"+$;G.attachEvent(ie,de),m.a.K.za(G,function(){G.detachEvent(ie,de)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else G.addEventListener($,ce,!1);else X||(X=typeof r(G).on=="function"?"on":"bind"),r(G)[X]($,ce)},Fb:function(G,$){if(!G||!G.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var J;if(m.a.R(G)==="input"&&G.type&&$.toLowerCase()=="click"?(J=G.type,J=J=="checkbox"||J=="radio"):J=!1,m.options.useOnlyNativeEvents||!r||J)if(typeof n.createEvent=="function")if(typeof G.dispatchEvent=="function")J=n.createEvent(H[$]||"HTMLEvents"),J.initEvent($,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,G),G.dispatchEvent(J);else throw Error("The supplied element doesn't support dispatchEvent");else if(J&&G.click)G.click();else if(typeof G.fireEvent<"u")G.fireEvent("on"+$);else throw Error("Browser doesn't support triggering events");else r(G).trigger($)},f:function(G){return m.O(G)?G():G},bc:function(G){return m.O(G)?G.v():G},Eb:function(G,$,J){var ce;$&&(typeof G.classList=="object"?(ce=G.classList[J?"add":"remove"],m.a.D($.match(j),function(de){ce.call(G.classList,de)})):typeof G.className.baseVal=="string"?P(G.className,"baseVal",$,J):P(G,"className",$,J))},Bb:function(G,$){var J=m.a.f($);(J===null||J===e)&&(J="");var ce=m.h.firstChild(G);!ce||ce.nodeType!=3||m.h.nextSibling(ce)?m.h.va(G,[G.ownerDocument.createTextNode(J)]):ce.data=J,m.a.Ad(G)},Yc:function(G,$){if(G.name=$,7>=q)try{var J=G.name.replace(/[&<>'"]/g,function(ce){return"&#"+ce.charCodeAt(0)+";"});G.mergeAttributes(n.createElement("<input name='"+J+"'/>"),!1)}catch{}},Ad:function(G){9<=q&&(G=G.nodeType==1?G:G.parentNode,G.style&&(G.style.zoom=G.style.zoom))},wd:function(G){if(q){var $=G.style.width;G.style.width=0,G.style.width=$}},Pd:function(G,$){G=m.a.f(G),$=m.a.f($);for(var J=[],ce=G;ce<=$;ce++)J.push(ce);return J},la:function(G){for(var $=[],J=0,ce=G.length;J<ce;J++)$.push(G[J]);return $},Da:function(G){return U?Symbol(G):G},Zd:q===6,$d:q===7,W:q,Lc:function(G,$){for(var J=m.a.la(G.getElementsByTagName("input")).concat(m.a.la(G.getElementsByTagName("textarea"))),ce=typeof $=="string"?function(ae){return ae.name===$}:function(ae){return $.test(ae.name)},de=[],ie=J.length-1;0<=ie;ie--)ce(J[ie])&&de.push(J[ie]);return de},Nd:function(G){return typeof G=="string"&&(G=m.a.Db(G))?o&&o.parse?o.parse(G):new Function("return "+G)():null},hc:function(G,$,J){if(!o||!o.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return o.stringify(m.a.f(G),$,J)},Od:function(G,$,J){J=J||{};var ce=J.params||{},de=J.includeFields||this.Jc,ie=G;if(typeof G=="object"&&m.a.R(G)==="form")for(var ie=G.action,ae=de.length-1;0<=ae;ae--)for(var _e=m.a.Lc(G,de[ae]),be=_e.length-1;0<=be;be--)ce[_e[be].name]=_e[be].value;$=m.a.f($);var Te=n.createElement("form");Te.style.display="none",Te.action=ie,Te.method="post";for(var Oe in $)G=n.createElement("input"),G.type="hidden",G.name=Oe,G.value=m.a.hc(m.a.f($[Oe])),Te.appendChild(G);_(ce,function(Be,tt){var lt=n.createElement("input");lt.type="hidden",lt.name=Be,lt.value=tt,Te.appendChild(lt)}),n.body.appendChild(Te),J.submitter?J.submitter(Te):Te.submit(),setTimeout(function(){Te.parentNode.removeChild(Te)},0)}}}(),m.b("utils",m.a),m.b("utils.arrayForEach",m.a.D),m.b("utils.arrayFirst",m.a.Lb),m.b("utils.arrayFilter",m.a.jb),m.b("utils.arrayGetDistinctValues",m.a.wc),m.b("utils.arrayIndexOf",m.a.A),m.b("utils.arrayMap",m.a.Mb),m.b("utils.arrayPushAll",m.a.Nb),m.b("utils.arrayRemoveItem",m.a.Pa),m.b("utils.cloneNodes",m.a.Ca),m.b("utils.createSymbolOrString",m.a.Da),m.b("utils.extend",m.a.extend),m.b("utils.fieldsIncludedWithJsonPost",m.a.Jc),m.b("utils.getFormFields",m.a.Lc),m.b("utils.objectMap",m.a.Ga),m.b("utils.peekObservable",m.a.bc),m.b("utils.postJson",m.a.Od),m.b("utils.parseJson",m.a.Nd),m.b("utils.registerEventHandler",m.a.B),m.b("utils.stringifyJson",m.a.hc),m.b("utils.range",m.a.Pd),m.b("utils.toggleDomNodeCssClass",m.a.Eb),m.b("utils.triggerEvent",m.a.Fb),m.b("utils.unwrapObservable",m.a.f),m.b("utils.objectForEach",m.a.P),m.b("utils.addOrRemoveItem",m.a.Na),m.b("utils.setTextContent",m.a.Bb),m.b("unwrap",m.a.f),Function.prototype.bind||(Function.prototype.bind=function(_){var E=this;if(arguments.length===1)return function(){return E.apply(_,arguments)};var v=Array.prototype.slice.call(arguments,1);return function(){var P=v.slice(0);return P.push.apply(P,arguments),E.apply(_,P)}}),m.a.g=new function(){var _=0,E="__ko__"+new Date().getTime(),v={},P,R;return m.a.W?(P=function(F,U){var k=F[E];if(!k||k==="null"||!v[k]){if(!U)return e;k=F[E]="ko"+_++,v[k]={}}return v[k]},R=function(F){var U=F[E];return U?(delete v[U],F[E]=null,!0):!1}):(P=function(F,U){var k=F[E];return!k&&U&&(k=F[E]={}),k},R=function(F){return F[E]?(delete F[E],!0):!1}),{get:function(F,U){var k=P(F,!1);return k&&k[U]},set:function(F,U,k){(F=P(F,k!==e))&&(F[U]=k)},Ub:function(F,U,k){return F=P(F,!0),F[U]||(F[U]=k)},clear:R,Z:function(){return _+++E}}},m.b("utils.domData",m.a.g),m.b("utils.domData.clear",m.a.g.clear),m.a.K=new function(){function _(U,k){var H=m.a.g.get(U,P);return H===e&&k&&(H=[],m.a.g.set(U,P,H)),H}function E(U){var k=_(U,!1);if(k)for(var k=k.slice(0),H=0;H<k.length;H++)k[H](U);m.a.g.clear(U),m.a.K.cleanExternalData(U),F[U.nodeType]&&v(U.childNodes,!0)}function v(U,k){for(var H=[],V,q=0;q<U.length;q++)if((!k||U[q].nodeType===8)&&(E(H[H.length]=V=U[q]),U[q]!==V))for(;q--&&m.a.A(H,U[q])==-1;);}var P=m.a.g.Z(),R={1:!0,8:!0,9:!0},F={1:!0,9:!0};return{za:function(U,k){if(typeof k!="function")throw Error("Callback must be a function");_(U,!0).push(k)},yb:function(U,k){var H=_(U,!1);H&&(m.a.Pa(H,k),H.length==0&&m.a.g.set(U,P,e))},oa:function(U){return m.u.G(function(){R[U.nodeType]&&(E(U),F[U.nodeType]&&v(U.getElementsByTagName("*")))}),U},removeNode:function(U){m.oa(U),U.parentNode&&U.parentNode.removeChild(U)},cleanExternalData:function(U){r&&typeof r.cleanData=="function"&&r.cleanData([U])}}},m.oa=m.a.K.oa,m.removeNode=m.a.K.removeNode,m.b("cleanNode",m.oa),m.b("removeNode",m.removeNode),m.b("utils.domNodeDisposal",m.a.K),m.b("utils.domNodeDisposal.addDisposeCallback",m.a.K.za),m.b("utils.domNodeDisposal.removeDisposeCallback",m.a.K.yb),function(){var _=[0,"",""],E=[1,"<table>","</table>"],v=[3,"<table><tbody><tr>","</tr></tbody></table>"],P=[1,"<select multiple='multiple'>","</select>"],R={thead:E,tbody:E,tfoot:E,tr:[2,"<table><tbody>","</tbody></table>"],td:v,th:v,option:P,optgroup:P},F=8>=m.a.W;m.a.ua=function(U,k){var H;if(r){if(r.parseHTML)H=r.parseHTML(U,k)||[];else if((H=r.clean([U],k))&&H[0]){for(var V=H[0];V.parentNode&&V.parentNode.nodeType!==11;)V=V.parentNode;V.parentNode&&V.parentNode.removeChild(V)}}else{(H=k)||(H=n);var V=H.parentWindow||H.defaultView||t,q=m.a.Db(U).toLowerCase(),j=H.createElement("div"),X;for(X=(q=q.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&R[q[1]]||_,q=X[0],X="ignored<div>"+X[1]+U+X[2]+"</div>",typeof V.innerShiv=="function"?j.appendChild(V.innerShiv(X)):(F&&H.body.appendChild(j),j.innerHTML=X,F&&j.parentNode.removeChild(j));q--;)j=j.lastChild;H=m.a.la(j.lastChild.childNodes)}return H},m.a.Md=function(U,k){var H=m.a.ua(U,k);return H.length&&H[0].parentElement||m.a.Yb(H)},m.a.fc=function(U,k){if(m.a.Tb(U),k=m.a.f(k),k!==null&&k!==e)if(typeof k!="string"&&(k=k.toString()),r)r(U).html(k);else for(var H=m.a.ua(k,U.ownerDocument),V=0;V<H.length;V++)U.appendChild(H[V])}}(),m.b("utils.parseHtmlFragment",m.a.ua),m.b("utils.setHtml",m.a.fc),m.aa=function(){function _(v,P){if(v){if(v.nodeType==8){var R=m.aa.Uc(v.nodeValue);R!=null&&P.push({ud:v,Kd:R})}else if(v.nodeType==1)for(var R=0,F=v.childNodes,U=F.length;R<U;R++)_(F[R],P)}}var E={};return{Xb:function(v){if(typeof v!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var P=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return E[P]=v,"<!--[ko_memo:"+P+"]-->"},bd:function(v,P){var R=E[v];if(R===e)throw Error("Couldn't find any memo with ID "+v+". Perhaps it's already been unmemoized.");try{return R.apply(null,P||[]),!0}finally{delete E[v]}},cd:function(v,P){var R=[];_(v,R);for(var F=0,U=R.length;F<U;F++){var k=R[F].ud,H=[k];P&&m.a.Nb(H,P),m.aa.bd(R[F].Kd,H),k.nodeValue="",k.parentNode&&k.parentNode.removeChild(k)}},Uc:function(v){return(v=v.match(/^\[ko_memo\:(.*?)\]$/))?v[1]:null}}}(),m.b("memoization",m.aa),m.b("memoization.memoize",m.aa.Xb),m.b("memoization.unmemoize",m.aa.bd),m.b("memoization.parseMemoText",m.aa.Uc),m.b("memoization.unmemoizeDomNodeAndDescendants",m.aa.cd),m.na=function(){function _(){if(R){for(var k=R,H=0,V;U<R;)if(V=P[U++]){if(U>k){if(5e3<=++H){U=R,m.a.Gc(Error("'Too much recursion' after processing "+H+" task groups."));break}k=R}try{V()}catch(q){m.a.Gc(q)}}}}function E(){_(),U=R=P.length=0}var v,P=[],R=0,F=1,U=0;return t.MutationObserver?v=function(k){var H=n.createElement("div");return new MutationObserver(k).observe(H,{attributes:!0}),function(){H.classList.toggle("foo")}}(E):v=n&&"onreadystatechange"in n.createElement("script")?function(k){var H=n.createElement("script");H.onreadystatechange=function(){H.onreadystatechange=null,n.documentElement.removeChild(H),H=null,k()},n.documentElement.appendChild(H)}:function(k){setTimeout(k,0)},{scheduler:v,zb:function(k){return R||m.na.scheduler(E),P[R++]=k,F++},cancel:function(k){k=k-(F-R),k>=U&&k<R&&(P[k]=null)},resetForTesting:function(){var k=R-U;return U=R=P.length=0,k},Sd:_}}(),m.b("tasks",m.na),m.b("tasks.schedule",m.na.zb),m.b("tasks.runEarly",m.na.Sd),m.Ta={throttle:function(_,E){_.throttleEvaluation=E;var v=null;return m.$({read:_,write:function(P){clearTimeout(v),v=m.a.setTimeout(function(){_(P)},E)}})},rateLimit:function(_,E){var v,P,R;typeof E=="number"?v=E:(v=E.timeout,P=E.method),_.Hb=!1,R=typeof P=="function"?P:P=="notifyWhenChangesStop"?f:u,_.ub(function(F){return R(F,v,E)})},deferred:function(_,E){if(E!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");_.Hb||(_.Hb=!0,_.ub(function(v){var P,R=!1;return function(){if(!R){m.na.cancel(P),P=m.na.zb(v);try{R=!0,_.notifySubscribers(e,"dirty")}finally{R=!1}}}}))},notify:function(_,E){_.equalityComparer=E=="always"?null:c}};var x={undefined:1,boolean:1,number:1,string:1};m.b("extenders",m.Ta),m.ic=function(_,E,v){this.da=_,this.lc=E,this.mc=v,this.Ib=!1,this.fb=this.Jb=null,m.L(this,"dispose",this.s),m.L(this,"disposeWhenNodeIsRemoved",this.l)},m.ic.prototype.s=function(){this.Ib||(this.fb&&m.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},m.ic.prototype.l=function(_){this.Jb=_,m.a.K.za(_,this.fb=this.s.bind(this))},m.T=function(){m.a.Ab(this,C),C.qb(this)};var C={qb:function(_){_.U={change:[]},_.sc=1},subscribe:function(_,E,v){var P=this;v=v||"change";var R=new m.ic(P,E?_.bind(E):_,function(){m.a.Pa(P.U[v],R),P.hb&&P.hb(v)});return P.Qa&&P.Qa(v),P.U[v]||(P.U[v]=[]),P.U[v].push(R),R},notifySubscribers:function(_,E){if(E=E||"change",E==="change"&&this.Gb(),this.Wa(E)){var v=E==="change"&&this.ed||this.U[E].slice(0);try{m.u.xc();for(var P=0,R;R=v[P];++P)R.Ib||R.lc(_)}finally{m.u.end()}}},ob:function(){return this.sc},Dd:function(_){return this.ob()!==_},Gb:function(){++this.sc},ub:function(_){var E=this,v=m.O(E),P,R,F,U,k;E.gb||(E.gb=E.notifySubscribers,E.notifySubscribers=d);var H=_(function(){E.Ja=!1,v&&U===E&&(U=E.nc?E.nc():E());var V=R||k&&E.sb(F,U);k=R=P=!1,V&&E.gb(F=U)});E.qc=function(V,q){q&&E.Ja||(k=!q),E.ed=E.U.change.slice(0),E.Ja=P=!0,U=V,H()},E.pc=function(V){P||(F=V,E.gb(V,"beforeChange"))},E.rc=function(){k=!0},E.gd=function(){E.sb(F,E.v(!0))&&(R=!0)}},Wa:function(_){return this.U[_]&&this.U[_].length},Bd:function(_){if(_)return this.U[_]&&this.U[_].length||0;var E=0;return m.a.P(this.U,function(v,P){v!=="dirty"&&(E+=P.length)}),E},sb:function(_,E){return!this.equalityComparer||!this.equalityComparer(_,E)},toString:function(){return"[object Object]"},extend:function(_){var E=this;return _&&m.a.P(_,function(v,P){var R=m.Ta[v];typeof R=="function"&&(E=R(E,P)||E)}),E}};m.L(C,"init",C.qb),m.L(C,"subscribe",C.subscribe),m.L(C,"extend",C.extend),m.L(C,"getSubscriptionsCount",C.Bd),m.a.Ba&&m.a.setPrototypeOf(C,Function.prototype),m.T.fn=C,m.Qc=function(_){return _!=null&&typeof _.subscribe=="function"&&typeof _.notifySubscribers=="function"},m.b("subscribable",m.T),m.b("isSubscribable",m.Qc),m.S=m.u=function(){function _(F){v.push(P),P=F}function E(){P=v.pop()}var v=[],P,R=0;return{xc:_,end:E,cc:function(F){if(P){if(!m.Qc(F))throw Error("Only subscribable things can act as dependencies");P.od.call(P.pd,F,F.fd||(F.fd=++R))}},G:function(F,U,k){try{return _(),F.apply(U,k||[])}finally{E()}},qa:function(){if(P)return P.o.qa()},Va:function(){if(P)return P.o.Va()},Ya:function(){if(P)return P.Ya},o:function(){if(P)return P.o}}}(),m.b("computedContext",m.S),m.b("computedContext.getDependenciesCount",m.S.qa),m.b("computedContext.getDependencies",m.S.Va),m.b("computedContext.isInitial",m.S.Ya),m.b("computedContext.registerDependency",m.S.cc),m.b("ignoreDependencies",m.Yd=m.u.G);var A=m.a.Da("_latestValue");m.ta=function(_){function E(){return 0<arguments.length?(E.sb(E[A],arguments[0])&&(E.ya(),E[A]=arguments[0],E.xa()),this):(m.u.cc(E),E[A])}return E[A]=_,m.a.Ba||m.a.extend(E,m.T.fn),m.T.fn.qb(E),m.a.Ab(E,b),m.options.deferUpdates&&m.Ta.deferred(E,!0),E};var b={equalityComparer:c,v:function(){return this[A]},xa:function(){this.notifySubscribers(this[A],"spectate"),this.notifySubscribers(this[A])},ya:function(){this.notifySubscribers(this[A],"beforeChange")}};m.a.Ba&&m.a.setPrototypeOf(b,m.T.fn);var T=m.ta.Ma="__ko_proto__";b[T]=m.ta,m.O=function(_){if((_=typeof _=="function"&&_[T])&&_!==b[T]&&_!==m.o.fn[T])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!_},m.Za=function(_){return typeof _=="function"&&(_[T]===b[T]||_[T]===m.o.fn[T]&&_.Nc)},m.b("observable",m.ta),m.b("isObservable",m.O),m.b("isWriteableObservable",m.Za),m.b("isWritableObservable",m.Za),m.b("observable.fn",b),m.L(b,"peek",b.v),m.L(b,"valueHasMutated",b.xa),m.L(b,"valueWillMutate",b.ya),m.Ha=function(_){if(_=_||[],typeof _!="object"||!("length"in _))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return _=m.ta(_),m.a.Ab(_,m.Ha.fn),_.extend({trackArrayChanges:!0})},m.Ha.fn={remove:function(_){for(var E=this.v(),v=[],P=typeof _!="function"||m.O(_)?function(U){return U===_}:_,R=0;R<E.length;R++){var F=E[R];if(P(F)){if(v.length===0&&this.ya(),E[R]!==F)throw Error("Array modified during remove; cannot remove item");v.push(F),E.splice(R,1),R--}}return v.length&&this.xa(),v},removeAll:function(_){if(_===e){var E=this.v(),v=E.slice(0);return this.ya(),E.splice(0,E.length),this.xa(),v}return _?this.remove(function(P){return 0<=m.a.A(_,P)}):[]},destroy:function(_){var E=this.v(),v=typeof _!="function"||m.O(_)?function(F){return F===_}:_;this.ya();for(var P=E.length-1;0<=P;P--){var R=E[P];v(R)&&(R._destroy=!0)}this.xa()},destroyAll:function(_){return _===e?this.destroy(function(){return!0}):_?this.destroy(function(E){return 0<=m.a.A(_,E)}):[]},indexOf:function(_){var E=this();return m.a.A(E,_)},replace:function(_,E){var v=this.indexOf(_);0<=v&&(this.ya(),this.v()[v]=E,this.xa())},sorted:function(_){var E=this().slice(0);return _?E.sort(_):E.sort()},reversed:function(){return this().slice(0).reverse()}},m.a.Ba&&m.a.setPrototypeOf(m.Ha.fn,m.ta.fn),m.a.D("pop push reverse shift sort splice unshift".split(" "),function(_){m.Ha.fn[_]=function(){var E=this.v();this.ya(),this.zc(E,_,arguments);var v=E[_].apply(E,arguments);return this.xa(),v===E?this:v}}),m.a.D(["slice"],function(_){m.Ha.fn[_]=function(){var E=this();return E[_].apply(E,arguments)}}),m.Pc=function(_){return m.O(_)&&typeof _.remove=="function"&&typeof _.push=="function"},m.b("observableArray",m.Ha),m.b("isObservableArray",m.Pc),m.Ta.trackArrayChanges=function(_,E){function v(){function j(){if(k){var X=[].concat(_.v()||[]),G;_.Wa("arrayChange")&&((!R||1<k)&&(R=m.a.Pb(H,X,_.Ob)),G=R),H=X,R=null,k=0,G&&G.length&&_.notifySubscribers(G,"arrayChange")}}P?j():(P=!0,U=_.subscribe(function(){++k},null,"spectate"),H=[].concat(_.v()||[]),R=null,F=_.subscribe(j))}if(_.Ob={},E&&typeof E=="object"&&m.a.extend(_.Ob,E),_.Ob.sparse=!0,!_.zc){var P=!1,R=null,F,U,k=0,H,V=_.Qa,q=_.hb;_.Qa=function(j){V&&V.call(_,j),j==="arrayChange"&&v()},_.hb=function(j){q&&q.call(_,j),j!=="arrayChange"||_.Wa("arrayChange")||(F&&F.s(),U&&U.s(),U=F=null,P=!1,H=e)},_.zc=function(j,X,G){function $(Te,Oe,Be){return J[J.length]={status:Te,value:Oe,index:Be}}if(P&&!k){var J=[],ce=j.length,de=G.length,ie=0;switch(X){case"push":ie=ce;case"unshift":for(X=0;X<de;X++)$("added",G[X],ie+X);break;case"pop":ie=ce-1;case"shift":ce&&$("deleted",j[ie],ie);break;case"splice":X=Math.min(Math.max(0,0>G[0]?ce+G[0]:G[0]),ce);for(var ce=de===1?ce:Math.min(X+(G[1]||0),ce),de=X+de-2,ie=Math.max(ce,de),ae=[],_e=[],be=2;X<ie;++X,++be)X<ce&&_e.push($("deleted",j[X],X)),X<de&&ae.push($("added",G[be],X));m.a.Kc(_e,ae);break;default:return}R=J}}}};var S=m.a.Da("_state");m.o=m.$=function(_,E,v){function P(){if(0<arguments.length){if(typeof R=="function")R.apply(F.nb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return F.ra||m.u.cc(P),(F.ka||F.J&&P.Xa())&&P.ha(),F.X}if(typeof _=="object"?v=_:(v=v||{},_&&(v.read=_)),typeof v.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var R=v.write,F={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:v.read,nb:E||v.owner,l:v.disposeWhenNodeIsRemoved||v.l||null,Sa:v.disposeWhen||v.Sa,Rb:null,I:{},V:0,Ic:null};return P[S]=F,P.Nc=typeof R=="function",m.a.Ba||m.a.extend(P,m.T.fn),m.T.fn.qb(P),m.a.Ab(P,w),v.pure?(F.wb=!0,F.J=!0,m.a.extend(P,D)):v.deferEvaluation&&m.a.extend(P,I),m.options.deferUpdates&&m.Ta.deferred(P,!0),F.l&&(F.jc=!0,F.l.nodeType||(F.l=null)),F.J||v.deferEvaluation||P.ha(),F.l&&P.ja()&&m.a.K.za(F.l,F.Rb=function(){P.s()}),P};var w={equalityComparer:c,qa:function(){return this[S].V},Va:function(){var _=[];return m.a.P(this[S].I,function(E,v){_[v.Ka]=v.da}),_},Vb:function(_){if(!this[S].V)return!1;var E=this.Va();return m.a.A(E,_)!==-1?!0:!!m.a.Lb(E,function(v){return v.Vb&&v.Vb(_)})},uc:function(_,E,v){if(this[S].wb&&E===this)throw Error("A 'pure' computed must not be called recursively");this[S].I[_]=v,v.Ka=this[S].V++,v.La=E.ob()},Xa:function(){var _,E,v=this[S].I;for(_ in v)if(Object.prototype.hasOwnProperty.call(v,_)&&(E=v[_],this.Ia&&E.da.Ja||E.da.Dd(E.La)))return!0},Jd:function(){this.Ia&&!this[S].rb&&this.Ia(!1)},ja:function(){var _=this[S];return _.ka||0<_.V},Rd:function(){this.Ja?this[S].ka&&(this[S].sa=!0):this.Hc()},$c:function(_){if(_.Hb){var E=_.subscribe(this.Jd,this,"dirty"),v=_.subscribe(this.Rd,this);return{da:_,s:function(){E.s(),v.s()}}}return _.subscribe(this.Hc,this)},Hc:function(){var _=this,E=_.throttleEvaluation;E&&0<=E?(clearTimeout(this[S].Ic),this[S].Ic=m.a.setTimeout(function(){_.ha(!0)},E)):_.Ia?_.Ia(!0):_.ha(!0)},ha:function(_){var E=this[S],v=E.Sa,P=!1;if(!E.rb&&!E.ra){if(E.l&&!m.a.Sb(E.l)||v&&v()){if(!E.jc){this.s();return}}else E.jc=!1;E.rb=!0;try{P=this.zd(_)}finally{E.rb=!1}return P}},zd:function(_){var E=this[S],P=!1,v=E.wb?e:!E.V,P={qd:this,mb:E.I,Qb:E.V};m.u.xc({pd:P,od:g,o:this,Ya:v}),E.I={},E.V=0;var R=this.yd(E,P);return E.V?P=this.sb(E.X,R):(this.s(),P=!0),P&&(E.J?this.Gb():this.notifySubscribers(E.X,"beforeChange"),E.X=R,this.notifySubscribers(E.X,"spectate"),!E.J&&_&&this.notifySubscribers(E.X),this.rc&&this.rc()),v&&this.notifySubscribers(E.X,"awake"),P},yd:function(_,E){try{var v=_.Wc;return _.nb?v.call(_.nb):v()}finally{m.u.end(),E.Qb&&!_.J&&m.a.P(E.mb,p),_.sa=_.ka=!1}},v:function(_){var E=this[S];return(E.ka&&(_||!E.V)||E.J&&this.Xa())&&this.ha(),E.X},ub:function(_){m.T.fn.ub.call(this,_),this.nc=function(){return this[S].J||(this[S].sa?this.ha():this[S].ka=!1),this[S].X},this.Ia=function(E){this.pc(this[S].X),this[S].ka=!0,E&&(this[S].sa=!0),this.qc(this,!E)}},s:function(){var _=this[S];!_.J&&_.I&&m.a.P(_.I,function(E,v){v.s&&v.s()}),_.l&&_.Rb&&m.a.K.yb(_.l,_.Rb),_.I=e,_.V=0,_.ra=!0,_.sa=!1,_.ka=!1,_.J=!1,_.l=e,_.Sa=e,_.Wc=e,this.Nc||(_.nb=e)}},D={Qa:function(_){var E=this,v=E[S];if(!v.ra&&v.J&&_=="change"){if(v.J=!1,v.sa||E.Xa())v.I=null,v.V=0,E.ha()&&E.Gb();else{var P=[];m.a.P(v.I,function(R,F){P[F.Ka]=R}),m.a.D(P,function(R,F){var U=v.I[R],k=E.$c(U.da);k.Ka=F,k.La=U.La,v.I[R]=k}),E.Xa()&&E.ha()&&E.Gb()}v.ra||E.notifySubscribers(v.X,"awake")}},hb:function(_){var E=this[S];E.ra||_!="change"||this.Wa("change")||(m.a.P(E.I,function(v,P){P.s&&(E.I[v]={da:P.da,Ka:P.Ka,La:P.La},P.s())}),E.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var _=this[S];return _.J&&(_.sa||this.Xa())&&this.ha(),m.T.fn.ob.call(this)}},I={Qa:function(_){_!="change"&&_!="beforeChange"||this.v()}};m.a.Ba&&m.a.setPrototypeOf(w,m.T.fn);var O=m.ta.Ma;w[O]=m.o,m.Oc=function(_){return typeof _=="function"&&_[O]===w[O]},m.Fd=function(_){return m.Oc(_)&&_[S]&&_[S].wb},m.b("computed",m.o),m.b("dependentObservable",m.o),m.b("isComputed",m.Oc),m.b("isPureComputed",m.Fd),m.b("computed.fn",w),m.L(w,"peek",w.v),m.L(w,"dispose",w.s),m.L(w,"isActive",w.ja),m.L(w,"getDependenciesCount",w.qa),m.L(w,"getDependencies",w.Va),m.xb=function(_,E){return typeof _=="function"?m.o(_,E,{pure:!0}):(_=m.a.extend({},_),_.pure=!0,m.o(_,E))},m.b("pureComputed",m.xb),function(){function _(P,R,F){if(F=F||new v,P=R(P),typeof P!="object"||P===null||P===e||P instanceof RegExp||P instanceof Date||P instanceof String||P instanceof Number||P instanceof Boolean)return P;var U=P instanceof Array?[]:{};return F.save(P,U),E(P,function(k){var H=R(P[k]);switch(typeof H){case"boolean":case"number":case"string":case"function":U[k]=H;break;case"object":case"undefined":var V=F.get(H);U[k]=V!==e?V:_(H,R,F)}}),U}function E(P,R){if(P instanceof Array){for(var F=0;F<P.length;F++)R(F);typeof P.toJSON=="function"&&R("toJSON")}else for(F in P)R(F)}function v(){this.keys=[],this.values=[]}m.ad=function(P){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return _(P,function(R){for(var F=0;m.O(R)&&10>F;F++)R=R();return R})},m.toJSON=function(P,R,F){return P=m.ad(P),m.a.hc(P,R,F)},v.prototype={constructor:v,save:function(P,R){var F=m.a.A(this.keys,P);0<=F?this.values[F]=R:(this.keys.push(P),this.values.push(R))},get:function(P){return P=m.a.A(this.keys,P),0<=P?this.values[P]:e}}}(),m.b("toJS",m.ad),m.b("toJSON",m.toJSON),m.Wd=function(_,E,v){function P(R){var F=m.xb(_,v).extend({ma:"always"}),U=F.subscribe(function(k){k&&(U.s(),R(k))});return F.notifySubscribers(F.v()),U}return typeof Promise!="function"||E?P(E.bind(v)):new Promise(P)},m.b("when",m.Wd),function(){m.w={M:function(_){switch(m.a.R(_)){case"option":return _.__ko__hasDomDataOptionValue__===!0?m.a.g.get(_,m.c.options.$b):7>=m.a.W?_.getAttributeNode("value")&&_.getAttributeNode("value").specified?_.value:_.text:_.value;case"select":return 0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex]):e;default:return _.value}},cb:function(_,E,v){switch(m.a.R(_)){case"option":typeof E=="string"?(m.a.g.set(_,m.c.options.$b,e),"__ko__hasDomDataOptionValue__"in _&&delete _.__ko__hasDomDataOptionValue__,_.value=E):(m.a.g.set(_,m.c.options.$b,E),_.__ko__hasDomDataOptionValue__=!0,_.value=typeof E=="number"?E:"");break;case"select":(E===""||E===null)&&(E=e);for(var P=-1,R=0,F=_.options.length,U;R<F;++R)if(U=m.w.M(_.options[R]),U==E||U===""&&E===e){P=R;break}(v||0<=P||E===e&&1<_.size)&&(_.selectedIndex=P,m.a.W===6&&m.a.setTimeout(function(){_.selectedIndex=P},0));break;default:(E===null||E===e)&&(E=""),_.value=E}}}}(),m.b("selectExtensions",m.w),m.b("selectExtensions.readValue",m.w.M),m.b("selectExtensions.writeValue",m.w.cb),m.m=function(){function _(k){k=m.a.Db(k),k.charCodeAt(0)===123&&(k=k.slice(1,-1)),k+=`
- ,`;var H=[],V=k.match(P),q,j=[],X=0;if(1<V.length){for(var G=0,$;$=V[G];++G){var J=$.charCodeAt(0);if(J===44){if(0>=X){H.push(q&&j.length?{key:q,value:j.join("")}:{unknown:q||j.join("")}),q=X=0,j=[];continue}}else if(J===58){if(!X&&!q&&j.length===1){q=j.pop();continue}}else{if(J===47&&1<$.length&&($.charCodeAt(1)===47||$.charCodeAt(1)===42))continue;J===47&&G&&1<$.length?(J=V[G-1].match(R))&&!F[J[0]]&&(k=k.substr(k.indexOf($)+1),V=k.match(P),G=-1,$="/"):J===40||J===123||J===91?++X:J===41||J===125||J===93?--X:q||j.length||J!==34&&J!==39||($=$.slice(1,-1))}j.push($)}if(0<X)throw Error("Unbalanced parentheses, braces, or brackets")}return H}var E=["true","false","null","undefined"],v=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,P=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*
- |/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),R=/[\])"'A-Za-z0-9_$]+$/,F={in:1,return:1,typeof:1},U={};return{Ra:[],wa:U,ac:_,vb:function(k,H){function V(J,ce){var de;if(!G){var ie=m.getBindingHandler(J);if(ie&&ie.preprocess&&!(ce=ie.preprocess(ce,J,V)))return;(ie=U[J])&&(de=ce,0<=m.a.A(E,de)?de=!1:(ie=de.match(v),de=ie===null?!1:ie[1]?"Object("+ie[1]+")"+ie[2]:de),ie=de),ie&&j.push("'"+(typeof U[J]=="string"?U[J]:J)+"':function(_z){"+de+"=_z}")}X&&(ce="function(){return "+ce+" }"),q.push("'"+J+"':"+ce)}H=H||{};var q=[],j=[],X=H.valueAccessors,G=H.bindingParams,$=typeof k=="string"?_(k):k;return m.a.D($,function(J){V(J.key||J.unknown,J.value)}),j.length&&V("_ko_property_writers","{"+j.join(",")+" }"),q.join(",")},Id:function(k,H){for(var V=0;V<k.length;V++)if(k[V].key==H)return!0;return!1},eb:function(k,H,V,q,j){k&&m.O(k)?!m.Za(k)||j&&k.v()===q||k(q):(k=H.get("_ko_property_writers"))&&k[V]&&k[V](q)}}}(),m.b("expressionRewriting",m.m),m.b("expressionRewriting.bindingRewriteValidators",m.m.Ra),m.b("expressionRewriting.parseObjectLiteral",m.m.ac),m.b("expressionRewriting.preProcessBindings",m.m.vb),m.b("expressionRewriting._twoWayBindings",m.m.wa),m.b("jsonExpressionRewriting",m.m),m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",m.m.vb),function(){function _(V){return V.nodeType==8&&F.test(R?V.text:V.nodeValue)}function E(V){return V.nodeType==8&&U.test(R?V.text:V.nodeValue)}function v(V,q){for(var j=V,X=1,G=[];j=j.nextSibling;){if(E(j)&&(m.a.g.set(j,H,!0),X--,X===0))return G;G.push(j),_(j)&&X++}if(!q)throw Error("Cannot find closing comment tag to match: "+V.nodeValue);return null}function P(V,q){var j=v(V,q);return j?0<j.length?j[j.length-1].nextSibling:V.nextSibling:null}var R=n&&n.createComment("test").text==="<!--test-->",F=R?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,U=R?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,k={ul:!0,ol:!0},H="__ko_matchedEndComment__";m.h={ea:{},childNodes:function(V){return _(V)?v(V):V.childNodes},Ea:function(V){if(_(V)){V=m.h.childNodes(V);for(var q=0,j=V.length;q<j;q++)m.removeNode(V[q])}else m.a.Tb(V)},va:function(V,q){if(_(V)){m.h.Ea(V);for(var j=V.nextSibling,X=0,G=q.length;X<G;X++)j.parentNode.insertBefore(q[X],j)}else m.a.va(V,q)},Vc:function(V,q){var j;_(V)?(j=V.nextSibling,V=V.parentNode):j=V.firstChild,j?q!==j&&V.insertBefore(q,j):V.appendChild(q)},Wb:function(V,q,j){j?(j=j.nextSibling,_(V)&&(V=V.parentNode),j?q!==j&&V.insertBefore(q,j):V.appendChild(q)):m.h.Vc(V,q)},firstChild:function(V){if(_(V))return!V.nextSibling||E(V.nextSibling)?null:V.nextSibling;if(V.firstChild&&E(V.firstChild))throw Error("Found invalid end comment, as the first child of "+V);return V.firstChild},nextSibling:function(V){if(_(V)&&(V=P(V)),V.nextSibling&&E(V.nextSibling)){var q=V.nextSibling;if(E(q)&&!m.a.g.get(q,H))throw Error("Found end comment without a matching opening comment, as child of "+V);return null}return V.nextSibling},Cd:_,Vd:function(V){return(V=(R?V.text:V.nodeValue).match(F))?V[1]:null},Sc:function(V){if(k[m.a.R(V)]){var q=V.firstChild;if(q)do if(q.nodeType===1){var j;j=q.firstChild;var X=null;if(j)do if(X)X.push(j);else if(_(j)){var G=P(j,!0);G?j=G:X=[j]}else E(j)&&(X=[j]);while(j=j.nextSibling);if(j=X)for(X=q.nextSibling,G=0;G<j.length;G++)X?V.insertBefore(j[G],X):V.appendChild(j[G])}while(q=q.nextSibling)}}}}(),m.b("virtualElements",m.h),m.b("virtualElements.allowedBindings",m.h.ea),m.b("virtualElements.emptyNode",m.h.Ea),m.b("virtualElements.insertAfter",m.h.Wb),m.b("virtualElements.prepend",m.h.Vc),m.b("virtualElements.setDomNodeChildren",m.h.va),function(){m.ga=function(){this.nd={}},m.a.extend(m.ga.prototype,{nodeHasBindings:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind")!=null||m.j.getComponentNameForNode(_);case 8:return m.h.Cd(_);default:return!1}},getBindings:function(_,E){var v=this.getBindingsString(_,E),v=v?this.parseBindingsString(v,E,_):null;return m.j.tc(v,_,E,!1)},getBindingAccessors:function(_,E){var v=this.getBindingsString(_,E),v=v?this.parseBindingsString(v,E,_,{valueAccessors:!0}):null;return m.j.tc(v,_,E,!0)},getBindingsString:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind");case 8:return m.h.Vd(_);default:return null}},parseBindingsString:function(_,E,v,P){try{var R=this.nd,F=_+(P&&P.valueAccessors||""),U;if(!(U=R[F])){var k,H="with($context){with($data||{}){return{"+m.m.vb(_,P)+"}}}";k=new Function("$context","$element",H),U=R[F]=k}return U(E,v)}catch(V){throw V.message=`Unable to parse bindings.
- Bindings value: `+_+`
- Message: `+V.message,V}}}),m.ga.instance=new m.ga}(),m.b("bindingProvider",m.ga),function(){function _(ie){var ae=(ie=m.a.g.get(ie,de))&&ie.N;ae&&(ie.N=null,ae.Tc())}function E(ie,ae,_e){this.node=ie,this.yc=ae,this.kb=[],this.H=!1,ae.N||m.a.K.za(ie,_),_e&&_e.N&&(_e.N.kb.push(ie),this.Kb=_e)}function v(ie){return function(){return ie}}function P(ie){return ie()}function R(ie){return m.a.Ga(m.u.G(ie),function(ae,_e){return function(){return ie()[_e]}})}function F(ie,ae,_e){return typeof ie=="function"?R(ie.bind(null,ae,_e)):m.a.Ga(ie,v)}function U(ie,ae){return R(this.getBindings.bind(this,ie,ae))}function k(ie,ae){var _e=m.h.firstChild(ae);if(_e){var be,Te=m.ga.instance,Oe=Te.preprocessNode;if(Oe){for(;be=_e;)_e=m.h.nextSibling(be),Oe.call(Te,be);_e=m.h.firstChild(ae)}for(;be=_e;)_e=m.h.nextSibling(be),H(ie,be)}m.i.ma(ae,m.i.H)}function H(ie,ae){var _e=ie,be=ae.nodeType===1;be&&m.h.Sc(ae),(be||m.ga.instance.nodeHasBindings(ae))&&(_e=q(ae,null,ie).bindingContextForDescendants),_e&&!J[m.a.R(ae)]&&k(_e,ae)}function V(ie){var ae=[],_e={},be=[];return m.a.P(ie,function Te(Oe){if(!_e[Oe]){var Be=m.getBindingHandler(Oe);Be&&(Be.after&&(be.push(Oe),m.a.D(Be.after,function(tt){if(ie[tt]){if(m.a.A(be,tt)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+be.join(", "));Te(tt)}}),be.length--),ae.push({key:Oe,Mc:Be})),_e[Oe]=!0}}),ae}function q(ie,ae,_e){var be=m.a.g.Ub(ie,de,{}),Te=be.hd;if(!ae){if(Te)throw Error("You cannot apply bindings multiple times to the same element.");be.hd=!0}Te||(be.context=_e),be.Zb||(be.Zb={});var Oe;if(ae&&typeof ae!="function")Oe=ae;else{var Be=m.ga.instance,tt=Be.getBindingAccessors||U,lt=m.$(function(){return(Oe=ae?ae(_e,ie):tt.call(Be,ie,_e))&&(_e[X]&&_e[X](),_e[$]&&_e[$]()),Oe},null,{l:ie});Oe&<.ja()||(lt=null)}var Pt=_e,ht;if(Oe){var wn=function(){return m.a.Ga(lt?lt():Oe,P)},ii=lt?function(nt){return function(){return P(lt()[nt])}}:function(nt){return Oe[nt]};wn.get=function(nt){return Oe[nt]&&P(ii(nt))},wn.has=function(nt){return nt in Oe},m.i.H in Oe&&m.i.subscribe(ie,m.i.H,function(){var nt=(0,Oe[m.i.H])();if(nt){var Mt=m.h.childNodes(ie);Mt.length&&nt(Mt,m.Ec(Mt[0]))}}),m.i.pa in Oe&&(Pt=m.i.Cb(ie,_e),m.i.subscribe(ie,m.i.pa,function(){var nt=(0,Oe[m.i.pa])();nt&&m.h.firstChild(ie)&&nt(ie)})),be=V(Oe),m.a.D(be,function(nt){var Mt=nt.Mc.init,ri=nt.Mc.update,we=nt.key;if(ie.nodeType===8&&!m.h.ea[we])throw Error("The binding '"+we+"' cannot be used with virtual elements");try{typeof Mt=="function"&&m.u.G(function(){var _t=Mt(ie,ii(we),wn,Pt.$data,Pt);if(_t&&_t.controlsDescendantBindings){if(ht!==e)throw Error("Multiple bindings ("+ht+" and "+we+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");ht=we}}),typeof ri=="function"&&m.$(function(){ri(ie,ii(we),wn,Pt.$data,Pt)},null,{l:ie})}catch(_t){throw _t.message='Unable to process binding "'+we+": "+Oe[we]+`"
- Message: `+_t.message,_t}})}return be=ht===e,{shouldBindDescendants:be,bindingContextForDescendants:be&&Pt}}function j(ie,ae){return ie&&ie instanceof m.fa?ie:new m.fa(ie,e,e,ae)}var X=m.a.Da("_subscribable"),G=m.a.Da("_ancestorBindingInfo"),$=m.a.Da("_dataDependency");m.c={};var J={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(ie){return m.c[ie]};var ce={};m.fa=function(ie,ae,_e,be,Te){function Oe(){var ii=Pt?lt():lt,nt=m.a.f(ii);return ae?(m.a.extend(Be,ae),G in ae&&(Be[G]=ae[G])):(Be.$parents=[],Be.$root=nt,Be.ko=m),Be[X]=ht,tt?nt=Be.$data:(Be.$rawData=ii,Be.$data=nt),_e&&(Be[_e]=nt),be&&be(Be,ae,nt),ae&&ae[X]&&!m.S.o().Vb(ae[X])&&ae[X](),wn&&(Be[$]=wn),Be.$data}var Be=this,tt=ie===ce,lt=tt?e:ie,Pt=typeof lt=="function"&&!m.O(lt),ht,wn=Te&&Te.dataDependency;Te&&Te.exportDependencies?Oe():(ht=m.xb(Oe),ht.v(),ht.ja()?ht.equalityComparer=null:Be[X]=e)},m.fa.prototype.createChildContext=function(ie,ae,_e,be){if(!be&&ae&&typeof ae=="object"&&(be=ae,ae=be.as,_e=be.extend),ae&&be&&be.noChildContext){var Te=typeof ie=="function"&&!m.O(ie);return new m.fa(ce,this,null,function(Oe){_e&&_e(Oe),Oe[ae]=Te?ie():ie},be)}return new m.fa(ie,this,ae,function(Oe,Be){Oe.$parentContext=Be,Oe.$parent=Be.$data,Oe.$parents=(Be.$parents||[]).slice(0),Oe.$parents.unshift(Oe.$parent),_e&&_e(Oe)},be)},m.fa.prototype.extend=function(ie,ae){return new m.fa(ce,this,null,function(_e){m.a.extend(_e,typeof ie=="function"?ie(_e):ie)},ae)};var de=m.a.g.Z();E.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},E.prototype.sd=function(ie){m.a.Pa(this.kb,ie),!this.kb.length&&this.H&&this.Cc()},E.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,m.a.K.yb(this.node,_),m.i.ma(this.node,m.i.pa),this.Tc())},m.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(ie,ae,_e,be,Te){var Oe=m.a.g.Ub(ie,de,{});return Oe.Fa||(Oe.Fa=new m.T),Te&&Te.notifyImmediately&&Oe.Zb[ae]&&m.u.G(_e,be,[ie]),Oe.Fa.subscribe(_e,be,ae)},ma:function(ie,ae){var _e=m.a.g.get(ie,de);if(_e&&(_e.Zb[ae]=!0,_e.Fa&&_e.Fa.notifySubscribers(ie,ae),ae==m.i.H)){if(_e.N)_e.N.Cc();else if(_e.N===e&&_e.Fa&&_e.Fa.Wa(m.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(ie,ae){var _e=m.a.g.Ub(ie,de,{});return _e.N||(_e.N=new E(ie,_e,ae[G])),ae[G]==_e?ae:ae.extend(function(be){be[G]=_e})}},m.Td=function(ie){return(ie=m.a.g.get(ie,de))&&ie.context},m.ib=function(ie,ae,_e){return ie.nodeType===1&&m.h.Sc(ie),q(ie,ae,j(_e))},m.ld=function(ie,ae,_e){return _e=j(_e),m.ib(ie,F(ae,_e,ie),_e)},m.Oa=function(ie,ae){ae.nodeType!==1&&ae.nodeType!==8||k(j(ie),ae)},m.vc=function(ie,ae,_e){if(!r&&t.jQuery&&(r=t.jQuery),2>arguments.length){if(ae=n.body,!ae)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!ae||ae.nodeType!==1&&ae.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");H(j(ie,_e),ae)},m.Dc=function(ie){return!ie||ie.nodeType!==1&&ie.nodeType!==8?e:m.Td(ie)},m.Ec=function(ie){return(ie=m.Dc(ie))?ie.$data:e},m.b("bindingHandlers",m.c),m.b("bindingEvent",m.i),m.b("bindingEvent.subscribe",m.i.subscribe),m.b("bindingEvent.startPossiblyAsyncContentBinding",m.i.Cb),m.b("applyBindings",m.vc),m.b("applyBindingsToDescendants",m.Oa),m.b("applyBindingAccessorsToNode",m.ib),m.b("applyBindingsToNode",m.ld),m.b("contextFor",m.Dc),m.b("dataFor",m.Ec)}(),function(_){function E(U,k){var H=Object.prototype.hasOwnProperty.call(R,U)?R[U]:_,V;H?H.subscribe(k):(H=R[U]=new m.T,H.subscribe(k),v(U,function(q,j){var X=!(!j||!j.synchronous);F[U]={definition:q,Gd:X},delete R[U],V||X?H.notifySubscribers(q):m.na.zb(function(){H.notifySubscribers(q)})}),V=!0)}function v(U,k){P("getConfig",[U],function(H){H?P("loadComponent",[U,H],function(V){k(V,H)}):k(null,null)})}function P(U,k,H,V){V||(V=m.j.loaders.slice(0));var q=V.shift();if(q){var j=q[U];if(j){var X=!1;if(j.apply(q,k.concat(function(G){X?H(null):G!==null?H(G):P(U,k,H,V)}))!==_&&(X=!0,!q.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else P(U,k,H,V)}else H(null)}var R={},F={};m.j={get:function(U,k){var H=Object.prototype.hasOwnProperty.call(F,U)?F[U]:_;H?H.Gd?m.u.G(function(){k(H.definition)}):m.na.zb(function(){k(H.definition)}):E(U,k)},Bc:function(U){delete F[U]},oc:P},m.j.loaders=[],m.b("components",m.j),m.b("components.get",m.j.get),m.b("components.clearCachedDefinition",m.j.Bc)}(),function(){function _(H,V,q,j){function X(){--$===0&&j(G)}var G={},$=2,J=q.template;q=q.viewModel,J?R(V,J,function(ce){m.j.oc("loadTemplate",[H,ce],function(de){G.template=de,X()})}):X(),q?R(V,q,function(ce){m.j.oc("loadViewModel",[H,ce],function(de){G[k]=de,X()})}):X()}function E(H,V,q){if(typeof V=="function")q(function(X){return new V(X)});else if(typeof V[k]=="function")q(V[k]);else if("instance"in V){var j=V.instance;q(function(){return j})}else"viewModel"in V?E(H,V.viewModel,q):H("Unknown viewModel value: "+V)}function v(H){switch(m.a.R(H)){case"script":return m.a.ua(H.text);case"textarea":return m.a.ua(H.value);case"template":if(P(H.content))return m.a.Ca(H.content.childNodes)}return m.a.Ca(H.childNodes)}function P(H){return t.DocumentFragment?H instanceof DocumentFragment:H&&H.nodeType===11}function R(H,V,q){typeof V.require=="string"?a||t.require?(a||t.require)([V.require],function(j){j&&typeof j=="object"&&j.Xd&&j.default&&(j=j.default),q(j)}):H("Uses require, but no AMD loader is present"):q(V)}function F(H){return function(V){throw Error("Component '"+H+"': "+V)}}var U={};m.j.register=function(H,V){if(!V)throw Error("Invalid configuration for "+H);if(m.j.tb(H))throw Error("Component "+H+" is already registered");U[H]=V},m.j.tb=function(H){return Object.prototype.hasOwnProperty.call(U,H)},m.j.unregister=function(H){delete U[H],m.j.Bc(H)},m.j.Fc={getConfig:function(H,V){V(m.j.tb(H)?U[H]:null)},loadComponent:function(H,V,q){var j=F(H);R(j,V,function(X){_(H,j,X,q)})},loadTemplate:function(H,V,q){if(H=F(H),typeof V=="string")q(m.a.ua(V));else if(V instanceof Array)q(V);else if(P(V))q(m.a.la(V.childNodes));else if(V.element)if(V=V.element,t.HTMLElement?V instanceof HTMLElement:V&&V.tagName&&V.nodeType===1)q(v(V));else if(typeof V=="string"){var j=n.getElementById(V);j?q(v(j)):H("Cannot find element with ID "+V)}else H("Unknown element type: "+V);else H("Unknown template value: "+V)},loadViewModel:function(H,V,q){E(F(H),V,q)}};var k="createViewModel";m.b("components.register",m.j.register),m.b("components.isRegistered",m.j.tb),m.b("components.unregister",m.j.unregister),m.b("components.defaultLoader",m.j.Fc),m.j.loaders.push(m.j.Fc),m.j.dd=U}(),function(){function _(v,P){var R=v.getAttribute("params");if(R){var R=E.parseBindingsString(R,P,v,{valueAccessors:!0,bindingParams:!0}),R=m.a.Ga(R,function(k){return m.o(k,null,{l:v})}),F=m.a.Ga(R,function(k){var H=k.v();return k.ja()?m.o({read:function(){return m.a.f(k())},write:m.Za(H)&&function(V){k()(V)},l:v}):H});return Object.prototype.hasOwnProperty.call(F,"$raw")||(F.$raw=R),F}return{$raw:{}}}m.j.getComponentNameForNode=function(v){var P=m.a.R(v);if(m.j.tb(P)&&(P.indexOf("-")!=-1||""+v=="[object HTMLUnknownElement]"||8>=m.a.W&&v.tagName===P))return P},m.j.tc=function(v,P,R,F){if(P.nodeType===1){var U=m.j.getComponentNameForNode(P);if(U){if(v=v||{},v.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var k={name:U,params:_(P,R)};v.component=F?function(){return k}:k}}return v};var E=new m.ga;9>m.a.W&&(m.j.register=function(v){return function(P){return v.apply(this,arguments)}}(m.j.register),n.createDocumentFragment=function(v){return function(){var P=v(),R=m.j.dd,F;for(F in R);return P}}(n.createDocumentFragment))}(),function(){function _(P,R,F){if(R=R.template,!R)throw Error("Component '"+P+"' has no template");P=m.a.Ca(R),m.h.va(F,P)}function E(P,R,F){var U=P.createViewModel;return U?U.call(P,R,F):R}var v=0;m.c.component={init:function(P,R,F,U,k){function H(){var G=V&&V.dispose;typeof G=="function"&&G.call(V),j&&j.s(),q=V=j=null}var V,q,j,X=m.a.la(m.h.childNodes(P));return m.h.Ea(P),m.a.K.za(P,H),m.o(function(){var G=m.a.f(R()),$,J;if(typeof G=="string"?$=G:($=m.a.f(G.name),J=m.a.f(G.params)),!$)throw Error("No component name specified");var ce=m.i.Cb(P,k),de=q=++v;m.j.get($,function(ie){if(q===de){if(H(),!ie)throw Error("Unknown component '"+$+"'");_($,ie,P);var ae=E(ie,J,{element:P,templateNodes:X});ie=ce.createChildContext(ae,{extend:function(_e){_e.$component=ae,_e.$componentTemplateNodes=X}}),ae&&ae.koDescendantsComplete&&(j=m.i.subscribe(P,m.i.pa,ae.koDescendantsComplete,ae)),V=ae,m.Oa(ie,P)}})},null,{l:P}),{controlsDescendantBindings:!0}}},m.h.ea.component=!0}();var B={class:"className",for:"htmlFor"};m.c.attr={update:function(_,E){var v=m.a.f(E())||{};m.a.P(v,function(P,R){R=m.a.f(R);var F=P.indexOf(":"),F="lookupNamespaceURI"in _&&0<F&&_.lookupNamespaceURI(P.substr(0,F)),U=R===!1||R===null||R===e;U?F?_.removeAttributeNS(F,P):_.removeAttribute(P):R=R.toString(),8>=m.a.W&&P in B?(P=B[P],U?_.removeAttribute(P):_[P]=R):U||(F?_.setAttributeNS(F,P,R):_.setAttribute(P,R)),P==="name"&&m.a.Yc(_,U?"":R)})}},function(){m.c.checked={after:["value","attr"],init:function(_,E,v){function P(){var G=_.checked,$=F();if(!m.S.Ya()&&(G||!k&&!m.S.qa())){var J=m.u.G(E);if(V){var ce=q?J.v():J,de=X;X=$,de!==$?G&&(m.a.Na(ce,$,!0),m.a.Na(ce,de,!1)):m.a.Na(ce,$,G),q&&m.Za(J)&&J(ce)}else U&&($===e?$=G:G||($=e)),m.m.eb(J,v,"checked",$,!0)}}function R(){var G=m.a.f(E()),$=F();V?(_.checked=0<=m.a.A(G,$),X=$):_.checked=U&&$===e?!!G:F()===G}var F=m.xb(function(){if(v.has("checkedValue"))return m.a.f(v.get("checkedValue"));if(j)return v.has("value")?m.a.f(v.get("value")):_.value}),U=_.type=="checkbox",k=_.type=="radio";if(U||k){var H=E(),V=U&&m.a.f(H)instanceof Array,q=!(V&&H.push&&H.splice),j=k||V,X=V?F():e;k&&!_.name&&m.c.uniqueName.init(_,function(){return!0}),m.o(P,null,{l:_}),m.a.B(_,"click",P),m.o(R,null,{l:_}),H=e}}},m.m.wa.checked=!0,m.c.checkedValue={update:function(_,E){_.value=m.a.f(E())}}}(),m.c.class={update:function(_,E){var v=m.a.Db(m.a.f(E()));m.a.Eb(_,_.__ko__cssValue,!1),_.__ko__cssValue=v,m.a.Eb(_,v,!0)}},m.c.css={update:function(_,E){var v=m.a.f(E());v!==null&&typeof v=="object"?m.a.P(v,function(P,R){R=m.a.f(R),m.a.Eb(_,P,R)}):m.c.class.update(_,E)}},m.c.enable={update:function(_,E){var v=m.a.f(E());v&&_.disabled?_.removeAttribute("disabled"):v||_.disabled||(_.disabled=!0)}},m.c.disable={update:function(_,E){m.c.enable.update(_,function(){return!m.a.f(E())})}},m.c.event={init:function(_,E,v,P,R){var F=E()||{};m.a.P(F,function(U){typeof U=="string"&&m.a.B(_,U,function(k){var H,V=E()[U];if(V){try{var q=m.a.la(arguments);P=R.$data,q.unshift(P),H=V.apply(P,q)}finally{H!==!0&&(k.preventDefault?k.preventDefault():k.returnValue=!1)}v.get(U+"Bubble")===!1&&(k.cancelBubble=!0,k.stopPropagation&&k.stopPropagation())}})})}},m.c.foreach={Rc:function(_){return function(){var E=_(),v=m.a.bc(E);return!v||typeof v.length=="number"?{foreach:E,templateEngine:m.ba.Ma}:(m.a.f(E),{foreach:v.data,as:v.as,noChildContext:v.noChildContext,includeDestroyed:v.includeDestroyed,afterAdd:v.afterAdd,beforeRemove:v.beforeRemove,afterRender:v.afterRender,beforeMove:v.beforeMove,afterMove:v.afterMove,templateEngine:m.ba.Ma})}},init:function(_,E){return m.c.template.init(_,m.c.foreach.Rc(E))},update:function(_,E,v,P,R){return m.c.template.update(_,m.c.foreach.Rc(E),v,P,R)}},m.m.Ra.foreach=!1,m.h.ea.foreach=!0,m.c.hasfocus={init:function(_,E,v){function P(U){_.__ko_hasfocusUpdating=!0;var k=_.ownerDocument;if("activeElement"in k){var H;try{H=k.activeElement}catch{H=k.body}U=H===_}k=E(),m.m.eb(k,v,"hasfocus",U,!0),_.__ko_hasfocusLastValue=U,_.__ko_hasfocusUpdating=!1}var R=P.bind(null,!0),F=P.bind(null,!1);m.a.B(_,"focus",R),m.a.B(_,"focusin",R),m.a.B(_,"blur",F),m.a.B(_,"focusout",F),_.__ko_hasfocusLastValue=!1},update:function(_,E){var v=!!m.a.f(E());_.__ko_hasfocusUpdating||_.__ko_hasfocusLastValue===v||(v?_.focus():_.blur(),!v&&_.__ko_hasfocusLastValue&&_.ownerDocument.body.focus(),m.u.G(m.a.Fb,null,[_,v?"focusin":"focusout"]))}},m.m.wa.hasfocus=!0,m.c.hasFocus=m.c.hasfocus,m.m.wa.hasFocus="hasfocus",m.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(_,E){m.a.fc(_,E())}},function(){function _(E,v,P){m.c[E]={init:function(R,F,U,k,H){var V,q,j={},X,G,$;if(v){k=U.get("as");var J=U.get("noChildContext");$=!(k&&J),j={as:k,noChildContext:J,exportDependencies:$}}return G=(X=U.get("completeOn")=="render")||U.has(m.i.pa),m.o(function(){var ce=m.a.f(F()),de=!P!=!ce,ie=!q,ae;($||de!==V)&&(G&&(H=m.i.Cb(R,H)),de&&((!v||$)&&(j.dataDependency=m.S.o()),ae=v?H.createChildContext(typeof ce=="function"?ce:F,j):m.S.qa()?H.extend(null,j):H),ie&&m.S.qa()&&(q=m.a.Ca(m.h.childNodes(R),!0)),de?(ie||m.h.va(R,m.a.Ca(q)),m.Oa(ae,R)):(m.h.Ea(R),X||m.i.ma(R,m.i.H)),V=de)},null,{l:R}),{controlsDescendantBindings:!0}}},m.m.Ra[E]=!1,m.h.ea[E]=!0}_("if"),_("ifnot",!1,!0),_("with",!0)}(),m.c.let={init:function(_,E,v,P,R){return E=R.extend(E),m.Oa(E,_),{controlsDescendantBindings:!0}}},m.h.ea.let=!0;var L={};m.c.options={init:function(_){if(m.a.R(_)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<_.length;)_.remove(0);return{controlsDescendantBindings:!0}},update:function(_,E,v){function P(){return m.a.jb(_.options,function(J){return J.selected})}function R(J,ce,de){var ie=typeof ce;return ie=="function"?ce(J):ie=="string"?J[ce]:de}function F(J,ce){if(G&&V)m.i.ma(_,m.i.H);else if(X.length){var de=0<=m.a.A(X,m.w.M(ce[0]));m.a.Zc(ce[0],de),G&&!de&&m.u.G(m.a.Fb,null,[_,"change"])}}var U=_.multiple,k=_.length!=0&&U?_.scrollTop:null,H=m.a.f(E()),V=v.get("valueAllowUnset")&&v.has("value"),q=v.get("optionsIncludeDestroyed");E={};var j,X=[];V||(U?X=m.a.Mb(P(),m.w.M):0<=_.selectedIndex&&X.push(m.w.M(_.options[_.selectedIndex]))),H&&(typeof H.length>"u"&&(H=[H]),j=m.a.jb(H,function(J){return q||J===e||J===null||!m.a.f(J._destroy)}),v.has("optionsCaption")&&(H=m.a.f(v.get("optionsCaption")),H!==null&&H!==e&&j.unshift(L)));var G=!1;if(E.beforeRemove=function(J){_.removeChild(J)},H=F,v.has("optionsAfterRender")&&typeof v.get("optionsAfterRender")=="function"&&(H=function(J,ce){F(0,ce),m.u.G(v.get("optionsAfterRender"),null,[ce[0],J!==L?J:e])}),m.a.ec(_,j,function(J,ce,de){return de.length&&(X=!V&&de[0].selected?[m.w.M(de[0])]:[],G=!0),ce=_.ownerDocument.createElement("option"),J===L?(m.a.Bb(ce,v.get("optionsCaption")),m.w.cb(ce,e)):(de=R(J,v.get("optionsValue"),J),m.w.cb(ce,m.a.f(de)),J=R(J,v.get("optionsText"),de),m.a.Bb(ce,J)),[ce]},E,H),!V){var $;U?$=X.length&&P().length<X.length:$=X.length&&0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex])!==X[0]:X.length||0<=_.selectedIndex,$&&m.u.G(m.a.Fb,null,[_,"change"])}(V||m.S.Ya())&&m.i.ma(_,m.i.H),m.a.wd(_),k&&20<Math.abs(k-_.scrollTop)&&(_.scrollTop=k)}},m.c.options.$b=m.a.g.Z(),m.c.selectedOptions={init:function(_,E,v){function P(){var U=E(),k=[];m.a.D(_.getElementsByTagName("option"),function(H){H.selected&&k.push(m.w.M(H))}),m.m.eb(U,v,"selectedOptions",k)}function R(){var U=m.a.f(E()),k=_.scrollTop;U&&typeof U.length=="number"&&m.a.D(_.getElementsByTagName("option"),function(H){var V=0<=m.a.A(U,m.w.M(H));H.selected!=V&&m.a.Zc(H,V)}),_.scrollTop=k}if(m.a.R(_)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var F;m.i.subscribe(_,m.i.H,function(){F?P():(m.a.B(_,"change",P),F=m.o(R,null,{l:_}))},null,{notifyImmediately:!0})},update:function(){}},m.m.wa.selectedOptions=!0,m.c.style={update:function(_,E){var v=m.a.f(E()||{});m.a.P(v,function(P,R){if(R=m.a.f(R),(R===null||R===e||R===!1)&&(R=""),r)r(_).css(P,R);else if(/^--/.test(P))_.style.setProperty(P,R);else{P=P.replace(/-(\w)/g,function(U,k){return k.toUpperCase()});var F=_.style[P];_.style[P]=R,R===F||_.style[P]!=F||isNaN(R)||(_.style[P]=R+"px")}})}},m.c.submit={init:function(_,E,v,P,R){if(typeof E()!="function")throw Error("The value for a submit binding must be a function");m.a.B(_,"submit",function(F){var U,k=E();try{U=k.call(R.$data,_)}finally{U!==!0&&(F.preventDefault?F.preventDefault():F.returnValue=!1)}})}},m.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(_,E){m.a.Bb(_,E())}},m.h.ea.text=!0,function(){if(t&&t.navigator){var _=function(j){if(j)return parseFloat(j[1])},E=t.navigator.userAgent,v,P,R,F,U;(v=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(U=_(E.match(/Edge\/([^ ]+)$/)))||_(E.match(/Chrome\/([^ ]+)/))||(P=_(E.match(/Version\/([^ ]+) Safari/)))||(R=_(E.match(/Firefox\/([^ ]+)/)))||(F=m.a.W||_(E.match(/MSIE ([^ ]+)/)))||(F=_(E.match(/rv:([^ )]+)/)))}if(8<=F&&10>F)var k=m.a.g.Z(),H=m.a.g.Z(),V=function(j){var X=this.activeElement;(X=X&&m.a.g.get(X,H))&&X(j)},q=function(j,X){var G=j.ownerDocument;m.a.g.get(G,k)||(m.a.g.set(G,k,!0),m.a.B(G,"selectionchange",V)),m.a.g.set(j,H,X)};m.c.textInput={init:function(j,X,G){function $(Oe,Be){m.a.B(j,Oe,Be)}function J(){var Oe=m.a.f(X());(Oe===null||Oe===e)&&(Oe=""),_e!==e&&Oe===_e?m.a.setTimeout(J,4):j.value!==Oe&&(Te=!0,j.value=Oe,Te=!1,ie=j.value)}function ce(){ae||(_e=j.value,ae=m.a.setTimeout(de,4))}function de(){clearTimeout(ae),_e=ae=e;var Oe=j.value;ie!==Oe&&(ie=Oe,m.m.eb(X(),G,"textInput",Oe))}var ie=j.value,ae,_e,be=m.a.W==9?ce:de,Te=!1;F&&$("keypress",de),11>F&&$("propertychange",function(Oe){Te||Oe.propertyName!=="value"||be(Oe)}),F==8&&($("keyup",de),$("keydown",de)),q&&(q(j,be),$("dragend",ce)),(!F||9<=F)&&$("input",be),5>P&&m.a.R(j)==="textarea"?($("keydown",ce),$("paste",ce),$("cut",ce)):11>v?$("keydown",ce):4>R?($("DOMAutoComplete",de),$("dragdrop",de),$("drop",de)):U&&j.type==="number"&&$("keydown",ce),$("change",de),$("blur",de),m.o(J,null,{l:j})}},m.m.wa.textInput=!0,m.c.textinput={preprocess:function(j,X,G){G("textInput",j)}}}(),m.c.uniqueName={init:function(_,E){if(E()){var v="ko_unique_"+ ++m.c.uniqueName.rd;m.a.Yc(_,v)}}},m.c.uniqueName.rd=0,m.c.using={init:function(_,E,v,P,R){var F;return v.has("as")&&(F={as:v.get("as"),noChildContext:v.get("noChildContext")}),E=R.createChildContext(E,F),m.Oa(E,_),{controlsDescendantBindings:!0}}},m.h.ea.using=!0,m.c.value={init:function(_,E,v){var P=m.a.R(_),R=P=="input";if(!R||_.type!="checkbox"&&_.type!="radio"){var F=[],U=v.get("valueUpdate"),k=!1,H=null;U&&(typeof U=="string"?F=[U]:F=m.a.wc(U),m.a.Pa(F,"change"));var V=function(){H=null,k=!1;var X=E(),G=m.w.M(_);m.m.eb(X,v,"value",G)};!m.a.W||!R||_.type!="text"||_.autocomplete=="off"||_.form&&_.form.autocomplete=="off"||m.a.A(F,"propertychange")!=-1||(m.a.B(_,"propertychange",function(){k=!0}),m.a.B(_,"focus",function(){k=!1}),m.a.B(_,"blur",function(){k&&V()})),m.a.D(F,function(X){var G=V;m.a.Ud(X,"after")&&(G=function(){H=m.w.M(_),m.a.setTimeout(V,0)},X=X.substring(5)),m.a.B(_,X,G)});var q;if(q=R&&_.type=="file"?function(){var X=m.a.f(E());X===null||X===e||X===""?_.value="":m.u.G(V)}:function(){var X=m.a.f(E()),G=m.w.M(_);H!==null&&X===H?m.a.setTimeout(q,0):(X!==G||G===e)&&(P==="select"?(G=v.get("valueAllowUnset"),m.w.cb(_,X,G),G||X===m.w.M(_)||m.u.G(V)):m.w.cb(_,X))},P==="select"){var j;m.i.subscribe(_,m.i.H,function(){j?v.get("valueAllowUnset")?q():V():(m.a.B(_,"change",V),j=m.o(q,null,{l:_}))},null,{notifyImmediately:!0})}else m.a.B(_,"change",V),m.o(q,null,{l:_})}else m.ib(_,{checkedValue:E})},update:function(){}},m.m.wa.value=!0,m.c.visible={update:function(_,E){var v=m.a.f(E()),P=_.style.display!="none";v&&!P?_.style.display="":!v&&P&&(_.style.display="none")}},m.c.hidden={update:function(_,E){m.c.visible.update(_,function(){return!m.a.f(E())})}},function(_){m.c[_]={init:function(E,v,P,R,F){return m.c.event.init.call(this,E,function(){var U={};return U[_]=v(),U},P,R,F)}}}("click"),m.ca=function(){},m.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.ca.prototype.makeTemplateSource=function(_,E){if(typeof _=="string"){E=E||n;var v=E.getElementById(_);if(!v)throw Error("Cannot find template with ID "+_);return new m.C.F(v)}if(_.nodeType==1||_.nodeType==8)return new m.C.ia(_);throw Error("Unknown template type: "+_)},m.ca.prototype.renderTemplate=function(_,E,v,P){return _=this.makeTemplateSource(_,P),this.renderTemplateSource(_,E,v,P)},m.ca.prototype.isTemplateRewritten=function(_,E){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(_,E).data("isRewritten")},m.ca.prototype.rewriteTemplate=function(_,E,v){_=this.makeTemplateSource(_,v),E=E(_.text()),_.text(E),_.data("isRewritten",!0)},m.b("templateEngine",m.ca),m.kc=function(){function _(P,R,F,U){P=m.m.ac(P);for(var k=m.m.Ra,H=0;H<P.length;H++){var V=P[H].key;if(Object.prototype.hasOwnProperty.call(k,V)){var q=k[V];if(typeof q=="function"){if(V=q(P[H].value))throw Error(V)}else if(!q)throw Error("This template engine does not support the '"+V+"' binding within its templates")}}return F="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.m.vb(P,{valueAccessors:!0})+" } })()},'"+F.toLowerCase()+"')",U.createJavaScriptEvaluatorBlock(F)+R}var E=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,v=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(P,R,F){R.isTemplateRewritten(P,F)||R.rewriteTemplate(P,function(U){return m.kc.Ld(U,R)},F)},Ld:function(P,R){return P.replace(E,function(F,U,k,H,V){return _(V,U,k,R)}).replace(v,function(F,U){return _(U,"<!-- ko -->","#comment",R)})},md:function(P,R){return m.aa.Xb(function(F,U){var k=F.nextSibling;k&&k.nodeName.toLowerCase()===R&&m.ib(k,P,U)})}}}(),m.b("__tr_ambtns",m.kc.md),function(){m.C={},m.C.F=function(v){if(this.F=v){var P=m.a.R(v);this.ab=P==="script"?1:P==="textarea"?2:P=="template"&&v.content&&v.content.nodeType===11?3:4}},m.C.F.prototype.text=function(){var v=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[v];var P=arguments[0];v==="innerHTML"?m.a.fc(this.F,P):this.F[v]=P};var _=m.a.g.Z()+"_";m.C.F.prototype.data=function(v){if(arguments.length===1)return m.a.g.get(this.F,_+v);m.a.g.set(this.F,_+v,arguments[1])};var E=m.a.g.Z();m.C.F.prototype.nodes=function(){var v=this.F;if(arguments.length==0){var P=m.a.g.get(v,E)||{},R=P.lb||(this.ab===3?v.content:this.ab===4?v:e);if(!R||P.jd){var F=this.text();F&&F!==P.bb&&(R=m.a.Md(F,v.ownerDocument),m.a.g.set(v,E,{lb:R,bb:F,jd:!0}))}return R}P=arguments[0],this.ab!==e&&this.text(""),m.a.g.set(v,E,{lb:P})},m.C.ia=function(v){this.F=v},m.C.ia.prototype=new m.C.F,m.C.ia.prototype.constructor=m.C.ia,m.C.ia.prototype.text=function(){if(arguments.length==0){var v=m.a.g.get(this.F,E)||{};return v.bb===e&&v.lb&&(v.bb=v.lb.innerHTML),v.bb}m.a.g.set(this.F,E,{bb:arguments[0]})},m.b("templateSources",m.C),m.b("templateSources.domElement",m.C.F),m.b("templateSources.anonymousTemplate",m.C.ia)}(),function(){function _(H,V,q){var j;for(V=m.h.nextSibling(V);H&&(j=H)!==V;)H=m.h.nextSibling(j),q(j,H)}function E(H,V){if(H.length){var q=H[0],j=H[H.length-1],X=q.parentNode,G=m.ga.instance,$=G.preprocessNode;if($){if(_(q,j,function(J,ce){var de=J.previousSibling,ie=$.call(G,J);ie&&(J===q&&(q=ie[0]||ce),J===j&&(j=ie[ie.length-1]||de))}),H.length=0,!q)return;q===j?H.push(q):(H.push(q,j),m.a.Ua(H,X))}_(q,j,function(J){J.nodeType!==1&&J.nodeType!==8||m.vc(V,J)}),_(q,j,function(J){J.nodeType!==1&&J.nodeType!==8||m.aa.cd(J,[V])}),m.a.Ua(H,X)}}function v(H){return H.nodeType?H:0<H.length?H[0]:null}function P(H,V,q,j,X){X=X||{};var G=(H&&v(H)||q||{}).ownerDocument,$=X.templateEngine||F;if(m.kc.xd(q,$,G),q=$.renderTemplate(q,j,X,G),typeof q.length!="number"||0<q.length&&typeof q[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(G=!1,V){case"replaceChildren":m.h.va(H,q),G=!0;break;case"replaceNode":m.a.Xc(H,q),G=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+V)}return G&&(E(q,j),X.afterRender&&m.u.G(X.afterRender,null,[q,j[X.as||"$data"]]),V=="replaceChildren"&&m.i.ma(H,m.i.H)),q}function R(H,V,q){return m.O(H)?H():typeof H=="function"?H(V,q):H}var F;m.gc=function(H){if(H!=e&&!(H instanceof m.ca))throw Error("templateEngine must inherit from ko.templateEngine");F=H},m.dc=function(H,V,q,j,X){if(q=q||{},(q.templateEngine||F)==e)throw Error("Set a template engine before calling renderTemplate");if(X=X||"replaceChildren",j){var G=v(j);return m.$(function(){var J=V&&V instanceof m.fa?V:new m.fa(V,null,null,null,{exportDependencies:!0}),$=R(H,J.$data,J),J=P(j,X,$,J,q);X=="replaceNode"&&(j=J,G=v(j))},null,{Sa:function(){return!G||!m.a.Sb(G)},l:G&&X=="replaceNode"?G.parentNode:G})}return m.aa.Xb(function($){m.dc(H,V,q,$,"replaceNode")})},m.Qd=function(H,V,q,j,X){function G(_e,be){m.u.G(m.a.ec,null,[j,_e,J,q,$,be]),m.i.ma(j,m.i.H)}function $(_e,be){E(be,ce),q.afterRender&&q.afterRender(be,_e),ce=null}function J(_e,be){ce=X.createChildContext(_e,{as:de,noChildContext:q.noChildContext,extend:function(Oe){Oe.$index=be,de&&(Oe[de+"Index"]=be)}});var Te=R(H,_e,ce);return P(j,"ignoreTargetNode",Te,ce,q)}var ce,de=q.as,ie=q.includeDestroyed===!1||m.options.foreachHidesDestroyed&&!q.includeDestroyed;if(ie||q.beforeRemove||!m.Pc(V))return m.$(function(){var _e=m.a.f(V)||[];typeof _e.length>"u"&&(_e=[_e]),ie&&(_e=m.a.jb(_e,function(be){return be===e||be===null||!m.a.f(be._destroy)})),G(_e)},null,{l:j});G(V.v());var ae=V.subscribe(function(_e){G(V(),_e)},null,"arrayChange");return ae.l(j),ae};var U=m.a.g.Z(),k=m.a.g.Z();m.c.template={init:function(H,V){var q=m.a.f(V());if(typeof q=="string"||"name"in q)m.h.Ea(H);else if("nodes"in q){if(q=q.nodes||[],m.O(q))throw Error('The "nodes" option must be a plain, non-observable array.');var j=q[0]&&q[0].parentNode;j&&m.a.g.get(j,k)||(j=m.a.Yb(q),m.a.g.set(j,k,!0)),new m.C.ia(H).nodes(j)}else if(q=m.h.childNodes(H),0<q.length)j=m.a.Yb(q),new m.C.ia(H).nodes(j);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(H,V,q,j,X){var G=V();V=m.a.f(G),q=!0,j=null,typeof V=="string"?V={}:(G="name"in V?V.name:H,"if"in V&&(q=m.a.f(V.if)),q&&"ifnot"in V&&(q=!m.a.f(V.ifnot)),q&&!G&&(q=!1)),"foreach"in V?j=m.Qd(G,q&&V.foreach||[],V,H,X):q?(q=X,"data"in V&&(q=X.createChildContext(V.data,{as:V.as,noChildContext:V.noChildContext,exportDependencies:!0})),j=m.dc(G,q,V,H)):m.h.Ea(H),X=j,(V=m.a.g.get(H,U))&&typeof V.s=="function"&&V.s(),m.a.g.set(H,U,!X||X.ja&&!X.ja()?e:X)}},m.m.Ra.template=function(H){return H=m.m.ac(H),H.length==1&&H[0].unknown||m.m.Id(H,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.h.ea.template=!0}(),m.b("setTemplateEngine",m.gc),m.b("renderTemplate",m.dc),m.a.Kc=function(_,E,v){if(_.length&&E.length){var P,R,F,U,k;for(P=R=0;(!v||P<v)&&(U=_[R]);++R){for(F=0;k=E[F];++F)if(U.value===k.value){U.moved=k.index,k.moved=U.index,E.splice(F,1),P=F=0;break}P+=F}}},m.a.Pb=function(){function _(E,v,P,R,F){var U=Math.min,k=Math.max,H=[],V,q=E.length,j,X=v.length,G=X-q||1,$=q+X+1,J,ce,de;for(V=0;V<=q;V++)for(ce=J,H.push(J=[]),de=U(X,V+G),j=k(0,V-1);j<=de;j++)J[j]=j?V?E[V-1]===v[j-1]?ce[j-1]:U(ce[j]||$,J[j-1]||$)+1:j+1:V+1;for(U=[],k=[],G=[],V=q,j=X;V||j;)X=H[V][j]-1,j&&X===H[V][j-1]?k.push(U[U.length]={status:P,value:v[--j],index:j}):V&&X===H[V-1][j]?G.push(U[U.length]={status:R,value:E[--V],index:V}):(--j,--V,F.sparse||U.push({status:"retained",value:v[j]}));return m.a.Kc(G,k,!F.dontLimitMoves&&10*q),U.reverse()}return function(E,v,P){return P=typeof P=="boolean"?{dontLimitMoves:P}:P||{},E=E||[],v=v||[],E.length<v.length?_(E,v,"added","deleted",P):_(v,E,"deleted","added",P)}}(),m.b("utils.compareArrays",m.a.Pb),function(){function _(P,R,F,U,k){var H=[],V=m.$(function(){var q=R(F,k,m.a.Ua(H,P))||[];0<H.length&&(m.a.Xc(H,q),U&&m.u.G(U,null,[F,q,k])),H.length=0,m.a.Nb(H,q)},null,{l:P,Sa:function(){return!m.a.kd(H)}});return{Y:H,$:V.ja()?V:e}}var E=m.a.g.Z(),v=m.a.g.Z();m.a.ec=function(P,R,F,U,k,H){function V(nt){Te={Aa:nt,pb:m.ta(ce++)},$.push(Te),G||be.push(Te)}function q(nt){Te=X[nt],ce!==Te.pb.v()&&_e.push(Te),Te.pb(ce++),m.a.Ua(Te.Y,P),$.push(Te)}function j(nt,Mt){if(nt)for(var ri=0,we=Mt.length;ri<we;ri++)m.a.D(Mt[ri].Y,function(_t){nt(_t,ri,Mt[ri].Aa)})}R=R||[],typeof R.length>"u"&&(R=[R]),U=U||{};var X=m.a.g.get(P,E),G=!X,$=[],J=0,ce=0,de=[],ie=[],ae=[],_e=[],be=[],Te,Oe=0;if(G)m.a.D(R,V);else{if(!H||X&&X._countWaitingForRemove){var Be=m.a.Mb(X,function(nt){return nt.Aa});H=m.a.Pb(Be,R,{dontLimitMoves:U.dontLimitMoves,sparse:!0})}for(var Be=0,tt,lt,Pt;tt=H[Be];Be++)switch(lt=tt.moved,Pt=tt.index,tt.status){case"deleted":for(;J<Pt;)q(J++);lt===e&&(Te=X[J],Te.$&&(Te.$.s(),Te.$=e),m.a.Ua(Te.Y,P).length&&(U.beforeRemove&&($.push(Te),Oe++,Te.Aa===v?Te=null:ae.push(Te)),Te&&de.push.apply(de,Te.Y))),J++;break;case"added":for(;ce<Pt;)q(J++);lt!==e?(ie.push($.length),q(lt)):V(tt.value)}for(;ce<R.length;)q(J++);$._countWaitingForRemove=Oe}m.a.g.set(P,E,$),j(U.beforeMove,_e),m.a.D(de,U.beforeRemove?m.oa:m.removeNode);var ht,wn,ii;try{ii=P.ownerDocument.activeElement}catch{}if(ie.length)for(;(Be=ie.shift())!=e;){for(Te=$[Be],ht=e;Be;)if((wn=$[--Be].Y)&&wn.length){ht=wn[wn.length-1];break}for(R=0;J=Te.Y[R];ht=J,R++)m.h.Wb(P,J,ht)}for(Be=0;Te=$[Be];Be++){for(Te.Y||m.a.extend(Te,_(P,F,Te.Aa,k,Te.pb)),R=0;J=Te.Y[R];ht=J,R++)m.h.Wb(P,J,ht);!Te.Ed&&k&&(k(Te.Aa,Te.Y,Te.pb),Te.Ed=!0,ht=Te.Y[Te.Y.length-1])}for(ii&&P.ownerDocument.activeElement!=ii&&ii.focus(),j(U.beforeRemove,ae),Be=0;Be<ae.length;++Be)ae[Be].Aa=v;j(U.afterMove,_e),j(U.afterAdd,be)}}(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.ec),m.ba=function(){this.allowTemplateRewriting=!1},m.ba.prototype=new m.ca,m.ba.prototype.constructor=m.ba,m.ba.prototype.renderTemplateSource=function(_,E,v,P){return(E=!(9>m.a.W)&&_.nodes?_.nodes():null)?m.a.la(E.cloneNode(!0).childNodes):(_=_.text(),m.a.ua(_,P))},m.ba.Ma=new m.ba,m.gc(m.ba.Ma),m.b("nativeTemplateEngine",m.ba),function(){m.$a=function(){var E=this.Hd=function(){if(!r||!r.tmpl)return 0;try{if(0<=r.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1}();this.renderTemplateSource=function(v,P,R,F){if(F=F||n,R=R||{},2>E)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var U=v.data("precompiled");return U||(U=v.text()||"",U=r.template(null,"{{ko_with $item.koBindingContext}}"+U+"{{/ko_with}}"),v.data("precompiled",U)),v=[P.$data],P=r.extend({koBindingContext:P},R.templateOptions),P=r.tmpl(U,v,P),P.appendTo(F.createElement("div")),r.fragments={},P},this.createJavaScriptEvaluatorBlock=function(v){return"{{ko_code ((function() { return "+v+" })()) }}"},this.addTemplate=function(v,P){n.write("<script type='text/html' id='"+v+"'>"+P+"<\/script>")},0<E&&(r.tmpl.tag.ko_code={open:"__.push($1 || '');"},r.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.$a.prototype=new m.ca,m.$a.prototype.constructor=m.$a;var _=new m.$a;0<_.Hd&&m.gc(_),m.b("jqueryTmplTemplateEngine",m.$a)}()})})()})()})();var qyt=ko;typeof window<"u"?(ko=window.ko,typeof K1<"u"?window.ko=K1:delete window.ko):(ko=global.ko,typeof K1<"u"?global.ko=K1:delete global.ko);var XE=qyt;/**
- * @license
- * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5
- * Copyright (c) Steve Sanderson
- * MIT license
- */var tX="__knockoutObservables",nX="__knockoutSubscribable";function Nxe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=Fxe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(r){if(!(r===tX||r===nX)&&!(r in i)){var o=e[r],s=o instanceof Array,a=n.isObservable(o)?o:s?n.observableArray(o):n.observable(o);Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[r]=a,s&&Xyt(n,a)}}),e}function Fxe(e,t){var n=e[tX];return!n&&t&&(n={},Object.defineProperty(e,tX,{value:n})),n}function Yyt(e,t,n){var i=this,r={owner:e,deferEvaluation:!0};if(typeof n=="function")r.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');r.read=n.get,r.write=n.set}return e[t]=i.computed(r),Nxe.call(i,e,[t]),e}function Xyt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=Kyt(e,t,i))})}function Kyt(e,t,n){var i=$yt(e,n);return i.subscribe(t)}function $yt(e,t){var n=t[nX];if(!n){n=new e.subscribable,Object.defineProperty(t,nX,{value:n});var i={};Zyt(t,n,i),Jyt(e,t,n,i)}return n}function Zyt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var r=e[i];e[i]=function(){var o=r.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),o}})}function Jyt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(r){Object.defineProperty(t,r,{enumerable:!1,value:function(){var o;i.pause=!0;try{o=e.observableArray.fn[r].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),o}})})}function Vxe(e,t){if(!e)return null;var n=Fxe(e,!1);return n&&n[t]||null}function Qyt(e,t){var n=Vxe(e,t);n&&n.valueHasMutated()}function ext(e){e.track=Nxe,e.getObservable=Vxe,e.valueHasMutated=Qyt,e.defineProperty=Yyt}var mz={attachToKo:ext};var kxe="http://www.w3.org/2000/svg",Uxe="cesium-svgPath-svg",txt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(kxe,"svg:svg");i.setAttribute("class",Uxe);let r=document.createElementNS(kxe,"path");return i.appendChild(r),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let o=e.unwrap(n());r.setAttribute("d",e.unwrap(o.path));let s=e.unwrap(o.width),a=e.unwrap(o.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),o.css&&i.setAttribute("class",`${Uxe} ${e.unwrap(o.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},pz=txt;mz.attachToKo(XE);pz.register(XE);var xe=XE;var rX=Ns(Xxe(),1);var oX=Ns(Kxe(),1);var J1=Ns($xe(),1);var yX=Ns(rAe(),1);function rP(e){l(e)||(e=new Sh),this._clock=e,this._eventHelper=new Yo,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=xe.observable(ee.now()),this.systemTime.equalityComparer=ee.equals,this.startTime=xe.observable(e.startTime),this.startTime.equalityComparer=ee.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=xe.observable(e.stopTime),this.stopTime.equalityComparer=ee.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=xe.observable(e.currentTime),this.currentTime.equalityComparer=ee.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=xe.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=xe.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=xe.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=xe.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=xe.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),xe.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(rP.prototype,{clock:{get:function(){return this._clock}}});rP.prototype.synchronize=function(){let e=this._clock;this.systemTime=ee.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};rP.prototype.isDestroyed=function(){return!1};rP.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var vz=rP;function kxt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,ye.throwInstantiationError()}var oAe=kxt;function Uxt(e,t){t=y(t,!0);let n=new ge,i=new ge;function r(){let o={args:arguments,cancel:!1},s;return n.raiseEvent(o),o.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return r.canExecute=t,xe.track(r,["canExecute"]),Object.defineProperties(r,{beforeExecute:{value:n},afterExecute:{value:i}}),r}var An=Uxt;var xX={};xX.createCheckbox=function(e,t,n){let i=document.createElement("div"),r=document.createElement("label"),o=document.createElement("input");o.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),o.setAttribute("data-bind",s),r.appendChild(o),r.appendChild(document.createTextNode(e)),i.appendChild(r),i};xX.createSection=function(e,t,n,i){let r=document.createElement("div");r.className="cesium-cesiumInspector-section",r.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(r);let o=document.createElement("h3");o.className="cesium-cesiumInspector-sectionHeader",o.appendChild(document.createTextNode(t)),o.setAttribute("data-bind",`click: ${i}`),r.appendChild(o);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",r.appendChild(s),s};var Z0=xX;function zxt(e,t,n,i,r){return n.call(i,e[t]),xe.getObservable(e,t).subscribe(n,i,r)}var Pa=zxt;function sAe(e,t){this._command=e,t=y(t,y.EMPTY_OBJECT),this.toggled=y(t.toggled,!1),this.tooltip=y(t.tooltip,""),xe.track(this,["toggled","tooltip"])}Object.defineProperties(sAe.prototype,{command:{get:function(){return this._command}}});var IC=sAe;var Hxt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},oP=Object.freeze(Hxt);function Om(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}Om.prototype.getTexture=function(e){return this._textures[e]};function Gxt(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}Om.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):Gxt(this,e,t)};function Wxt(e,t,n){let{id:i,textureUniform:r,image:o}=t,s=n.webgl2?Dz(r,o,n):jxt(r,o,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function Dz(e,t,n){let{typedArray:i,sampler:r}=e,o=l(i)?cAe(e,n):new wt({context:n,source:t,sampler:r});return aAe(r)&&o.generateMipmap(),o}function jxt(e,t,n){let{typedArray:i,sampler:r}=e,o=aAe(r),s=r.wrapS===mn.REPEAT||r.wrapS===mn.MIRRORED_REPEAT||r.wrapT===mn.REPEAT||r.wrapT===mn.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,u=[a,c].every(M.isPowerOfTwo);if((o||s)&&!u)if(l(i)){if(e.pixelDatatype===qe.UNSIGNED_BYTE){let d=sO(i,a,c),p=zy(d);return Dz({sampler:r},p,n)}}else{let d=zy(t);return Dz(e,d,n)}else return Dz(e,t,n);return o?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),cAe(e,n)}function aAe(e){return[It.NEAREST_MIPMAP_NEAREST,It.NEAREST_MIPMAP_LINEAR,It.LINEAR_MIPMAP_NEAREST,It.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function cAe(e,t){let{pixelFormat:n,pixelDatatype:i,width:r,height:o,typedArray:s,sampler:a}=e;return new wt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:r,height:o},sampler:a,flipY:!1})}Om.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let r=n[i];Wxt(this,r,t)}n.length=0};Om.prototype.isDestroyed=function(){return!1};Om.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return ue(this)};function RC(e){e=y(e,y.EMPTY_OBJECT),this.mode=y(e.mode,Gg.MODIFY_MATERIAL),this.lightingModel=e.lightingModel,this.uniforms=y(e.uniforms,y.EMPTY_OBJECT),this.varyings=y(e.varyings,y.EMPTY_OBJECT),this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.isTranslucent=y(e.isTranslucent,!1),this._textureManager=new Om,this._defaultTexture=void 0,this.uniformMap=qxt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},Kxt(this),$xt(this)}function qxt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];r.type===oP.SAMPLER_2D?(e._textureManager.loadTexture2D(i,r.value),n[i]=Yxt(e,i)):n[i]=Xxt(e,i)}return n}function Yxt(e,t){return function(){return y(e._textureManager.getTexture(t),e._defaultTexture)}}function Xxt(e,t){return function(){return e.uniforms[t].value}}function OC(e,t,n){let i;for(;(i=t.exec(e))!==null;){let r=i[1];n[r]=!0}}function Kxt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,r,o=e.vertexShaderText;l(o)&&(r=e.usedVariablesVertex.attributeSet,OC(o,t,r),r=e.usedVariablesVertex.featureIdSet,OC(o,n,r),r=e.usedVariablesVertex.metadataSet,OC(o,i,r));let s=e.fragmentShaderText;if(l(s)){r=e.usedVariablesFragment.attributeSet,OC(s,t,r),r=e.usedVariablesFragment.featureIdSet,OC(s,n,r),r=e.usedVariablesFragment.metadataSet,OC(s,i,r);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;OC(s,a,c)}}function lAe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function cc(e,t,n,i){if(e.hasOwnProperty(t)){let r=`${lAe(t)} is not available in the ${i} shader. Did you mean ${lAe(n)} instead?`;throw new ye(r)}}function $xt(e){let t=e.usedVariablesVertex.attributeSet;cc(t,"position","positionMC","vertex"),cc(t,"normal","normalMC","vertex"),cc(t,"tangent","tangentMC","vertex"),cc(t,"bitangent","bitangentMC","vertex"),cc(t,"positionWC","positionMC","vertex"),cc(t,"positionEC","positionMC","vertex"),cc(t,"normalEC","normalMC","vertex"),cc(t,"tangentEC","tangentMC","vertex"),cc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;cc(n,"position","positionEC","fragment"),cc(n,"normal","normalEC","fragment"),cc(n,"tangent","tangentEC","fragment"),cc(n,"bitangent","bitangentEC","fragment"),cc(n,"normalMC","normalEC","fragment"),cc(n,"tangentMC","tangentEC","fragment"),cc(n,"bitangentMC","bitangentEC","fragment")}RC.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===oP.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};RC.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};RC.prototype.isDestroyed=function(){return!1};RC.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),ue(this)};function CX(e){e=y(e,y.EMPTY_OBJECT),this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=y(e.pixelFormat,ct.RGBA),this.pixelDatatype=y(e.pixelDatatype,qe.UNSIGNED_BYTE);let t=e.url;typeof t=="string"&&(t=De.createIfNeeded(t)),this.resource=t;let i=y(e.repeat,!0)?mn.REPEAT:mn.CLAMP_TO_EDGE;this.sampler=new on({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var Zxt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4"},uAe=Object.freeze(Zxt);var fAe=`uniform sampler2D u_depthTexture;
- varying vec2 v_textureCoordinates;
- void main()
- {
- float z_window = czm_unpackDepth(texture2D(u_depthTexture, v_textureCoordinates));
- z_window = czm_reverseLogDepth(z_window);
- float n_range = czm_depthRange.near;
- float f_range = czm_depthRange.far;
- float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);
- float scale = pow(z_ndc * 0.5 + 0.5, 8.0);
- gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);
- }
- `;var MC="http://www.w3.org/2000/svg",mAe="http://www.w3.org/1999/xlink",Pz,sP=z.fromCssColorString("rgba(247,250,255,0.384)"),Iz=z.fromCssColorString("rgba(143,191,255,0.216)"),AX=z.fromCssColorString("rgba(153,197,255,0.098)"),Oz=z.fromCssColorString("rgba(255,255,255,0.086)"),Jxt=z.fromCssColorString("rgba(255,255,255,0.267)"),Qxt=z.fromCssColorString("rgba(255,255,255,0)"),dAe=z.fromCssColorString("rgba(66,67,68,0.3)"),hAe=z.fromCssColorString("rgba(0,0,0,0.5)");function J0(e){return z.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var aP={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function oh(e){let t=document.createElementNS(MC,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let r=0;r<i;++r)t.appendChild(oh(e.children[r]))}else n.indexOf("xlink:")===0?t.setAttributeNS(mAe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function TX(e,t,n){let i=document.createElementNS(MC,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let r=document.createElementNS(MC,"tspan");return r.textContent=n,i.appendChild(r),i}function eCt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var Rz=new z;function Qo(e,t){let n=t.alpha,i=1-n;return Rz.red=e.red*i+t.red*n,Rz.green=e.green*i+t.green*n,Rz.blue=e.blue*i+t.blue*n,Rz.toCssColorString()}function bX(e,t,n){let i=aP[n],r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return oh(r)}function tCt(e,t,n){let i=aP[n],r=aP.animation_pathWingButton,o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return oh(o)}function nCt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&Pz!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let r=e._centerX,o=e._centerY,a=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>a.right||c<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),d=c-r-a.left,p=u-o-a.top,g=Math.atan2(p,d)*180/Math.PI+90;g>180&&(g-=360);let m=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?(Pz=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<m?n.slower():g>m&&n.faster(),t.preventDefault()}else e===Pz&&(Pz=void 0),n.shuttleRingDragging=!1}function h_(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[Pa(t,"toggled",this.setToggled,this),Pa(t,"tooltip",this.setTooltip,this),Pa(t.command,"canExecute",this.setEnabled,this)]}h_.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();ue(this)};h_.prototype.isDestroyed=function(){return!1};h_.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};h_.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};h_.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function QE(e,t){e=Pn(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let r=document.createElement("div");r.className="cesium-animation-theme",r.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=r,this._themeNormal=r.childNodes[0],this._themeHover=r.childNodes[1],this._themeSelect=r.childNodes[2],this._themeDisabled=r.childNodes[3],this._themeKnob=r.childNodes[4],this._themePointer=r.childNodes[5],this._themeSwoosh=r.childNodes[6],this._themeSwooshHover=r.childNodes[7];let o=document.createElementNS(MC,"svg:svg");this._svgNode=o,o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mAe);let s=document.createElementNS(MC,"g");this._topG=s,this._realtimeSVG=new h_(tCt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new h_(bX(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new h_(bX(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new h_(bX(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(MC,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=oh({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=aP.animation_pathSwooshFX,f=aP.animation_pathPointer,d=oh({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=d,this._shuttleRingPointer=oh({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=oh({tagName:"g",transform:"translate(100,100)"});this._knobOuter=oh({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,m=oh({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=TX(0,-24,""),this._knobTime=TX(0,-7,""),this._knobStatus=TX(0,-41,"");let x=oh({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),C=document.createElementNS(MC,"g");C.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(r),s.appendChild(C),s.appendChild(p),s.appendChild(a),C.appendChild(c),C.appendChild(d),C.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(m),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(x),o.appendChild(s),e.appendChild(o);let A=this;function b(I){nCt(A,I)}this._mouseCallback=b,c.addEventListener("mousedown",b,!0),c.addEventListener("touchstart",b,!0),d.addEventListener("mousedown",b,!0),d.addEventListener("touchstart",b,!0),n.addEventListener("mousemove",b,!0),n.addEventListener("touchmove",b,!0),n.addEventListener("mouseup",b,!0),n.addEventListener("touchend",b,!0),n.addEventListener("touchcancel",b,!0),this._shuttleRingPointer.addEventListener("mousedown",b,!0),this._shuttleRingPointer.addEventListener("touchstart",b,!0),this._knobOuter.addEventListener("mousedown",b,!0),this._knobOuter.addEventListener("touchstart",b,!0);let T=this._knobTime.childNodes[0],S=this._knobDate.childNodes[0],w=this._knobStatus.childNodes[0],D;this._subscriptions=[Pa(t.pauseViewModel,"toggled",function(I){D!==I&&(D=I,D?A._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):A._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Pa(t,"shuttleRingAngle",function(I){eCt(A._shuttleRingPointer,A._knobOuter,I)}),Pa(t,"dateLabel",function(I){S.textContent!==I&&(S.textContent=I)}),Pa(t,"timeLabel",function(I){T.textContent!==I&&(T.textContent=I)}),Pa(t,"multiplierLabel",function(I){w.textContent!==I&&(w.textContent=I)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(QE.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});QE.prototype.isDestroyed=function(){return!1};QE.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let n=this._subscriptions;for(let i=0,r=n.length;i<r;i++)n[i].dispose();return ue(this)};QE.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,r=132,o=e,s=t;e===0&&t===0?(o=i,s=r):e===0?(s=t,o=i*(t/r)):t===0&&(o=e,s=r*(e/i));let a=o/i,c=s/r;n.style.cssText=`width: ${o}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",o),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${o} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};QE.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=J0(this._themeNormal),n=J0(this._themeHover),i=J0(this._themeSelect),r=J0(this._themeDisabled),o=J0(this._themeKnob),s=J0(this._themePointer),a=J0(this._themeSwoosh),c=J0(this._themeSwooshHover),u=oh({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Qo(t,sP)},{tagName:"stop",offset:"12%","stop-color":Qo(t,Iz)},{tagName:"stop",offset:"46%","stop-color":Qo(t,AX)},{tagName:"stop",offset:"81%","stop-color":Qo(t,Oz)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Qo(n,sP)},{tagName:"stop",offset:"12%","stop-color":Qo(n,Iz)},{tagName:"stop",offset:"46%","stop-color":Qo(n,AX)},{tagName:"stop",offset:"81%","stop-color":Qo(n,Oz)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Qo(i,sP)},{tagName:"stop",offset:"12%","stop-color":Qo(i,Iz)},{tagName:"stop",offset:"46%","stop-color":Qo(i,AX)},{tagName:"stop",offset:"81%","stop-color":Qo(i,Oz)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Qo(r,Jxt)},{tagName:"stop",offset:"75%","stop-color":Qo(r,Qxt)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":Qo(s,hAe)},{tagName:"stop",offset:"100%","stop-color":Qo(s,hAe)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Qo(o,sP)},{tagName:"stop",offset:"60%","stop-color":Qo(o,dAe)},{tagName:"stop",offset:"85%","stop-color":Qo(o,Iz)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Qo(o,dAe)},{tagName:"stop",offset:"60%","stop-color":Qo(o,sP)},{tagName:"stop",offset:"85%","stop-color":Qo(o,Oz)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var Mz=QE;var iCt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Q0=15,eS=105;function pAe(e,t){return e-t}function EX(e,t){let n=ao(t,e,pAe);return n<0?~n:n}function rCt(e,t){if(Math.abs(e)<=Q0)return e/Q0;let n=Q0,i=eS,r,o=0,s;return e>0?(r=Math.log(t[t.length-1]),s=(r-o)/(i-n),Math.exp(o+s*(e-n))):(r=Math.log(-t[0]),s=(r-o)/(i-n),-Math.exp(o+s*(Math.abs(e)-n)))}function oCt(e,t,n){if(n.clockStep===xr.SYSTEM_CLOCK)return Q0;if(Math.abs(e)<=1)return e*Q0;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let r=Q0,o=eS,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(o-r),(Math.log(e)-a)/c+r):(s=Math.log(-t[0]),c=(s-a)/(o-r),-((Math.log(Math.abs(e))-a)/c+r))}function Hf(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=Hf.defaultDateFormatter,this._timeFormatter=Hf.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,xe.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Hf.defaultTicks),this.timeLabel=void 0,xe.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,xe.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,xe.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===xr.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,xe.defineProperty(this,"shuttleRingAngle",{get:function(){return oCt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,eS),-eS);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=xr.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===eS){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=rCt(s,a);if(t.snapToTicks)u=a[EX(u,a)];else if(u!==0){let f=Math.abs(u);if(f>100){let d=f.toFixed(0).length-2,p=Math.pow(10,d);u=Math.round(u/p)*p|0}else f>Q0?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,xe.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===jo.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,f=s.startTime,d=!1;if(a===jo.LOOP_STOP)d=ee.greaterThan(u,f)||u.equals(f)&&c>0;else{let p=s.stopTime;d=ee.greaterThan(u,f)&&ee.lessThan(u,p)||u.equals(f)&&c>0||u.equals(p)&&c<0}return d||(s.shouldAnimate=!1),d}),this._isSystemTimeAvailable=void 0,xe.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===jo.UNBOUNDED)return!0;let c=s.systemTime;return ee.greaterThanOrEquals(c,s.startTime)&&ee.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,xe.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=An(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new IC(n,{toggled:xe.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=An(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new IC(i,{toggled:xe.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let r=An(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new IC(r,{toggled:xe.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==xr.SYSTEM_CLOCK}),tooltip:"Play Forward"});let o=An(function(){t._clockViewModel.clockStep=xr.SYSTEM_CLOCK},xe.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new IC(o,{toggled:xe.computed(function(){return e.clockStep===xr.SYSTEM_CLOCK}),tooltip:xe.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=An(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=EX(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=An(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=EX(c,a)+1;u<a.length&&(s.multiplier=a[u])})}Hf.defaultDateFormatter=function(e,t){let n=ee.toGregorianDate(e);return`${iCt[n.month-1]} ${n.day} ${n.year}`};Hf.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];Hf.defaultTimeFormatter=function(e,t){let n=ee.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};Hf.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Hf.prototype.setShuttleRingTicks=function(e){let t,n,i,r={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,n=e.length;t<n;++t)i=e[t],r.hasOwnProperty(i)||(r[i]=!0,o.push(i));o.sort(pAe);let s=[];for(n=o.length,t=n-1;t>=0;--t)i=o[t],i!==0&&s.push(-i);Array.prototype.push.apply(s,o),this._allShuttleRingTicks=s};Object.defineProperties(Hf.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});Hf._maxShuttleRingAngle=eS;Hf._realtimeShuttleRingAngle=Q0;var Bz=Hf;function _Ae(e){e=y(e,y.EMPTY_OBJECT);let t=e.globe,n=y(e.imageryProviderViewModels,[]),i=y(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,xe.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let r=xe.getObservable(this,"imageryProviderViewModels"),o=xe.pureComputed(function(){let d=r(),p={},g;for(g=0;g<d.length;g++){let C=d[g],A=C.category;l(p[A])?p[A].push(C):p[A]=[C]}let m=Object.keys(p),x=[];for(g=0;g<m.length;g++){let C=m[g];x.push({name:C,providers:p[C]})}return x});this._imageryProviders=o;let s=xe.getObservable(this,"terrainProviderViewModels"),a=xe.pureComputed(function(){let d=s(),p={},g;for(g=0;g<d.length;g++){let C=d[g],A=C.category;l(p[A])?p[A].push(C):p[A]=[C]}let m=Object.keys(p),x=[];for(g=0;g<m.length;g++){let C=m[g];x.push({name:C,providers:p[C]})}return x});this._terrainProviders=a,this.buttonTooltip=void 0,xe.defineProperty(this,"buttonTooltip",function(){let d=this.selectedImagery,p=this.selectedTerrain,g=l(d)?d.name:void 0,m=l(p)?p.name:void 0;return l(g)&&l(m)?`${g}
- ${m}`:l(g)?g:m}),this.buttonImageUrl=void 0,xe.defineProperty(this,"buttonImageUrl",function(){let d=this.selectedImagery;if(l(d))return d.iconUrl}),this.selectedImagery=void 0;let c=xe.observable();this._currentImageryProviders=[],xe.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(d){if(c()===d){this.dropDownVisible=!1;return}let p,g=this._currentImageryProviders,m=g.length,x=this._globe.imageryLayers,C=!1;for(p=0;p<m;p++){let A=x.length;for(let b=0;b<A;b++){let T=x.get(b);if(T.imageryProvider===g[p]){x.remove(T),C=!0;break}}}if(l(d)){let A=d.creationCommand(d._data);if(Array.isArray(A)){let b=[],T=A.length;for(p=T-1;p>=0;p--){let S=x.addImageryProvider(A[p],0);b.push(S)}this._currentImageryProviders=A.slice(0),d._layer=b,d.endFunction&&d.endFunction(b)}else if(this._currentImageryProviders=[A],C){let b=x.addImageryProvider(A,0);d._layer=b,d.endFunction&&d.endFunction(b)}else{let b=x.get(0);l(b)&&x.remove(b);let T=x.addImageryProvider(A,0);d._layer=T,d.endFunction&&d.endFunction(T)}}c(d),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=xe.observable();xe.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(d){if(u()===d){this.dropDownVisible=!1;return}let p;l(d)&&(p=d.creationCommand()),this._globe.depthTestAgainstTerrain=!(p instanceof H_),this._globe.terrainProvider=p,u(d),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=An(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=y(e.selectedImageryProviderViewModel,n[0]),this.selectedTerrain=y(e.selectedTerrainProviderViewModel,i[0])}Object.defineProperties(_Ae.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var Lz=_Ae;function Nz(e,t){e=Pn(e);let n=new Lz(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let r=document.createElement("img");r.setAttribute("draggable","false"),r.className="cesium-baseLayerPicker-selected",r.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-baseLayerPicker-dropDown",o.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(o);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",o.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),o.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(d);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),d.appendChild(g);let m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",o.appendChild(m);let x=document.createElement("div");x.className="cesium-baseLayerPicker-section",x.setAttribute("data-bind","foreach: _terrainProviders"),o.appendChild(x);let C=document.createElement("div");C.className="cesium-baseLayerPicker-category",x.appendChild(C);let A=document.createElement("div");A.className="cesium-baseLayerPicker-categoryTitle",A.setAttribute("data-bind","text: name"),C.appendChild(A);let b=document.createElement("div");b.className="cesium-baseLayerPicker-choices",b.setAttribute("data-bind","foreach: providers"),C.appendChild(b);let T=document.createElement("div");T.className="cesium-baseLayerPicker-item",T.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),b.appendChild(T);let S=document.createElement("img");S.className="cesium-baseLayerPicker-itemIcon",S.setAttribute("data-bind","attr: { src: iconUrl }"),S.setAttribute("draggable","false"),T.appendChild(S);let w=document.createElement("div");w.className="cesium-baseLayerPicker-itemLabel",w.setAttribute("data-bind","text: name"),T.appendChild(w),xe.applyBindings(n,i),xe.applyBindings(n,o),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=o,this._closeDropDown=function(D){i.contains(D.target)||o.contains(D.target)||(n.dropDownVisible=!1)},Et.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(Nz.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Nz.prototype.isDestroyed=function(){return!1};Nz.prototype.destroy=function(){return Et.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),xe.cleanNode(this._element),xe.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),ue(this)};var Fz=Nz;function gAe(e){let t=e.creationFunction;l(t.canExecute)||(t=An(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=y(e.category,""),this._data=e.data,this.endFunction=e.endFunction,xe.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(gAe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var Bs=gAe;function sCt(){let e=[];return e.push(new Bs({name:"Bing Maps Aerial",iconUrl:Qt("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return F0({style:N0.AERIAL})}})),e.push(new Bs({name:"Bing Maps Aerial with Labels",iconUrl:Qt("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return F0({style:N0.AERIAL_WITH_LABELS})}})),e.push(new Bs({name:"Bing Maps Roads",iconUrl:Qt("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return F0({style:N0.ROAD})}})),e.push(new Bs({name:"ESRI World Imagery",iconUrl:Qt("Widgets/Images/ImageryProviders/esriWorldImagery.png"),tooltip:`World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes NASA Blue Marble: Next Generation 500m resolution imagery at small scales (above 1:1,000,000), i-cubed 15m eSAT imagery at medium-to-large scales (down to 1:70,000) for the world, and USGS 15m Landsat imagery for Antarctica. The map features 0.3m resolution imagery in the continental United States and 0.6m resolution imagery in parts of Western Europe from DigitalGlobe. In other parts of the world, 1 meter resolution imagery is available from GeoEye IKONOS, i-cubed Nationwide Prime, Getmapping, AeroGRID, IGN Spain, and IGP Portugal. Additionally, imagery at different resolutions has been contributed by the GIS User Community.
- http://www.esri.com`,category:"Other",creationFunction:function(){return new O0({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",enablePickFeatures:!1})}})),e.push(new Bs({name:"ESRI World Street Map",iconUrl:Qt("Widgets/Images/ImageryProviders/esriWorldStreetMap.png"),tooltip:`This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; Ghana; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.
- http://www.esri.com`,category:"Other",creationFunction:function(){return new O0({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",enablePickFeatures:!1})}})),e.push(new Bs({name:"ESRI National Geographic",iconUrl:Qt("Widgets/Images/ImageryProviders/esriNationalGeographic.png"),tooltip:`This web map contains the National Geographic World Map service. This map service is designed to be used as a general reference map for informational and educational purposes as well as a basemap by GIS professionals and other users for creating web maps and web mapping applications.
- http://www.esri.com`,category:"Other",creationFunction:function(){return new O0({url:"https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/",enablePickFeatures:!1})}})),e.push(new Bs({name:"Open\xADStreet\xADMap",iconUrl:Qt("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.
- http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new FE({url:"https://a.tile.openstreetmap.org/"})}})),e.push(new Bs({name:"Stamen Watercolor",iconUrl:Qt("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.
- http://maps.stamen.com`,category:"Other",creationFunction:function(){return new FE({url:"https://stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new Bs({name:"Stamen Toner",iconUrl:Qt("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`A high contrast black and white map.
- http://maps.stamen.com`,category:"Other",creationFunction:function(){return new FE({url:"https://stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new Bs({name:"Sentinel-2",iconUrl:Qt("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return new L0({assetId:3954})}})),e.push(new Bs({name:"Blue Marble",iconUrl:Qt("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return new L0({assetId:3845})}})),e.push(new Bs({name:"Earth at night",iconUrl:Qt("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return new L0({assetId:3812})}})),e.push(new Bs({name:"Natural Earth\xA0II",iconUrl:Qt("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast.
- http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return new cC({url:Qt("Assets/Textures/NaturalEarthII")})}})),e}var Vz=sCt;function aCt(){let e=[];return e.push(new Bs({name:"WGS84 Ellipsoid",iconUrl:Qt("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new H_}})),e.push(new Bs({name:"Cesium World Terrain",iconUrl:Qt("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return KI({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var kz=aCt;function cCt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof Cf&&(e.tileset=n.primitive),e.pickActive=!1}}function xAe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof Cf&&(e.tileset=i.primitive)},_n.MOUSE_MOVE):(e._eventHandler.removeInputAction(_n.MOUSE_MOVE),e.picking=e.picking)}var lCt={maximumFractionDigits:3};function cP(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,lCt):Math.round(t).toLocaleString()}function lP(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[mo.PICK]:e._statisticsPerPass[mo.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${cP(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${cP(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${cP(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function CAe(){let e=Ar.statistics;return`
- <ul class="cesium-cesiumInspector-statistics">
- <li><strong>Geometry Memory (MB): </strong>${cP(e.geometryByteLength)}</li>
- <li><strong>Texture Memory (MB): </strong>${cP(e.texturesByteLength)}</li>
- </ul>
- `}var uCt=[{text:"Highlight",value:Kl.HIGHLIGHT},{text:"Replace",value:Kl.REPLACE},{text:"Mix",value:Kl.MIX}],yAe=new z(1,1,0,.4),fCt=new z,Uz=new z;function aa(e,t){let n=this,i=e.canvas;this._eventHandler=new Ku(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new H0({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this._tileset=void 0,this._feature=void 0,this._tile=void 0,xe.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile"]),this._properties=xe.observable({}),this.properties=[],xe.defineProperty(this,"properties",function(){let V=[],q=n._properties();for(let j in q)q.hasOwnProperty(j)&&V.push(j);return V});let r=xe.observable();xe.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return r()},set:function(V){r(V),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=V)}}),this.dynamicScreenSpaceError=!1;let o=xe.observable();xe.defineProperty(this,"colorBlendMode",{get:function(){return o()},set:function(V){o(V),l(n._tileset)&&(n._tileset.colorBlendMode=V,n._scene.requestRender())}}),this.colorBlendMode=Kl.HIGHLIGHT;let s=xe.observable(),a=xe.observable();xe.defineProperty(this,"picking",{get:function(){return a()},set:function(V){a(V),V?n._eventHandler.setInputAction(function(q){let j=e.pick(q.endPosition);if(j instanceof bo?(n.feature=j,n.tile=j.content.tile):l(j)&&l(j.content)?(n.feature=void 0,n.tile=j.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(j)&&l(j.content)){let X;e.pickPositionSupported&&(X=e.pickPosition(q.endPosition),l(X)&&(n._tileset.debugPickPosition=X)),n._tileset.debugPickedTile=j.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},_n.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(_n.MOUSE_MOVE))}}),this.picking=!0;let c=xe.observable();xe.defineProperty(this,"colorize",{get:function(){return c()},set:function(V){c(V),l(n._tileset)&&(n._tileset.debugColorizeTiles=V,n._scene.requestRender())}}),this.colorize=!1;let u=xe.observable();xe.defineProperty(this,"wireframe",{get:function(){return u()},set:function(V){u(V),l(n._tileset)&&(n._tileset.debugWireframe=V,n._scene.requestRender())}}),this.wireframe=!1;let f=xe.observable();xe.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(V){f(V),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=V,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let d=xe.observable();xe.defineProperty(this,"showContentBoundingVolumes",{get:function(){return d()},set:function(V){d(V),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=V,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=xe.observable();xe.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(V){p(V),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=V,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=xe.observable();xe.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(V){g(V),l(n._tileset)&&(n._tileset.debugFreezeFrame=V,n._scene.debugShowFrustumPlanes=V,n._scene.requestRender())}}),this.freezeFrame=!1,xe.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(V){s(V),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=V,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let m=xe.observable();xe.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(V){m(V),l(n._tileset)&&(n._tileset.debugShowGeometricError=V,n._scene.requestRender())}}),this.showGeometricError=!1;let x=xe.observable();xe.defineProperty(this,"showRenderingStatistics",{get:function(){return x()},set:function(V){x(V),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=V,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let C=xe.observable();xe.defineProperty(this,"showMemoryUsage",{get:function(){return C()},set:function(V){C(V),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=V,n._scene.requestRender())}}),this.showMemoryUsage=!1;let A=xe.observable();xe.defineProperty(this,"showUrl",{get:function(){return A()},set:function(V){A(V),l(n._tileset)&&(n._tileset.debugShowUrl=V,n._scene.requestRender())}}),this.showUrl=!1;let b=xe.observable();xe.defineProperty(this,"maximumScreenSpaceError",{get:function(){return b()},set:function(V){V=Number(V),isNaN(V)||(b(V),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=V))}}),this.maximumScreenSpaceError=16;let T=xe.observable();xe.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return T()},set:function(V){V=Number(V),isNaN(V)||(T(V),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=V))}}),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,xe.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(T(),1/6)},set:function(V){T(Math.pow(V,6))}});let S=xe.observable();xe.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return S()},set:function(V){V=Number(V),isNaN(V)||(S(V),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=V))}}),this.dynamicScreenSpaceErrorFactor=4;let w=cCt(this),D=xe.observable();xe.defineProperty(this,"pickActive",{get:function(){return D()},set:function(V){D(V),V?n._eventHandler.setInputAction(w,_n.LEFT_CLICK):n._eventHandler.removeInputAction(_n.LEFT_CLICK)}});let I=xe.observable();xe.defineProperty(this,"pointCloudShading",{get:function(){return I()},set:function(V){I(V),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=V)}}),this.pointCloudShading=!1;let O=xe.observable();xe.defineProperty(this,"geometricErrorScale",{get:function(){return O()},set:function(V){V=Number(V),isNaN(V)||(O(V),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=V))}}),this.geometricErrorScale=1;let B=xe.observable();xe.defineProperty(this,"maximumAttenuation",{get:function(){return B()},set:function(V){V=Number(V),isNaN(V)||(B(V),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=V===0?void 0:V))}}),this.maximumAttenuation=0;let L=xe.observable();xe.defineProperty(this,"baseResolution",{get:function(){return L()},set:function(V){V=Number(V),isNaN(V)||(L(V),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=V===0?void 0:V))}}),this.baseResolution=0;let _=xe.observable();xe.defineProperty(this,"eyeDomeLighting",{get:function(){return _()},set:function(V){_(V),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=V)}}),this.eyeDomeLighting=!1;let E=xe.observable();xe.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return E()},set:function(V){V=Number(V),isNaN(V)||(E(V),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=V))}}),this.eyeDomeLightingStrength=1;let v=xe.observable();xe.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return v()},set:function(V){V=Number(V),isNaN(V)||(v(V),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=V))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let P=xe.observable();xe.defineProperty(this,"skipLevelOfDetail",{get:function(){return P()},set:function(V){P(V),l(n._tileset)&&(n._tileset.skipLevelOfDetail=V)}}),this.skipLevelOfDetail=!0;let R=xe.observable();xe.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return R()},set:function(V){V=Number(V),isNaN(V)||(R(V),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=V))}}),this.skipScreenSpaceErrorFactor=16;let F=xe.observable();xe.defineProperty(this,"baseScreenSpaceError",{get:function(){return F()},set:function(V){V=Number(V),isNaN(V)||(F(V),l(n._tileset)&&(n._tileset.baseScreenSpaceError=V))}}),this.baseScreenSpaceError=1024;let U=xe.observable();xe.defineProperty(this,"skipLevels",{get:function(){return U()},set:function(V){V=Number(V),isNaN(V)||(U(V),l(n._tileset)&&(n._tileset.skipLevels=V))}}),this.skipLevels=1;let k=xe.observable();xe.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return k()},set:function(V){k(V),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=V)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let H=xe.observable();xe.defineProperty(this,"loadSiblings",{get:function(){return H()},set:function(V){H(V),l(n._tileset)&&(n._tileset.loadSiblings=V)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),l(this._tileset)||xAe(this,!0)}Object.defineProperties(aa.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return uCt}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,l(e)){let t=this;e.readyPromise.then(function(o){t.isDestroyed()||t._properties(o.properties)});let n=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],i=n.length;for(let o=0;o<i;++o){let s=n[o];this[s]=this[s]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings;let r=e.pointCloudShading;this.pointCloudShading=r.attenuation,this.geometricErrorScale=r.geometricErrorScale,this.maximumAttenuation=r.maximumAttenuation?r.maximumAttenuation:0,this.baseResolution=r.baseResolution?r.baseResolution:0,this.eyeDomeLighting=r.eyeDomeLighting,this.eyeDomeLightingStrength=r.eyeDomeLightingStrength,this.eyeDomeLightingRadius=r.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=lP(e,!1),this._pickStatisticsText=lP(e,!0),this._resourceCacheStatisticsText=CAe(),xAe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,fCt):z.WHITE:t.color=Uz,this._scene.requestRender()),l(e)&&(z.clone(e.color,Uz),e.color=yAe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!SX(t.content)&&(t.color=Uz,this._scene.requestRender()),l(e)&&!SX(e.content)&&(z.clone(e.color,Uz),e.color=yAe,this._scene.requestRender()),this._tile=e}}});function SX(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!SX(t[i]))return!1;return!0}return!1}aa.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};aa.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};aa.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};aa.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};aa.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};aa.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};aa.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};aa.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};aa.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};aa.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};aa.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new TE(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};aa.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,a=n.value.slice(i,r).split(`
- `),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),o-=2):(a[u]=a[u].substr(1),o-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,o+=2;let f=a.join(`
- `);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};aa.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=lP(e,!1),this._pickStatisticsText=lP(e,!0),this._resourceCacheStatisticsText=CAe())};aa.prototype.isDestroyed=function(){return!1};aa.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){xe.getObservable(e,t).dispose()}),ue(this)};aa.getStatistics=lP;var zz=aa;function Hz(e,t){e=Pn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let r=new zz(t,i);this._viewModel=r,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="3D Tiles Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");this._panel=s,s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=Z0.createSection,c=Z0.createCheckbox,u=a(s,"Tileset","tilesetVisible","toggleTileset"),f=a(s,"Display","displayVisible","toggleDisplay"),d=a(s,"Update","updateVisible","toggleUpdate"),p=a(s,"Logging","loggingVisible","toggleLogging"),g=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),m=a(s,"Style","styleVisible","toggleStyle"),x=a(s,"Optimization","optimizationVisible","toggleOptimization"),C=document.createElement("div");C.className="field-group";let A=document.createElement("label");A.className="field-label",A.appendChild(document.createTextNode("Properties: "));let b=document.createElement("div");b.setAttribute("data-bind","text: properties"),C.appendChild(A),C.appendChild(b),u.appendChild(C),u.appendChild(wX("togglePickTileset","Pick Tileset","pickActive")),u.appendChild(wX("trimTilesCache","Trim Tiles Cache")),u.appendChild(c("Enable Picking","picking")),f.appendChild(c("Colorize","colorize")),f.appendChild(c("Wireframe","wireframe")),f.appendChild(c("Bounding Volumes","showBoundingVolumes")),f.appendChild(c("Content Volumes","showContentBoundingVolumes")),f.appendChild(c("Request Volumes","showRequestVolumes")),f.appendChild(c("Point Cloud Shading","pointCloudShading"));let T=document.createElement("div");T.setAttribute("data-bind","visible: pointCloudShading"),T.appendChild(sh("geometricErrorScale",0,2,.01,"Geometric Error Scale")),T.appendChild(sh("maximumAttenuation",0,32,1,"Maximum Attenuation")),T.appendChild(sh("baseResolution",0,1,.01,"Base Resolution")),T.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),f.appendChild(T);let S=document.createElement("div");S.setAttribute("data-bind","visible: eyeDomeLighting"),S.appendChild(sh("eyeDomeLightingStrength",0,2,.1,"EDL Strength")),S.appendChild(sh("eyeDomeLightingRadius",0,4,.1,"EDL Radius")),T.appendChild(S),d.appendChild(c("Freeze Frame","freezeFrame")),d.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let w=document.createElement("div");w.appendChild(sh("maximumScreenSpaceError",0,128,1,"Maximum Screen Space Error")),d.appendChild(w);let D=document.createElement("div");D.setAttribute("data-bind","visible: dynamicScreenSpaceError"),D.appendChild(sh("dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"Screen Space Error Density","dynamicScreenSpaceErrorDensity")),D.appendChild(sh("dynamicScreenSpaceErrorFactor",1,10,.1,"Screen Space Error Factor")),d.appendChild(D),p.appendChild(c("Performance","performance")),p.appendChild(i),p.appendChild(c("Statistics","showStatistics"));let I=document.createElement("div");I.className="cesium-3dTilesInspector-statistics",I.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),p.appendChild(I),p.appendChild(c("Pick Statistics","showPickStatistics"));let O=document.createElement("div");O.className="cesium-3dTilesInspector-statistics",O.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),p.appendChild(O),p.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let B=document.createElement("div");B.className="cesium-3dTilesInspector-statistics",B.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),p.appendChild(B);let L=document.createElement("div");m.appendChild(L),L.appendChild(document.createTextNode("Color Blend Mode: "));let _=document.createElement("select");_.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),L.appendChild(_);let E=document.createElement("textarea");E.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),L.className="cesium-cesiumInspector-styleEditor",L.appendChild(E);let v=wX("compileStyle","Compile (Ctrl+Enter)");L.appendChild(v);let P=document.createElement("div");P.className="cesium-cesiumInspector-error",P.setAttribute("data-bind","text: editorError"),L.appendChild(P),g.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),g.appendChild(c("Geometric Error","showGeometricError")),g.appendChild(c("Rendering Statistics","showRenderingStatistics")),g.appendChild(c("Memory Usage (MB)","showMemoryUsage")),g.appendChild(c("Url","showUrl")),x.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let R=document.createElement("div");R.appendChild(sh("skipScreenSpaceErrorFactor",1,50,1,"Skip SSE Factor")),x.appendChild(R);let F=document.createElement("div");F.appendChild(sh("baseScreenSpaceError",0,4096,1,"SSE before skipping LOD")),x.appendChild(F);let U=document.createElement("div");U.appendChild(sh("skipLevels",0,10,1,"Min. levels to skip")),x.appendChild(U),x.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),x.appendChild(c("Load siblings of visible tiles","loadSiblings")),xe.applyBindings(r,n)}Object.defineProperties(Hz.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Hz.prototype.isDestroyed=function(){return!1};Hz.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};function sh(e,t,n,i,r,o){o=y(o,e);let s=document.createElement("input");s.setAttribute("data-bind",`value: ${o}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=t,a.max=n,a.step=i,a.setAttribute("data-bind",`valueUpdate: "input", value: ${e}`);let c=document.createElement("div");c.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(r)),u.appendChild(s),u.appendChild(c),u}function wX(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=t,i.className="cesium-cesiumInspector-pickButton";let r=`click: ${e}`;return l(n)&&(r+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",r),i}var Gz=Hz;function dCt(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let r=parseInt(i,10),o;if(r===7)o="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);r>=c&&(s.push(a+1),r-=c)}o=s.reverse().join(" and ")}t+=`<br> ${n[i]} in frustum ${o}`}t+=`<br>Total: ${e.totalCommands}`}return t}function vX(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var hCt=new En,mCt=new h;function uP(e,t){let n=this,i=e.canvas,r=new Ku(i);this._eventHandler=r,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let o=this._scene.globe;o.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",xe.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=An(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=An(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=An(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=An(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=xe.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=xe.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=xe.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new H0({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=An(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=xe.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=An(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new iU({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=xe.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=An(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=xe.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=xe.getObservable(this,"wireframe").subscribe(function(u){o._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=xe.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=An(function(){let u=n.depthFrustum+1;return n.depthFrustum=vX(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=An(function(){let u=n.depthFrustum-1;return n.depthFrustum=vX(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=xe.getObservable(this,"suspendUpdates").subscribe(function(u){o._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=An(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new fz({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=xe.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=xe.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=An(function(){return n.tileBoundingSphere?o._surface.tileProvider._debug.boundingSphereTile=n._tile:o._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=An(function(){return n.filterTile?(n.suspendUpdates=!0,o._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&o._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=xe.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=An(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=xe.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?r.setInputAction(a,_n.LEFT_CLICK):r.removeInputAction(_n.LEFT_CLICK)});function c(u){let f,d=o.ellipsoid,p=n._scene.camera.getPickRay(u.position,hCt),g=o.pick(p,n._scene,mCt);if(l(g)){let m=d.cartesianToCartographic(g),x=o._surface.tileProvider._tilesToRenderByTextureCount;for(let C=0;!f&&C<x.length;++C){let A=x[C];if(!!l(A))for(let b=0;!f&&b<A.length;++b){let T=A[b];he.contains(T.rectangle,m)&&(f=T)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=An(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=xe.getObservable(this,"pickTileActive").subscribe(function(u){u?r.setInputAction(c,_n.LEFT_CLICK):r.removeInputAction(_n.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(uP.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return An(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return An(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return An(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return An(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return An(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});uP.prototype._update=function(){this.frustums&&(this.frustumStatisticText=dCt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=vX(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};uP.prototype.isDestroyed=function(){return!1};uP.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),ue(this)};var Wz=uP;function jz(e,t){e=Pn(e);let n=document.createElement("div"),i=new Wz(t,n);this._viewModel=i,this._container=e;let r=document.createElement("div");this._element=r;let o=document.createElement("div");o.textContent="Cesium Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleDropDown"),r.appendChild(o),r.className="cesium-cesiumInspector",r.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");this._panel=s,s.className="cesium-cesiumInspector-dropDown",r.appendChild(s);let a=Z0.createSection,c=Z0.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(d),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let g=document.createElement("div");u.appendChild(g);let m=document.createElement("span");m.setAttribute("data-bind",'html: " Frustum:"'),g.appendChild(m);let x=document.createElement("span");x.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(x);let C=document.createElement("input");C.type="button",C.value="-",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(C);let A=document.createElement("input");A.type="button",A.value="+",A.className="cesium-cesiumInspector-pickButton",A.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(A);let b=a(s,"Primitives","primitivesVisible","togglePrimitives"),T=document.createElement("div");T.className="cesium-cesiumInspector-pickSection",b.appendChild(T);let S=document.createElement("input");S.type="button",S.value="Pick a primitive",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let w=document.createElement("div");w.className="cesium-cesiumInspector-center",w.appendChild(S),T.appendChild(w),T.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),T.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),T.appendChild(this._primitiveOnly);let D=a(s,"Terrain","terrainVisible","toggleTerrain"),I=document.createElement("div");I.className="cesium-cesiumInspector-pickSection",D.appendChild(I);let O=document.createElement("input");O.type="button",O.value="Pick a tile",O.className="cesium-cesiumInspector-pickButton",O.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),w=document.createElement("div"),w.appendChild(O),w.className="cesium-cesiumInspector-center",I.appendChild(w);let B=document.createElement("div");I.appendChild(B);let L=document.createElement("input");L.type="button",L.value="Parent",L.className="cesium-cesiumInspector-pickButton",L.setAttribute("data-bind","click: selectParent");let _=document.createElement("input");_.type="button",_.value="NW",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: selectNW");let E=document.createElement("input");E.type="button",E.value="NE",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind","click: selectNE");let v=document.createElement("input");v.type="button",v.value="SW",v.className="cesium-cesiumInspector-pickButton",v.setAttribute("data-bind","click: selectSW");let P=document.createElement("input");P.type="button",P.value="SE",P.className="cesium-cesiumInspector-pickButton",P.setAttribute("data-bind","click: selectSE");let R=document.createElement("div");R.className="cesium-cesiumInspector-tileText",B.className="cesium-cesiumInspector-frustumStatistics",B.appendChild(R),B.setAttribute("data-bind","visible: hasPickedTile"),R.setAttribute("data-bind","html: tileText");let F=document.createElement("div");F.className="cesium-cesiumInspector-relativeText",F.textContent="Select relative:",B.appendChild(F);let U=document.createElement("table"),k=document.createElement("tr"),H=document.createElement("tr"),V=document.createElement("td");V.appendChild(L);let q=document.createElement("td");q.appendChild(_);let j=document.createElement("td");j.appendChild(E),k.appendChild(V),k.appendChild(q),k.appendChild(j);let X=document.createElement("td"),G=document.createElement("td");G.appendChild(v);let $=document.createElement("td");$.appendChild(P),H.appendChild(X),H.appendChild(G),H.appendChild($),U.appendChild(k),U.appendChild(H),B.appendChild(U),I.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),I.appendChild(c("Show only selected","filterTile","hasPickedTile")),D.appendChild(c("Wireframe","wireframe")),D.appendChild(c("Suspend LOD update","suspendUpdates")),D.appendChild(c("Show tile coordinates","tileCoordinates")),xe.applyBindings(i,this._element)}Object.defineProperties(jz.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});jz.prototype.isDestroyed=function(){return!1};jz.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var qz=jz;function tS(e){return Qt(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}function pCt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let r=e._targetFrameRate;if(!l(r))e.resize(),e.render(),requestAnimationFrame(n);else{let o=1e3/r,s=i-t;s>o&&(e.resize(),e.render(),t=i-s%o),requestAnimationFrame(n)}}catch(r){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){let o="An error occurred while rendering. Rendering has stopped.";e.showErrorPanel(o,void 0,r)}}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function AAe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function TAe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,r=AAe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=r,i*=r,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function bAe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let r=e._scene.camera.frustum;l(r.aspectRatio)?r.aspectRatio=n/i:(r.top=r.right*(i/n),r.bottom=-r.top)}}function BC(e,t){e=Pn(e),t=y(t,y.EMPTY_OBJECT);let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),r=Et.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=r,r&&(i.style.imageRendering=Et.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function o(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}y(t.blurActiveElementOnCanvasFocus,!0)&&(i.addEventListener("mousedown",o),i.addEventListener("pointerdown",o)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?Pn(t.creditContainer):n;c.appendChild(a);let u=l(t.creditViewport)?Pn(t.creditViewport):n,f=y(t.showRenderLoopErrors,!0),d=y(t.useBrowserRecommendedResolution,!0);this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=d,this._forceResize=!1,this._clock=l(t.clock)?t.clock:new Sh,TAe(this);try{let p=new Q4({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:y(t.scene3DOnly,!1),shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=p,p.camera.constrainedAxis=h.UNIT_Z,AAe(this),bAe(this);let g=y(p.mapProjection.ellipsoid,oe.WGS84),m=t.globe;l(m)||(m=new qU(g)),m!==!1&&(p.globe=m,p.globe.shadows=y(t.terrainShadows,Zt.RECEIVE_ONLY));let x=t.skyBox;l(x)||(x=new sz({sources:{positiveX:tS("px"),negativeX:tS("mx"),positiveY:tS("py"),negativeY:tS("my"),positiveZ:tS("pz"),negativeZ:tS("mz")}})),x!==!1&&(p.skyBox=x,p.sun=new uz,p.moon=new e4);let C=t.skyAtmosphere;l(C)||(C=new nz(g)),C!==!1&&(p.skyAtmosphere=C);let A=t.globe===!1?!1:t.imageryProvider;l(A)||(A=F0()),A!==!1&&p.imageryLayers.addImageryProvider(A),l(t.terrainProvider)&&t.globe!==!1&&(p.terrainProvider=t.terrainProvider),this._screenSpaceEventHandler=new Ku(i),l(t.sceneMode)&&(t.sceneMode===te.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===te.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=y(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let b=this;this._onRenderError=function(T,S){if(b._useDefaultRenderLoop=!1,b._renderLoopRunning=!1,b._showRenderLoopErrors){let w="An error occurred while rendering. Rendering has stopped.";b.showErrorPanel(w,void 0,S)}},p.renderError.addEventListener(this._onRenderError)}catch(p){if(f){let g="Error constructing CesiumWidget.",m='Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:';this.showErrorPanel(g,m,p)}throw p}}Object.defineProperties(BC.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&pCt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}}});BC.prototype.showErrorPanel=function(e,t,n){let i=this._element,r=document.createElement("div");r.className="cesium-widget-errorPanel";let o=document.createElement("div");o.className="cesium-widget-errorPanel-content",r.appendChild(o);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),o.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",o.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let u=l(t),f=l(n);if(u||f){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),f){let m=Gm(n);u||(typeof n=="string"&&(n=new Error(n)),t=Gm({name:n.name,message:n.message}),m=n.stack),typeof console<"u"&&console.error(`${e}
- ${t}
- ${m}`);let x=document.createElement("div");x.className="cesium-widget-errorPanel-message-details collapsed";let C=document.createElement("span");C.className="cesium-widget-errorPanel-more-details",C.appendChild(document.createTextNode("See more...")),x.appendChild(C),x.onclick=function(A){x.removeChild(C),x.appendChild(document.createTextNode(m)),x.className="cesium-widget-errorPanel-message-details",o.className="cesium-widget-errorPanel-content expanded",x.onclick=void 0},a.appendChild(x)}g.innerHTML=`<p>${t}</p>`}let d=document.createElement("div");d.className="cesium-widget-errorPanel-buttonPanel",o.appendChild(d);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(r)},d.appendChild(p),i.appendChild(r)};BC.prototype.isDestroyed=function(){return!1};BC.prototype.destroy=function(){l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),ue(this)};BC.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,TAe(this),bAe(this),this._scene.requestRender())};BC.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};var Yz=BC;function Xz(e,t){l(t)||(t=document.body),t=Pn(t);let n=this,i=xe.observable(Oo.fullscreen),r=xe.observable(Oo.enabled),o=t.ownerDocument;this.isFullscreen=void 0,xe.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,xe.defineProperty(this,"isFullscreenEnabled",{get:function(){return r()},set:function(s){r(s&&Oo.enabled)}}),this.tooltip=void 0,xe.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=An(function(){Oo.fullscreen?Oo.exitFullscreen():Oo.requestFullscreen(n._fullscreenElement)},xe.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=y(Pn(e),o.body),this._callback=function(){i(Oo.fullscreen)},o.addEventListener(Oo.changeEventName,this._callback)}Object.defineProperties(Xz.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});Xz.prototype.isDestroyed=function(){return!1};Xz.prototype.destroy=function(){document.removeEventListener(Oo.changeEventName,this._callback),ue(this)};var Kz=Xz;var _Ct="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",gCt="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function $z(e,t){e=Pn(e);let n=new Kz(t,e);n._exitFullScreenPath=gCt,n._enterFullScreenPath=_Ct;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),xe.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties($z.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});$z.prototype.isDestroyed=function(){return!1};$z.prototype.destroy=function(){return this._viewModel.destroy(),xe.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var Zz=$z;var EAe=1e3;function Rm(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new hI,new CO({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._geocodePromise=void 0,this._complete=new ge,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=wAe,this._handleArrowUp=SAe;let t=this;this._suggestionsVisible=xe.pureComputed(function(){let r=xe.getObservable(t,"_suggestions")().length>0,o=xe.getObservable(t,"_showSuggestions")();return r&&o}),this._searchCommand=An(function(i){if(i=y(i,Ry.SEARCH),t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;t.hideSuggestions(),t.isSearchInProgress?bCt(t):ACt(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,s=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38;return(o||s)&&r.preventDefault(),!0},this.handleKeyUp=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,s=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38,a=r.key==="Enter"||r.keyCode===13;return s?SAe(t):o?wAe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let r=i.destination;DAe(t),t.destinationFound(t,r)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,r){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=y(e.autocomplete,!0),this.destinationFound=y(e.destinationFound,Rm.flyToDestination),this._focusTextbox=!1,xe.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=xe.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){Rm._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,xe.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,xe.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,xe.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(Rm.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});Rm.prototype.destroy=function(){this._suggestionSubscription.dispose()};function SAe(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],Rm._adjustSuggestionsScroll(e,n)}function wAe(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],Rm._adjustSuggestionsScroll(e,i)}function yCt(e,t){let n=l(t)?t.availability:void 0;return l(n)?dT(t,[e]).then(function(i){return e=i[0],e.height+=EAe,e}):(e.height+=EAe,Promise.resolve(e))}function xCt(e,t){let n=e._scene,r=n.mapProjection.ellipsoid,o=n.camera,s=n.terrainProvider,a=t,c;return t instanceof he?M.equalsEpsilon(t.south,t.north,M.EPSILON7)&&M.equalsEpsilon(t.east,t.west,M.EPSILON7)?t=he.center(t):c=bE(t,n):t=r.cartesianToCartographic(t),l(c)||(c=yCt(t,s)),c.then(function(u){a=r.cartographicToCartesian(u)}).finally(function(){o.flyTo({destination:a,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:N.IDENTITY})})}function CCt(e,t,n,i){return e.then(function(r){return l(r)&&r.state==="fulfilled"&&r.value.length>0?r:t.geocode(n,i).then(function(s){return{state:"fulfilled",value:s}}).catch(function(s){return{state:"rejected",reason:s}})})}function ACt(e,t,n){let i=e._searchText;if(vAe(i)){e.showSuggestions();return}e._isSearchInProgress=!0;let r=Promise.resolve();for(let o=0;o<t.length;o++)r=CCt(r,t[o],i,n);e._geocodePromise=r,r.then(function(o){if(r.cancel)return;e._isSearchInProgress=!1;let s=o.value;if(o.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);return}e._searchText=`${i} (not found)`})}function TCt(e,t){let n=Pn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],o=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=o.offsetTop;s+o.clientHeight>i.clientHeight?i.scrollTop=s+o.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function bCt(e){e._isSearchInProgress=!1,l(e._geocodePromise)&&(e._geocodePromise.cancel=!0,e._geocodePromise=void 0)}function vAe(e){return/^\s*$/.test(e)}function DAe(e){xe.getObservable(e,"_suggestions").removeAll()}function ECt(e){if(!e.autoComplete)return;let t=e._searchText;if(DAe(e),vAe(t))return;let n=Promise.resolve([]);return e._geocoderServices.forEach(function(i){n=n.then(function(r){return r.length>=5?r:i.geocode(t,Ry.AUTOCOMPLETE).then(function(o){return r=r.concat(o),r})})}),n.then(function(i){let r=e._suggestions;for(let o=0;o<i.length;o++)r.push(i[o])})}Rm.flyToDestination=xCt;Rm._updateSearchSuggestions=ECt;Rm._adjustSuggestionsScroll=TCt;var Jz=Rm;var SCt="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",wCt="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function Qz(e){let t=Pn(e.container),n=new Jz(e);n._startSearchPath=SCt,n._stopSearchPath=wCt;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let r=document.createElement("input");r.type="search",r.className="cesium-geocoder-input",r.setAttribute("placeholder","Enter an address or landmark..."),r.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){r.select()},0)},r.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(r),this._textBox=r;let o=document.createElement("span");o.className="cesium-geocoder-searchButton",o.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(o),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),xe.applyBindings(n,i),xe.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},Et.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(Qz.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});Qz.prototype.isDestroyed=function(){return!1};Qz.prototype.destroy=function(){let e=this._container;return Et.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),xe.cleanNode(this._form),xe.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),ue(this)};var e8=Qz;function PAe(e,t){this._scene=e,this._duration=t;let n=this;this._command=An(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",xe.track(this,["tooltip"])}Object.defineProperties(PAe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var t8=PAe;function n8(e,t,n){e=Pn(e);let i=new t8(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-home-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(r),xe.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(n8.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});n8.prototype.isDestroyed=function(){return!1};n8.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var i8=n8;var vCt="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",DCt="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function DX(){this._cameraClicked=new ge,this._closeClicked=new ge,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",xe.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,xe.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?DCt:vCt}}),xe.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}DX.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(DX.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var r8=DX;function o8(e){e=Pn(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);let r=document.createElement("button");r.type="button",r.className="cesium-infoBox-close",r.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),r.innerHTML="×",t.appendChild(r);let o=document.createElement("iframe");o.className="cesium-infoBox-iframe",o.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),o.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),o.setAttribute("allowfullscreen",!0),t.appendChild(o);let s=new r8;xe.applyBindings(s,t),this._container=e,this._element=t,this._frame=o,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;o.addEventListener("load",function(){let c=o.contentDocument,u=c.createElement("link");u.href=Qt("Widgets/InfoBox/InfoBoxDescription.css"),u.rel="stylesheet",u.type="text/css";let f=c.createElement("div");f.className="cesium-infoBox-description",c.head.appendChild(u),c.body.appendChild(f),a._descriptionSubscription=Pa(s,"description",function(d){o.style.height="5px",f.innerHTML=d;let p=null,g=f.firstElementChild;if(g!==null&&f.childNodes.length===1){let x=window.getComputedStyle(g);if(x!==null){let C=x["background-color"],A=z.fromCssColorString(C);l(A)&&A.alpha!==0&&(p=x["background-color"])}}t.style["background-color"]=p;let m=f.getBoundingClientRect().height;o.style.height=`${m}px`})}),o.setAttribute("src","about:blank")}Object.defineProperties(o8.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});o8.prototype.isDestroyed=function(){return!1};o8.prototype.destroy=function(){let e=this._container;return xe.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),ue(this)};var s8=o8;function IAe(){this.showInstructions=!1;let e=this;this._command=An(function(){e.showInstructions=!e.showInstructions}),this._showClick=An(function(){e._touch=!1}),this._showTouch=An(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",xe.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(IAe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var a8=IAe;function c8(e){let t=Pn(e.container),n=new a8,i=y(e.instructionsInitiallyVisible,!1);n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let r=document.createElement("span");r.className="cesium-navigationHelpButton-wrapper",t.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),r.appendChild(o);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),r.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=Qt("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=Qt("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);let d=document.createElement("div");d.className="cesium-click-navigation-help cesium-navigation-help-instructions",d.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),d.innerHTML=` <table> <tr> <td><img src="${Qt("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${Qt("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${Qt("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(d);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${Qt("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${Qt("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${Qt("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${Qt("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),xe.applyBindings(n,r),this._container=t,this._viewModel=n,this._wrapper=r,this._closeInstructions=function(g){r.contains(g.target)||(n.showInstructions=!1)},Et.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(c8.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});c8.prototype.isDestroyed=function(){return!1};c8.prototype.destroy=function(){return Et.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),xe.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var l8=c8;function PX(e){this._scene=e.scene,this.lowFrameRateMessage=y(e.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,xe.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=An(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=_U.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(PX.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});PX.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ue(this)};var u8=PX;function f8(e){let t=Pn(e.container),n=new u8(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let r=document.createElement("button");r.setAttribute("type","button"),r.className="cesium-performance-watchdog-message-dismiss",r.innerHTML="×",r.setAttribute("data-bind","click: dismissMessage"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-performance-watchdog-message",o.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(o),t.appendChild(i),xe.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(f8.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});f8.prototype.isDestroyed=function(){return!1};f8.prototype.destroy=function(){return this._viewModel.destroy(),xe.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var d8=f8;function h8(e){this._scene=e,this._orthographic=e.camera.frustum instanceof en,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,xe.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;xe.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=An(function(){t.sceneMode===te.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new Yo,this._eventHelper.add(e.morphComplete,function(n,i,r,o){t.sceneMode=r,t._orthographic=r===te.SCENE2D||t._scene.camera.frustum instanceof en}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=An(function(){t.sceneMode!==te.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=An(function(){t.sceneMode!==te.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=te}Object.defineProperties(h8.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});h8.prototype.isDestroyed=function(){return!1};h8.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var m8=h8;var PCt="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",ICt="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function p8(e,t){e=Pn(e);let n=new m8(t);n._perspectivePath=PCt,n._orthographicPath=ICt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(o);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),xe.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},Et.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(p8.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});p8.prototype.isDestroyed=function(){return!1};p8.prototype.destroy=function(){return this._viewModel.destroy(),Et.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),xe.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var _8=p8;function g8(e,t){this._scene=e;let n=this,i=function(r,o,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new Yo,this._eventHelper.add(e.morphStart,i),this._duration=y(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",xe.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,xe.defineProperty(this,"selectedTooltip",function(){let r=n.sceneMode;return r===te.SCENE2D?n.tooltip2D:r===te.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=An(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=An(function(){e.morphTo2D(n._duration)}),this._morphTo3D=An(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=An(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=te}Object.defineProperties(g8.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});g8.prototype.isDestroyed=function(){return!1};g8.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var y8=g8;var OCt="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",RCt="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",MCt="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function x8(e,t,n){e=Pn(e);let i=new y8(t,n);i._globePath=OCt,i._flatMapPath=RCt,i._columbusViewPath=MCt;let r=document.createElement("span");r.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',r.appendChild(o);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),r.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),r.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),r.appendChild(c),xe.applyBindings(i,r),this._viewModel=i,this._container=e,this._wrapper=r,this._closeDropDown=function(u){r.contains(u.target)||(i.dropDownVisible=!1)},Et.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(x8.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});x8.prototype.isDestroyed=function(){return!1};x8.prototype.destroy=function(){return this._viewModel.destroy(),Et.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),xe.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var C8=x8;var BCt=new W,A8="-1000px";function fP(e,t,n){this._scene=e,this._screenPositionX=A8,this._screenPositionY=A8,this._tweens=e.tweens,this._container=y(n,document.body),this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,xe.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,xe.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),xe.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,r){return rr.wgs84ToWindowCoordinates(e,i,r)}}fP.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,BCt);if(!l(e))this._screenPositionX=A8,this._screenPositionY=A8;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,r=this._selectionIndicatorElement.clientWidth,o=r*.5;e.x=Math.min(Math.max(e.x,-r),n+r)-o,e.y=Math.min(Math.max(e.y,-r),i+r)-o,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};fP.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:qo.EXPONENTIAL_OUT})};fP.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:qo.EXPONENTIAL_OUT})};Object.defineProperties(fP.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var T8=fP;function b8(e,t){e=Pn(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",r="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",o=document.createElementNS(i,"svg:svg");o.setAttribute("width",160),o.setAttribute("height",160),o.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),o.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",r),s.appendChild(a),n.appendChild(o);let c=new T8(t,this._element,this._container);this._viewModel=c,xe.applyBindings(this._viewModel,this._element)}Object.defineProperties(b8.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});b8.prototype.isDestroyed=function(){return!1};b8.prototype.destroy=function(){let e=this._container;return xe.cleanNode(this._element),e.removeChild(this._element),ue(this)};var E8=b8;function LC(e,t,n){this._color=e,this._height=t,this._base=y(n,0)}LC.prototype.getHeight=function(){return this._height};LC.prototype.getBase=function(){return this._base};LC.prototype.getStartTime=function(){return this._start};LC.prototype.getStopTime=function(){return this._stop};LC.prototype.setRange=function(e,t){this._start=e,this._stop=t};LC.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=ee.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),r=ee.secondsDifference(this._stop,e.epochJulian),o=Math.round(e.timeBarWidth*e.getAlpha(r))-i;i<0&&(o+=i,i=0),i+o>e.timeBarWidth&&(o=e.timeBarWidth-i),o>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${o.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var S8=LC;function OAe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new z(.5,.5,.5,1),this.backgroundColor=i||new z(0,0,0,0)}OAe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,r=t.startJulian,o=ee.addSeconds(t.startJulian,t.duration,new ee);if(ee.lessThan(n,r)&&ee.greaterThan(i,o))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(ee.lessThanOrEquals(n,o)&&ee.greaterThanOrEquals(i,r)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let u=ee.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new ee);!l(a)&&ee.greaterThanOrEquals(u,n)?a=s:!l(c)&&ee.greaterThanOrEquals(u,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var w8=OAe;var IX=1e12,Gf={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Yc={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},ey=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],LCt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Xc(e,t){e=Pn(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=Gf.none,this._touchMode=Yc.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=NCt(this),this._onMouseUp=FCt(this),this._onMouseMove=VCt(this),this._onMouseWheel=kCt(this),this._onTouchStart=UCt(this),this._onTouchMove=HCt(this),this._onTouchEnd=zCt(this);let r=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),r.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}Xc.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};Xc.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};Xc.prototype.isDestroyed=function(){return!1};Xc.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),ue(this)};Xc.prototype.addHighlightRange=function(e,t,n){let i=new S8(e,t,n);return this._highlightRanges.push(i),this.resize(),i};Xc.prototype.addTrack=function(e,t,n,i){let r=new w8(e,t,n,i);return this._trackList.push(r),this._lastHeight=void 0,this.resize(),r};Xc.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=ee.secondsDifference(t,e),this._clock&&this._clock.clockRange!==jo.UNBOUNDED){let i=this._clock.startTime,r=this._clock.stopTime,o=ee.secondsDifference(r,i),s=ee.secondsDifference(i,this._startJulian),a=ee.secondsDifference(r,this._endJulian);this._timeBarSecondsSpan>=o?(this._timeBarSecondsSpan=o,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=ee.addSeconds(this._endJulian,s,new ee),this._startJulian=i,this._timeBarSecondsSpan=ee.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=ee.addSeconds(this._startJulian,a,new ee),this._endJulian=r,this._timeBarSecondsSpan=ee.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};Xc.prototype.zoomFrom=function(e){let t=ee.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(ee.addSeconds(this._startJulian,t-t*e,new ee),ee.addSeconds(this._endJulian,n*e-n,new ee))};function OX(e){return e<10?`0${e.toString()}`:e.toString()}Xc.prototype.makeLabel=function(e){let t=ee.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${LCt[t.month-1]} ${t.day} ${t.year} ${OX(t.hour)}:${OX(t.minute)}:${OX(t.second)}${i}`};Xc.prototype.smallestTicInPixels=7;Xc.prototype._makeTics=function(){let e=this._timeBarEle,t=ee.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,r,o=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,u=1e-10,f=0,d=this._timeBarSecondsSpan;d<a?(d=a,this._timeBarSecondsSpan=a,this._endJulian=ee.addSeconds(this._startJulian,a,new ee)):d>c&&(d=c,this._timeBarSecondsSpan=c,this._endJulian=ee.addSeconds(this._startJulian,c,new ee));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,m=Math.min(d/p*1e-5,.4),x,C=ee.toGregorianDate(g);d>31536e4?x=ee.fromDate(new Date(Date.UTC(Math.floor(C.year/100)*100,0))):d>31536e3?x=ee.fromDate(new Date(Date.UTC(Math.floor(C.year/10)*10,0))):d>86400?x=ee.fromDate(new Date(Date.UTC(C.year,0))):x=ee.fromDate(new Date(Date.UTC(C.year,C.month,C.day)));let A=ee.secondsDifference(this._startJulian,ee.addSeconds(x,m,new ee)),b=A+d;this._epochJulian=x;function T(V){return Math.floor(A/V)*V}function S(V,q){return Math.ceil(V/q+.5)*q}function w(V){return(V-A)/d}function D(V,q){return V-q*Math.round(V/q)}this._rulerEle.innerHTML=this.makeLabel(ee.addSeconds(this._endJulian,-a,new ee));let I=this._rulerEle.offsetWidth+20;I<30&&(I=180);let O=f;f-=u;let B={startTime:A,startJulian:g,epochJulian:x,duration:d,timeBarWidth:p,getAlpha:w};this._highlightRanges.forEach(function(V){s+=V.render(B)});let L=0,_=0,E=0,v=I/p;v>1&&(v=1),v*=this._timeBarSecondsSpan;let P=-1,R=-1,F=ey.length,U;for(U=0;U<F;++U){let V=ey[U];if(++P,L=V,V>v&&V>f)break;R<0&&p*(V/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(R=P)}if(P>0){for(;P>0;)if(--P,Math.abs(D(L,ey[P]))<1e-5){ey[P]>=f&&(_=ey[P]);break}if(R>=0)for(;R<P;){if(Math.abs(D(_,ey[R]))<1e-5&&ey[R]>=f){E=ey[R];break}++R}}f=O,f>u&&E<1e-5&&Math.abs(f-L)>u&&(E=f,f<=L+u&&(_=0));let k=-999999,H;if(p*(E/this._timeBarSecondsSpan)>=3)for(r=T(E);r<=b;r=S(r,E))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*w(r)).toString()}px;"></span>`;if(p*(_/this._timeBarSecondsSpan)>=3)for(r=T(_);r<=b;r=S(r,_))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*w(r)).toString()}px;"></span>`;if(p*(L/this._timeBarSecondsSpan)>=2){this._mainTicSpan=L,b+=L,r=T(L);let V=ee.computeTaiMinusUtc(x);for(;r<=b;){let q=ee.addSeconds(g,r-A,new ee);if(L>2.1){let $=ee.computeTaiMinusUtc(q);Math.abs($-V)>.1&&(r+=$-V,q=ee.addSeconds(g,r-A,new ee))}let j=Math.round(p*w(r)),X=this.makeLabel(q);this._rulerEle.innerHTML=X,H=this._rulerEle.offsetWidth,H<10&&(H=I);let G=j-(H/2-1);G>k?(k=G+H+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${j.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${G.toString()}px;">${X}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${j.toString()}px;"></span>`,r=S(r,L)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),B.y=0,this._trackList.forEach(function(V){V.render(o._context,B),B.y+=V.height})};Xc.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=ee.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(ee.addSeconds(this._startJulian,this._timelineDrag,new ee),ee.addSeconds(this._endJulian,this._timelineDrag,new ee)))};Xc.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=ee.addSeconds(this._startJulian,t,new ee),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function NCt(e){return function(t){e._mouseMode!==Gf.touchOnly&&(t.button===0?(e._mouseMode=Gf.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Gf.zoom:e._mouseMode=Gf.slide)),t.preventDefault()}}function FCt(e){return function(t){e._mouseMode=Gf.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function VCt(e){return function(t){let n;if(e._mouseMode===Gf.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===Gf.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(ee.addSeconds(e._startJulian,i,new ee),ee.addSeconds(e._endJulian,i,new ee))}}else e._mouseMode===Gf.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function kCt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;IX=Math.max(Math.min(Math.abs(n),IX),1),n/=IX,e.zoomFrom(Math.pow(1.05,-n))}}function UCt(e){return function(t){let n=t.touches.length,i,r,o=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Gf.touchOnly,n===1?(i=ee.secondsDifference(e._scrubJulian,e._startJulian),r=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+o),Math.abs(t.touches[0].clientX-r)<50?(e._touchMode=Yc.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=Yc.singleTap,e._touchState.centerX=t.touches[0].clientX-o)):n===2?(e._touchMode=Yc.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-o,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=Yc.ignore}}function zCt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===Yc.singleTap?(e._touchMode=Yc.scrub,e._onTouchMove(t)):e._touchMode===Yc.scrub&&e._onTouchMove(t),e._mouseMode=Gf.touchOnly,n!==1?e._touchMode=n>0?Yc.ignore:Yc.none:e._touchMode===Yc.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function HCt(e){return function(t){let n,i,r,o,s,a,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===Yc.singleTap&&(e._touchMode=Yc.slideZoom),e._mouseMode=Gf.touchOnly,e._touchMode===Yc.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===Yc.slideZoom&&(r=t.touches.length,r===2?(o=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):r===1&&(o=t.touches[0].clientX-u,s=0),l(o)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=ee.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-o*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new ee)):(n=e._touchState.centerX-o,a=ee.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new ee)),e.zoomTo(a,ee.addSeconds(a,e._timeBarSecondsSpan*c,new ee)),e._touchState.centerX=o,e._touchState.spanX=s))}}Xc.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var v8=Xc;function GCt(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function RAe(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function WCt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(RAe(),e._locked=!1),e._noSleep.disable(),Oo.exitFullscreen(),n(!1)):(Oo.fullscreen||Oo.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=GCt("landscape")),t.useWebVR=!0,n(!0)))}function D8(e,t){let n=this,i=xe.observable(Oo.enabled),r=xe.observable(!1);this.isVRMode=void 0,xe.defineProperty(this,"isVRMode",{get:function(){return r()}}),this.isVREnabled=void 0,xe.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&Oo.enabled)}}),this.tooltip=void 0,xe.defineProperty(this,"tooltip",function(){return i()?r()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let o=xe.observable(!1);this._isOrthographic=void 0,xe.defineProperty(this,"_isOrthographic",{get:function(){return o()}}),this._eventHelper=new Yo,this._eventHelper.add(e.preRender,function(){o(e.camera.frustum instanceof en)}),this._locked=!1,this._noSleep=new J1.default,this._command=An(function(){WCt(n,e,r,o)},xe.getObservable(this,"isVREnabled")),this._vrElement=y(Pn(t),document.body),this._callback=function(){!Oo.fullscreen&&r()&&(e.useWebVR=!1,n._locked&&(RAe(),n._locked=!1),n._noSleep.disable(),r(!1))},document.addEventListener(Oo.changeEventName,this._callback)}Object.defineProperties(D8.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});D8.prototype.isDestroyed=function(){return!1};D8.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(Oo.changeEventName,this._callback),ue(this)};var P8=D8;var jCt="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",qCt="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function I8(e,t,n){e=Pn(e);let i=new P8(t,n);i._exitVRPath=qCt,i._enterVRPath=jCt;let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-vrButton",r.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(r),xe.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(I8.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});I8.prototype.isDestroyed=function(){return!1};I8.prototype.destroy=function(){return this._viewModel.destroy(),xe.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var O8=I8;var ty=new re;function LAe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function YCt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let r=e.getProperty(i);l(r)&&(n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function XCt(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let o=i[t];/^name$/i.test(o)?n[0]=e.getProperty(o):/name/i.test(o)?n[1]=e.getProperty(o):/^title$/i.test(o)?n[2]=e.getProperty(o):/^(id|identifier)$/i.test(o)?n[3]=e.getProperty(o):/element/i.test(o)?n[4]=e.getProperty(o):/(id|identifier)$/i.test(o)&&(n[5]=e.getProperty(o))}let r=n.length;for(t=0;t<r;t++){let o=n[t];if(l(o)&&o!=="")return o}return"Unnamed Feature"}function MAe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=y(n.id,n.primitive.id);if(i instanceof uo)return i;if(n instanceof bo)return new uo({name:XCt(n),description:YCt(n),feature:n})}if(l(e.scene.globe))return ZCt(e,t.position)}var KCt=new ee;function NAe(e,t,n){if(l(n)){let i=n.clock;if(l(i)&&(i.getValue(t),l(e))){let r=i.startTime,o=i.stopTime;ee.equals(r,o)&&(o=ee.addSeconds(r,M.EPSILON2,KCt)),e.updateFromClock(),e.zoomTo(r,o)}}}var $Ct=new h;function ZCt(e,t){let n=e.scene,i=n.camera.getPickRay(t),r=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(r))return;let o=new uo({id:"Loading...",description:"Loading feature information..."});return r.then(function(s){if(e.selectedEntity!==o)return;if(!l(s)||s.length===0){e.selectedEntity=BAe();return}let a=s[0],c=new uo({id:a.name,description:a.description});if(l(a.position)){let u=e.scene.globe.ellipsoid.cartographicToCartesian(a.position,$Ct);c.position=new hl(u)}e.selectedEntity=c},function(){e.selectedEntity===o&&(e.selectedEntity=BAe())}),o}function BAe(){return new uo({id:"None",description:"No features found."})}function JCt(e,t){let n=e._geocoder,i=e._homeButton,r=e._sceneModePicker,o=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,d=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(f)&&(f.container.style.visibility=p),l(d)&&(d.container.style.visibility=p),e._container){let g=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function Di(e,t){e=Pn(e),t=y(t,y.EMPTY_OBJECT);let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,r=document.createElement("div");r.className="cesium-viewer",e.appendChild(r);let o=document.createElement("div");o.className="cesium-viewer-cesiumWidgetContainer",r.appendChild(o);let s=document.createElement("div");s.className="cesium-viewer-bottom",r.appendChild(s);let a=y(t.scene3DOnly,!1),c,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new Sh,u=new vz(c),f=!0),l(t.shouldAnimate)&&(c.shouldAnimate=t.shouldAnimate);let d=new Yz(o,{imageryProvider:n||l(t.imageryProvider)?!1:void 0,clock:c,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=t.dataSources,g=!1;l(p)||(p=new n3,g=!0);let m=d.scene,x=new b3({scene:m,dataSourceCollection:p}),C=new Yo;C.add(c.onTick,Di.prototype._onTick,this),C.add(m.morphStart,Di.prototype._clearTrackedObject,this);let A;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let j=document.createElement("div");j.className="cesium-viewer-selectionIndicatorContainer",r.appendChild(j),A=new E8(j,m)}let b;if(!l(t.infoBox)||t.infoBox!==!1){let j=document.createElement("div");j.className="cesium-viewer-infoBoxContainer",r.appendChild(j),b=new s8(j);let X=b.viewModel;C.add(X.cameraClicked,Di.prototype._onInfoBoxCameraClicked,this),C.add(X.closeClicked,Di.prototype._onInfoBoxClockClicked,this)}let T=document.createElement("div");T.className="cesium-viewer-toolbar",r.appendChild(T);let S;if(!l(t.geocoder)||t.geocoder!==!1){let j=document.createElement("div");j.className="cesium-viewer-geocoderContainer",T.appendChild(j);let X;l(t.geocoder)&&typeof t.geocoder!="boolean"&&(X=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),S=new e8({container:j,geocoderServices:X,scene:m}),C.add(S.viewModel.search.beforeExecute,Di.prototype._clearObjects,this)}let w;(!l(t.homeButton)||t.homeButton!==!1)&&(w=new i8(T,m),l(S)&&C.add(w.viewModel.command.afterExecute,function(){let j=S.viewModel;j.searchText="",j.isSearchInProgress&&j.search()}),C.add(w.viewModel.command.beforeExecute,Di.prototype._clearTrackedObject,this));let D;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(D=new C8(T,m));let I;t.projectionPicker&&(I=new _8(T,m));let O,B;if(n){let j=y(t.imageryProviderViewModels,Vz()),X=y(t.terrainProviderViewModels,kz());O=new Fz(T,{globe:m.globe,imageryProviderViewModels:j,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:X,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),B=T.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.imageryProvider)&&t.imageryProvider!==!1&&(n&&(O.viewModel.selectedImagery=void 0),m.imageryLayers.removeAll(),m.imageryLayers.addImageryProvider(t.imageryProvider)),l(t.terrainProvider)&&(n&&(O.viewModel.selectedTerrain=void 0),m.terrainProvider=t.terrainProvider);let L;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let j=!0;try{if(l(window.localStorage)){let X=window.localStorage.getItem("cesium-hasSeenNavHelp");l(X)&&Boolean(X)?j=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}L=new l8({container:T,instructionsInitiallyVisible:y(t.navigationInstructionsInitiallyVisible,j)})}let _;if(!l(t.animation)||t.animation!==!1){let j=document.createElement("div");j.className="cesium-viewer-animationContainer",r.appendChild(j),_=new Mz(j,new Bz(u))}let E;if(!l(t.timeline)||t.timeline!==!1){let j=document.createElement("div");j.className="cesium-viewer-timelineContainer",r.appendChild(j),E=new v8(j,c),E.addEventListener("settime",LAe,!1),E.zoomTo(c.startTime,c.stopTime)}let v,P,R;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(R=document.createElement("div"),R.className="cesium-viewer-fullscreenContainer",r.appendChild(R),v=new Zz(R,t.fullscreenElement),P=Pa(v.viewModel,"isFullscreenEnabled",function(j){R.style.display=j?"block":"none",l(E)&&(E.container.style.right=`${R.clientWidth}px`,E.resize())}));let F,U,k;if(t.vrButton){let j=document.createElement("div");j.className="cesium-viewer-vrContainer",r.appendChild(j),F=new O8(j,m,t.fullScreenElement),U=Pa(F.viewModel,"isVREnabled",function(X){j.style.display=X?"block":"none",l(v)&&(j.style.right=`${R.clientWidth}px`),l(E)&&(E.container.style.right=`${j.clientWidth}px`,E.resize())}),k=Pa(F.viewModel,"isVRMode",function(X){JCt(i,X)})}this._baseLayerPickerDropDown=B,this._fullscreenSubscription=P,this._vrSubscription=U,this._vrModeSubscription=k,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=y(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=s,this._element=r,this._cesiumWidget=d,this._selectionIndicator=A,this._infoBox=b,this._dataSourceCollection=p,this._destroyDataSourceCollection=g,this._dataSourceDisplay=x,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=T,this._homeButton=w,this._sceneModePicker=D,this._projectionPicker=I,this._baseLayerPicker=O,this._navigationHelpButton=L,this._animation=_,this._timeline=E,this._fullscreenButton=v,this._vrButton=F,this._geocoder=S,this._eventHelper=C,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=l(b)||l(A),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._selectedEntityChanged=new ge,this._trackedEntityChanged=new ge,xe.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),C.add(p.dataSourceAdded,Di.prototype._onDataSourceAdded,this),C.add(p.dataSourceRemoved,Di.prototype._onDataSourceRemoved,this),C.add(m.postUpdate,Di.prototype.resize,this),C.add(m.postRender,Di.prototype._postRender,this);let H=p.length;for(let j=0;j<H;j++)this._dataSourceAdded(p,p.get(j));this._dataSourceAdded(void 0,x.defaultDataSource),C.add(p.dataSourceAdded,Di.prototype._dataSourceAdded,this),C.add(p.dataSourceRemoved,Di.prototype._dataSourceRemoved,this);function V(j){let X=MAe(i,j);l(X)?Y.getValueOrUndefined(X.position,i.clock.currentTime)?i.trackedEntity=X:i.zoomTo(X):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function q(j){i.selectedEntity=MAe(i,j)}d.screenSpaceEventHandler.setInputAction(q,_n.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(V,_n.LEFT_DOUBLE_CLICK)}Object.defineProperties(Di.prototype,{container:{get:function(){return this._container}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,R8(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===te.COLUMBUS_VIEW||n===te.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===te.COLUMBUS_VIEW||n===te.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(N.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,NAe(this._timeline,this.clock,e))}}});Di.prototype.extend=function(e,t){e(this,t)};Di.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,r=l(this._animation),o=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let g=this._geocoder.searchSuggestionsContainer;g.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,u,f=0,d=0,p=0;if(r&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let g=this._lastWidth;u=this._animation.container,n>900?(f=169,g<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(g<600||g>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(g>600||g===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=f+5}if(o&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let g=this._fullscreenButton,m=this._vrButton,x=c.container,C=x.style;p=x.clientHeight+3,C.left=`${f}px`;let A=0;l(g)&&(A+=g.container.clientWidth),l(m)&&(A+=m.container.clientWidth),C.right=`${A}px`,c.resize()}this._bottomContainer.style.left=`${d}px`,this._bottomContainer.style.bottom=`${p}px`,this._lastWidth=n,this._lastHeight=i};Di.prototype.forceResize=function(){this._lastWidth=0,this.resize()};Di.prototype.render=function(){this._cesiumWidget.render()};Di.prototype.isDestroyed=function(){return!1};Di.prototype.destroy=function(){let e;this.screenSpaceEventHandler.removeInputAction(_n.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(_n.LEFT_DOUBLE_CLICK);let t=this.dataSources,n=t.length;for(e=0;e<n;e++)this._dataSourceRemoved(t,t.get(e));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",LAe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),ue(this)};Di.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Di.prototype._onEntityCollectionChanged,this)};Di.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Di.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};Di.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=n);let i=this._entityView;if(l(i)){let f=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(f,!1,ty)===st.DONE&&i.update(t,ty)}let r,o=!1,s=this.selectedEntity,a=l(s)&&this._enableInfoOrSelection;a&&s.isShowing&&s.isAvailable(t)&&(this._dataSourceDisplay.getBoundingSphere(s,!0,ty)!==st.FAILED?r=ty.center:l(s.position)&&(r=s.position.getValue(t,r)),o=l(r));let c=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(c)&&(c.position=h.clone(r,c.position),c.showSelection=a&&o,c.update());let u=l(this._infoBox)?this._infoBox.viewModel:void 0;l(u)&&(u.showInfo=a,u.enableCamera=o,u.isCameraTracking=this.trackedEntity===this.selectedEntity,a?(u.titleText=y(s.name,s.id),u.description=Y.getValueOrDefault(s.description,t,"")):(u.titleText="",u.description=""))};Di.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let r=0;r<i;r++){let o=n[r];this.trackedEntity===o&&(this.trackedEntity=void 0),this.selectedEntity===o&&(this.selectedEntity=void 0)}};Di.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};Di.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Di.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};Di.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};Di.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&NAe(this.timeline,this.clock,e)};Di.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Di.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Di.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let r=e.length;this._automaticallyTrackDataSourceClocks&&r>0?this.clockTrackedDataSource=e.get(r-1):this.clockTrackedDataSource=void 0}};Di.prototype.zoomTo=function(e,t){return FAe(this,e,{offset:t},!1)};Di.prototype.flyTo=function(e,t){return FAe(this,e,t,!0)};function FAe(e,t,n,i){R8(e);let r=new Promise(o=>{e._completeZoom=function(s){o(s)}});return e._zoomPromise=r,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(o){if(e._zoomPromise===r){if(o instanceof Nf){o.getViewableRectangle().then(function(s){return bE(s,e.scene)}).then(function(s){e._zoomPromise===r&&(e._zoomTarget=s)});return}if(o instanceof Cf){e._zoomTarget=o;return}if(o instanceof X1){e._zoomTarget=o;return}if(o.isLoading&&l(o.loadingEvent)){let s=o.loadingEvent.addEventListener(function(){s(),e._zoomPromise===r&&(e._zoomTarget=o.entities.values.slice(0))});return}if(Array.isArray(o)){e._zoomTarget=o.slice(0);return}o=y(o.values,o),l(o.entities)&&(o=o.entities.values),Array.isArray(o)?e._zoomTarget=o.slice(0):e._zoomTarget=[o]}}),e.scene.requestRender(),r}function nS(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function R8(e){let t=e._zoomPromise;l(t)&&(nS(e),e._completeZoom(!1))}Di.prototype._postRender=function(){QCt(this),eAt(this)};function QCt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===te.MORPHING)return;let n=e.scene,i=n.camera,r=y(e._zoomOptions,{}),o;if(t instanceof Cf)return t.readyPromise.then(function(){let u=t.boundingSphere;l(r.offset)||(r.offset=new ju(0,-.5,u.radius)),o={offset:r.offset,duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,o):(i.viewBoundingSphere(u,r.offset),i.lookAtTransform(N.IDENTITY),e._completeZoom(!0)),nS(e)}).catch(()=>{R8(e)});if(t instanceof X1)return t.readyPromise.then(function(){let u=t.boundingSphere;l(r.offset)||(r.offset=new ju(0,-.5,u.radius)),o={offset:r.offset,duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(u,o):(i.viewBoundingSphere(u,r.offset),i.lookAtTransform(N.IDENTITY),e._completeZoom(!0)),nS(e)});if(t instanceof me){o={destination:n.mapProjection.ellipsoid.cartographicToCartesian(t),duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(o):(i.setView(o),e._completeZoom(!0)),nS(e);return}let s=t,a=[];for(let u=0,f=s.length;u<f;u++){let d=e._dataSourceDisplay.getBoundingSphere(s[u],!1,ty);if(d===st.PENDING)return;d!==st.FAILED&&a.push(re.clone(ty))}if(a.length===0){R8(e);return}e.trackedEntity=void 0;let c=re.fromBoundingSpheres(a);e._zoomIsFlight?(nS(e),i.flyToBoundingSphere(c,{duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:r.offset})):(i.viewBoundingSphere(c,r.offset),i.lookAtTransform(N.IDENTITY),nS(e),e._completeZoom(!0))}function eAt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=Y.getValueOrUndefined(t.position,n);if(!l(i))return;let r=e.scene,o=e._dataSourceDisplay.getBoundingSphere(t,!1,ty);if(o===st.PENDING)return;let s=r.mode;(s===te.COLUMBUS_VIEW||s===te.SCENE2D)&&(r.screenSpaceCameraController.enableTranslate=!1),(s===te.COLUMBUS_VIEW||s===te.SCENE3D)&&(r.screenSpaceCameraController.enableTilt=!1);let a=o!==st.FAILED?ty:void 0;e._entityView=new w3(t,r,r.mapProjection.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var VAe=Di;function tAt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new Gz(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var kAe=tAt;function nAt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new qz(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var UAe=nAt;function iAt(e,t){t=y(t,y.EMPTY_OBJECT);let n=!0,i=y(t.flyToOnDrop,!0),r=new ge,o=y(t.clearOnDrop,!0),s=y(t.dropTarget,e.container),a=y(t.clampToGround,!0),c=t.proxy;s=Pn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){zAe(s,u),s=f,RX(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?RX(s,u):zAe(s,u),n=f)}},dropError:{get:function(){return r}},clearOnDrop:{get:function(){return o},set:function(f){o=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){NC(f),o&&(e.entities.removeAll(),e.dataSources.removeAll());let d=f.dataTransfer.files,p=d.length;for(let g=0;g<p;g++){let m=d[g],x=new FileReader;x.onload=rAt(e,m,c,a),x.onerror=oAt(e,m),x.readAsText(m)}}RX(s,u),e.destroy=iR(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function NC(e){e.stopPropagation(),e.preventDefault()}function zAe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",NC,!1),n.removeEventListener("dragover",NC,!1),n.removeEventListener("dragexit",NC,!1))}function RX(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",NC,!1),e.addEventListener("dragover",NC,!1),e.addEventListener("dragexit",NC,!1)}function rAt(e,t,n,i){let r=e.scene;return function(o){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=e3.load(JSON.parse(o.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=gV.load(JSON.parse(o.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=lk.load(t,{sourceUri:s,proxy:n,camera:r.camera,canvas:r.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=KV.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function oAt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var HAe=iAt;function sAt(e,t){t=y(t,y.EMPTY_OBJECT);let n=new d8({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var GAe=sAt;function aAt(e,t,n){let i;try{return i=e(t,n),i}catch(r){return Promise.reject(r)}}function cAt(e){let t;return function(n){let i=n.data,r=[],o={id:i.id,result:void 0,error:void 0};return Promise.resolve(aAt(e,i.parameters,r)).then(function(s){o.result=s}).catch(function(s){s instanceof Error?o.error={name:s.name,message:s.message,stack:s.stack}:o.error=s}).finally(function(){l(t)||(t=y(self.webkitPostMessage,self.postMessage)),i.canTransferArrayBuffer||(r.length=0);try{t(o,r)}catch(s){o.result=void 0,o.error=`postMessage failed with error: ${Gm(s)}
- with responseMessage: ${JSON.stringify(o)}`,t(o)}})}}var WAe=cAt;var lAt="1.96";0&&(module.exports={AlphaMode,AlphaPipelineStage,Animation,AnimationViewModel,Appearance,ApproximateTerrainHeights,ArcGISTiledElevationTerrainProvider,ArcGisMapServerImageryProvider,ArcType,ArticulationStageType,AssociativeArray,AttributeCompression,AttributeType,AutoExposure,Autolinker,AutomaticUniforms,Axis,AxisAlignedBoundingBox,B3dmLoader,B3dmParser,BaseLayerPicker,BaseLayerPickerViewModel,BatchTable,BatchTableHierarchy,BatchTexture,BatchTexturePipelineStage,Batched3DModel3DTileContent,Billboard,BillboardCollection,BillboardGraphics,BillboardVisualizer,BingMapsGeocoderService,BingMapsImageryProvider,BingMapsStyle,BlendEquation,BlendFunction,BlendOption,BlendingState,BoundingRectangle,BoundingSphere,BoundingSphereState,BoxEmitter,BoxGeometry,BoxGeometryUpdater,BoxGraphics,BoxOutlineGeometry,BrdfLutGenerator,Buffer,BufferLoader,BufferUsage,CPUStylingPipelineStage,CallbackProperty,Camera,CameraEventAggregator,CameraEventType,CameraFlightPath,Cartesian2,Cartesian3,Cartesian4,Cartographic,CartographicGeocoderService,CatmullRomSpline,Cesium3DContentGroup,Cesium3DTile,Cesium3DTileBatchTable,Cesium3DTileColorBlendMode,Cesium3DTileContent,Cesium3DTileContentFactory,Cesium3DTileContentState,Cesium3DTileContentType,Cesium3DTileFeature,Cesium3DTileFeatureTable,Cesium3DTileOptimizationHint,Cesium3DTileOptimizations,Cesium3DTilePass,Cesium3DTilePassState,Cesium3DTilePointFeature,Cesium3DTileRefine,Cesium3DTileStyle,Cesium3DTileStyleEngine,Cesium3DTilesInspector,Cesium3DTilesInspectorViewModel,Cesium3DTileset,Cesium3DTilesetCache,Cesium3DTilesetGraphics,Cesium3DTilesetHeatmap,Cesium3DTilesetMetadata,Cesium3DTilesetMostDetailedTraversal,Cesium3DTilesetStatistics,Cesium3DTilesetTraversal,Cesium3DTilesetVisualizer,CesiumInspector,CesiumInspectorViewModel,CesiumTerrainProvider,CesiumWidget,Check,CheckerboardMaterialProperty,CircleEmitter,CircleGeometry,CircleOutlineGeometry,ClassificationModel,ClassificationPrimitive,ClassificationType,ClearCommand,ClippingPlane,ClippingPlaneCollection,Clock,ClockRange,ClockStep,ClockViewModel,CloudCollection,CloudType,Color,ColorBlendMode,ColorGeometryInstanceAttribute,ColorMaterialProperty,Command,ComponentDatatype,Composite3DTileContent,CompositeEntityCollection,CompositeMaterialProperty,CompositePositionProperty,CompositeProperty,CompressedTextureBuffer,ComputeCommand,ComputeEngine,ConditionsExpression,ConeEmitter,ConstantPositionProperty,ConstantProperty,ConstantSpline,ContentMetadata,Context,ContextLimits,CoplanarPolygonGeometry,CoplanarPolygonGeometryLibrary,CoplanarPolygonOutlineGeometry,CornerType,CorridorGeometry,CorridorGeometryLibrary,CorridorGeometryUpdater,CorridorGraphics,CorridorOutlineGeometry,Credit,CreditDisplay,CubeMap,CubeMapFace,CubicRealPolynomial,CullFace,CullingVolume,CumulusCloud,CustomDataSource,CustomHeightmapTerrainProvider,CustomShader,CustomShaderMode,CustomShaderPipelineStage,CylinderGeometry,CylinderGeometryLibrary,CylinderGeometryUpdater,CylinderGraphics,CylinderOutlineGeometry,CzmlDataSource,DataSource,DataSourceClock,DataSourceCollection,DataSourceDisplay,DebugAppearance,DebugCameraPrimitive,DebugInspector,DebugModelMatrixPrimitive,DefaultProxy,DepthFunction,DepthPlane,DequantizationPipelineStage,DerivedCommand,DeveloperError,DeviceOrientationCameraController,DirectionalLight,DiscardEmptyTileImagePolicy,DiscardMissingTileImagePolicy,DistanceDisplayCondition,DistanceDisplayConditionGeometryInstanceAttribute,DoubleEndedPriorityQueue,DoublyLinkedList,DracoLoader,DrawCommand,DynamicGeometryBatch,DynamicGeometryUpdater,EarthOrientationParameters,EarthOrientationParametersSample,EasingFunction,EllipseGeometry,EllipseGeometryLibrary,EllipseGeometryUpdater,EllipseGraphics,EllipseOutlineGeometry,Ellipsoid,EllipsoidGeodesic,EllipsoidGeometry,EllipsoidGeometryUpdater,EllipsoidGraphics,EllipsoidOutlineGeometry,EllipsoidPrimitive,EllipsoidRhumbLine,EllipsoidSurfaceAppearance,EllipsoidTangentPlane,EllipsoidTerrainProvider,EllipsoidalOccluder,Empty3DTileContent,EncodedCartesian3,Entity,EntityCluster,EntityCollection,EntityView,Event,EventHelper,ExperimentalFeatures,Expression,ExpressionNodeType,ExtrapolationType,FeatureDetection,FeatureIdPipelineStage,Fog,ForEach,FrameRateMonitor,FrameState,Framebuffer,FramebufferManager,FrustumCommands,FrustumGeometry,FrustumOutlineGeometry,Fullscreen,FullscreenButton,FullscreenButtonViewModel,GeoJsonDataSource,GeoJsonLoader,GeocodeType,Geocoder,GeocoderService,GeocoderViewModel,GeographicProjection,GeographicTilingScheme,Geometry,Geometry3DTileContent,GeometryAttribute,GeometryAttributes,GeometryFactory,GeometryInstance,GeometryInstanceAttribute,GeometryOffsetAttribute,GeometryPipeline,GeometryPipelineStage,GeometryType,GeometryUpdater,GeometryVisualizer,GetFeatureInfoFormat,Globe,GlobeDepth,GlobeSurfaceShaderSet,GlobeSurfaceTile,GlobeSurfaceTileProvider,GlobeTranslucency,GlobeTranslucencyFramebuffer,GlobeTranslucencyState,GltfBufferViewLoader,GltfDracoLoader,GltfImageLoader,GltfIndexBufferLoader,GltfJsonLoader,GltfLoader,GltfLoaderUtil,GltfStructuralMetadataLoader,GltfTextureLoader,GltfVertexBufferLoader,GoogleEarthEnterpriseImageryProvider,GoogleEarthEnterpriseMapsProvider,GoogleEarthEnterpriseMetadata,GoogleEarthEnterpriseTerrainData,GoogleEarthEnterpriseTerrainProvider,GoogleEarthEnterpriseTileInformation,GpxDataSource,GregorianDate,GridImageryProvider,GridMaterialProperty,GroundGeometryUpdater,GroundPolylineGeometry,GroundPolylinePrimitive,GroundPrimitive,GroupMetadata,HeadingPitchRange,HeadingPitchRoll,Heap,HeightReference,HeightmapEncoding,HeightmapTerrainData,HeightmapTessellator,HermitePolynomialApproximation,HermiteSpline,HilbertOrder,HomeButton,HomeButtonViewModel,HorizontalOrigin,I3dmLoader,I3dmParser,Iau2000Orientation,Iau2006XysData,Iau2006XysSample,IauOrientationAxes,IauOrientationParameters,ImageBasedLighting,ImageBasedLightingPipelineStage,ImageMaterialProperty,Imagery,ImageryLayer,ImageryLayerCollection,ImageryLayerFeatureInfo,ImageryProvider,ImageryState,Implicit3DTileContent,ImplicitAvailabilityBitstream,ImplicitMetadataView,ImplicitSubdivisionScheme,ImplicitSubtree,ImplicitSubtreeMetadata,ImplicitTileCoordinates,ImplicitTileset,IndexDatatype,InfoBox,InfoBoxViewModel,InspectorShared,InstanceAttributeSemantic,Instanced3DModel3DTileContent,InstancingPipelineStage,InterpolationAlgorithm,InterpolationType,Intersect,IntersectionTests,Intersections2D,Interval,InvertClassification,Ion,IonGeocoderService,IonImageryProvider,IonResource,IonWorldImageryStyle,Iso8601,JobScheduler,JobType,JsonMetadataTable,JulianDate,KTX2Transcoder,KeyboardEventModifier,KmlCamera,KmlDataSource,KmlLookAt,KmlTour,KmlTourFlyTo,KmlTourWait,Label,LabelCollection,LabelGraphics,LabelStyle,LabelVisualizer,LagrangePolynomialApproximation,LeapSecond,Light,LightingModel,LightingPipelineStage,LinearApproximation,LinearSpline,ManagedArray,MapMode2D,MapProjection,MapboxImageryProvider,MapboxStyleImageryProvider,Mars3DEx,Material,MaterialAppearance,MaterialPipelineStage,MaterialProperty,Math,Matrix2,Matrix3,Matrix4,MetadataClass,MetadataClassProperty,MetadataComponentType,MetadataEntity,MetadataEnum,MetadataEnumValue,MetadataPipelineStage,MetadataSchema,MetadataSchemaLoader,MetadataSemantic,MetadataTable,MetadataTableProperty,MetadataType,MipmapHint,Model,ModelAlphaOptions,ModelAnimation,ModelAnimationCache,ModelAnimationCollection,ModelAnimationLoop,ModelAnimationState,ModelClippingPlanesPipelineStage,ModelColorPipelineStage,ModelComponents,ModelExperimental,ModelExperimental3DTileContent,ModelExperimentalAnimation,ModelExperimentalAnimationChannel,ModelExperimentalAnimationCollection,ModelExperimentalArticulation,ModelExperimentalArticulationStage,ModelExperimentalDrawCommand,ModelExperimentalNode,ModelExperimentalRuntimeNode,ModelExperimentalRuntimePrimitive,ModelExperimentalSceneGraph,ModelExperimentalSkin,ModelExperimentalStatistics,ModelExperimentalType,ModelExperimentalUtility,ModelFeature,ModelFeatureTable,ModelGraphics,ModelInstance,ModelInstanceCollection,ModelLightingOptions,ModelLoadResources,ModelMaterial,ModelMatrixUpdateStage,ModelMesh,ModelNode,ModelOutlineLoader,ModelRenderResources,ModelSilhouettePipelineStage,ModelSplitterPipelineStage,ModelUtility,ModelVisualizer,Moon,MorphTargetsPipelineStage,MorphWeightSpline,MortonOrder,Multiple3DTileContent,MultisampleFramebuffer,NavigationHelpButton,NavigationHelpButtonViewModel,NearFarScalar,NeverTileDiscardPolicy,NodeRenderResources,NodeStatisticsPipelineStage,NodeTransformationProperty,OIT,Occluder,OctahedralProjectedCubeMap,OffsetGeometryInstanceAttribute,OpenCageGeocoderService,OpenStreetMapImageryProvider,OrderedGroundPrimitiveCollection,OrientedBoundingBox,OrthographicFrustum,OrthographicOffCenterFrustum,Packable,PackableForInterpolation,Particle,ParticleBurst,ParticleEmitter,ParticleSystem,Pass,PassState,PathGraphics,PathVisualizer,PeliasGeocoderService,PerInstanceColorAppearance,PerformanceDisplay,PerformanceWatchdog,PerformanceWatchdogViewModel,PerspectiveFrustum,PerspectiveOffCenterFrustum,PickDepth,PickDepthFramebuffer,PickFramebuffer,Picking,PickingPipelineStage,PinBuilder,PixelDatatype,PixelFormat,Plane,PlaneGeometry,PlaneGeometryUpdater,PlaneGraphics,PlaneOutlineGeometry,PntsLoader,PntsParser,PointCloud,PointCloud3DTileContent,PointCloudEyeDomeLighting,PointCloudShading,PointCloudStylingPipelineStage,PointGraphics,PointPrimitive,PointPrimitiveCollection,PointVisualizer,PolygonGeometry,PolygonGeometryLibrary,PolygonGeometryUpdater,PolygonGraphics,PolygonHierarchy,PolygonOutlineGeometry,PolygonPipeline,Polyline,PolylineArrowMaterialProperty,PolylineCollection,PolylineColorAppearance,PolylineDashMaterialProperty,PolylineGeometry,PolylineGeometryUpdater,PolylineGlowMaterialProperty,PolylineGraphics,PolylineMaterialAppearance,PolylineOutlineMaterialProperty,PolylinePipeline,PolylineVisualizer,PolylineVolumeGeometry,PolylineVolumeGeometryLibrary,PolylineVolumeGeometryUpdater,PolylineVolumeGraphics,PolylineVolumeOutlineGeometry,PositionProperty,PositionPropertyArray,PostProcessStage,PostProcessStageCollection,PostProcessStageComposite,PostProcessStageLibrary,PostProcessStageSampleMode,PostProcessStageTextureCache,Primitive,PrimitiveCollection,PrimitiveLoadPlan,PrimitiveOutlineGenerator,PrimitiveOutlinePipelineStage,PrimitivePipeline,PrimitiveRenderResources,PrimitiveState,PrimitiveStatisticsPipelineStage,PrimitiveType,ProjectionPicker,ProjectionPickerViewModel,Property,PropertyArray,PropertyAttribute,PropertyAttributeProperty,PropertyBag,PropertyTable,PropertyTexture,PropertyTextureProperty,ProviderViewModel,Proxy,QuadraticRealPolynomial,QuadtreeOccluders,QuadtreePrimitive,QuadtreeTile,QuadtreeTileLoadState,QuadtreeTileProvider,QuantizedMeshTerrainData,QuarticRealPolynomial,Quaternion,QuaternionSpline,Queue,Ray,Rectangle,RectangleCollisionChecker,RectangleGeometry,RectangleGeometryLibrary,RectangleGeometryUpdater,RectangleGraphics,RectangleOutlineGeometry,ReferenceFrame,ReferenceProperty,RenderState,Renderbuffer,RenderbufferFormat,Request,RequestErrorEvent,RequestScheduler,RequestState,RequestType,Resource,ResourceCache,ResourceCacheKey,ResourceCacheStatistics,ResourceLoader,ResourceLoaderState,Rotation,RuntimeError,S2Cell,SDFSettings,SampledPositionProperty,SampledProperty,Sampler,ScaledPositionProperty,Scene,SceneFramebuffer,SceneMode,SceneMode2DPipelineStage,SceneModePicker,SceneModePickerViewModel,SceneTransforms,SceneTransitioner,ScreenSpaceCameraController,ScreenSpaceEventHandler,ScreenSpaceEventType,SelectedFeatureIdPipelineStage,SelectionIndicator,SelectionIndicatorViewModel,ShaderBuilder,ShaderCache,ShaderDestination,ShaderFunction,ShaderProgram,ShaderSource,ShaderStruct,ShadowMap,ShadowMapShader,ShadowMode,ShadowVolumeAppearance,ShowGeometryInstanceAttribute,Simon1994PlanetaryPositions,SimplePolylineGeometry,SingleTileImageryProvider,SkinningPipelineStage,SkyAtmosphere,SkyBox,SphereEmitter,SphereGeometry,SphereOutlineGeometry,Spherical,Spline,SplitDirection,Splitter,StaticGeometryColorBatch,StaticGeometryPerMaterialBatch,StaticGroundGeometryColorBatch,StaticGroundGeometryPerMaterialBatch,StaticGroundPolylinePerMaterialBatch,StaticOutlineGeometryBatch,StencilConstants,StencilFunction,StencilOperation,SteppedSpline,StripeMaterialProperty,StripeOrientation,StructuralMetadata,StyleCommandsNeeded,StyleExpression,Sun,SunLight,SunPostProcess,SupportedImageFormats,SvgPathBindingHandler,TaskProcessor,TerrainData,TerrainEncoding,TerrainExaggeration,TerrainFillMesh,TerrainMesh,TerrainOffsetProperty,TerrainProvider,TerrainQuantization,TerrainState,Texture,TextureAtlas,TextureCache,TextureMagnificationFilter,TextureManager,TextureMinificationFilter,TextureUniform,TextureWrap,TileAvailability,TileBoundingRegion,TileBoundingS2Cell,TileBoundingSphere,TileBoundingVolume,TileCoordinatesImageryProvider,TileDiscardPolicy,TileEdge,TileImagery,TileMapServiceImageryProvider,TileMetadata,TileOrientedBoundingBox,TileProviderError,TileReplacementQueue,TileSelectionResult,TileState,Tileset3DTileContent,TilesetMetadata,TilingScheme,TimeConstants,TimeDynamicImagery,TimeDynamicPointCloud,TimeInterval,TimeIntervalCollection,TimeIntervalCollectionPositionProperty,TimeIntervalCollectionProperty,TimeStandard,Timeline,TimelineHighlightRange,TimelineTrack,Tipsify,ToggleButtonViewModel,Tonemapper,Transforms,TranslationRotationScale,TranslucentTileClassification,TridiagonalSystemSolver,TrustedServers,Tween,TweenCollection,UniformState,UniformType,Uri,UrlTemplateImageryProvider,VERSION,VRButton,VRButtonViewModel,VRTheWorldTerrainProvider,VaryingType,Vector3DTileBatch,Vector3DTileClampedPolylines,Vector3DTileContent,Vector3DTileGeometry,Vector3DTilePoints,Vector3DTilePolygons,Vector3DTilePolylines,Vector3DTilePrimitive,VelocityOrientationProperty,VelocityVectorProperty,VertexArray,VertexArrayFacade,VertexAttributeSemantic,VertexFormat,VerticalOrigin,VideoSynchronizer,View,Viewer,ViewportQuad,Visibility,Visualizer,VulkanConstants,WallGeometry,WallGeometryLibrary,WallGeometryUpdater,WallGraphics,WallOutlineGeometry,WebGLConstants,WebMapServiceImageryProvider,WebMapTileServiceImageryProvider,WebMercatorProjection,WebMercatorTilingScheme,WindingOrder,WireframeIndexGenerator,WireframePipelineStage,_shadersAcesTonemappingStage,_shadersAdditiveBlend,_shadersAdjustTranslucentFS,_shadersAllMaterialAppearanceFS,_shadersAllMaterialAppearanceVS,_shadersAmbientOcclusionGenerate,_shadersAmbientOcclusionModulate,_shadersAspectRampMaterial,_shadersAtmosphereCommon,_shadersBasicMaterialAppearanceFS,_shadersBasicMaterialAppearanceVS,_shadersBillboardCollectionFS,_shadersBillboardCollectionVS,_shadersBlackAndWhite,_shadersBloomComposite,_shadersBrdfLutGeneratorFS,_shadersBrightPass,_shadersBrightness,_shadersBumpMapMaterial,_shadersCPUStylingStageFS,_shadersCPUStylingStageVS,_shadersCheckerboardMaterial,_shadersCloudCollectionFS,_shadersCloudCollectionVS,_shadersCloudNoiseFS,_shadersCloudNoiseVS,_shadersCompareAndPackTranslucentDepth,_shadersCompositeOITFS,_shadersCompositeTranslucentClassification,_shadersContrastBias,_shadersCustomShaderStageFS,_shadersCustomShaderStageVS,_shadersCzmBuiltins,_shadersDepthOfField,_shadersDepthPlaneFS,_shadersDepthPlaneVS,_shadersDepthView,_shadersDepthViewPacked,_shadersDotMaterial,_shadersEdgeDetection,_shadersElevationBandMaterial,_shadersElevationContourMaterial,_shadersElevationRampMaterial,_shadersEllipsoidFS,_shadersEllipsoidSurfaceAppearanceFS,_shadersEllipsoidSurfaceAppearanceVS,_shadersEllipsoidVS,_shadersFXAA,_shadersFXAA3_11,_shadersFadeMaterial,_shadersFeatureIdStageFS,_shadersFeatureIdStageVS,_shadersFilmicTonemapping,_shadersGaussianBlur1D,_shadersGeometryStageFS,_shadersGeometryStageVS,_shadersGlobeFS,_shadersGlobeVS,_shadersGridMaterial,_shadersGroundAtmosphere,_shadersHSBToRGB,_shadersHSLToRGB,_shadersImageBasedLightingStageFS,_shadersInstancingStageCommon,_shadersInstancingStageVS,_shadersLegacyInstancingStageVS,_shadersLensFlare,_shadersLightingStageFS,_shadersMaterialStageFS,_shadersMetadataStageFS,_shadersMetadataStageVS,_shadersModelClippingPlanesStageFS,_shadersModelColorStageFS,_shadersModelExperimentalFS,_shadersModelExperimentalVS,_shadersModelSilhouetteStageFS,_shadersModelSilhouetteStageVS,_shadersModelSplitterStageFS,_shadersModifiedReinhardTonemapping,_shadersMorphTargetsStageVS,_shadersNightVision,_shadersNormalMapMaterial,_shadersOctahedralProjectionAtlasFS,_shadersOctahedralProjectionFS,_shadersOctahedralProjectionVS,_shadersPassThrough,_shadersPassThroughDepth,_shadersPerInstanceColorAppearanceFS,_shadersPerInstanceColorAppearanceVS,_shadersPerInstanceFlatColorAppearanceFS,_shadersPerInstanceFlatColorAppearanceVS,_shadersPointCloudEyeDomeLighting,_shadersPointCloudStylingStageVS,_shadersPointPrimitiveCollectionFS,_shadersPointPrimitiveCollectionVS,_shadersPolylineArrowMaterial,_shadersPolylineColorAppearanceVS,_shadersPolylineCommon,_shadersPolylineDashMaterial,_shadersPolylineFS,_shadersPolylineGlowMaterial,_shadersPolylineMaterialAppearanceVS,_shadersPolylineOutlineMaterial,_shadersPolylineShadowVolumeFS,_shadersPolylineShadowVolumeMorphFS,_shadersPolylineShadowVolumeMorphVS,_shadersPolylineShadowVolumeVS,_shadersPolylineVS,_shadersPrimitiveOutlineStageFS,_shadersPrimitiveOutlineStageVS,_shadersRGBToHSB,_shadersRGBToHSL,_shadersRGBToXYZ,_shadersReinhardTonemapping,_shadersReprojectWebMercatorFS,_shadersReprojectWebMercatorVS,_shadersRimLightingMaterial,_shadersSelectedFeatureIdStageCommon,_shadersShadowVolumeAppearanceFS,_shadersShadowVolumeAppearanceVS,_shadersShadowVolumeFS,_shadersSilhouette,_shadersSkinningStageVS,_shadersSkyAtmosphereCommon,_shadersSkyAtmosphereFS,_shadersSkyAtmosphereVS,_shadersSkyBoxFS,_shadersSkyBoxVS,_shadersSlopeRampMaterial,_shadersStripeMaterial,_shadersSunFS,_shadersSunTextureFS,_shadersSunVS,_shadersTexturedMaterialAppearanceFS,_shadersTexturedMaterialAppearanceVS,_shadersVector3DTileClampedPolylinesFS,_shadersVector3DTileClampedPolylinesVS,_shadersVector3DTilePolylinesVS,_shadersVectorTileVS,_shadersViewportQuadFS,_shadersViewportQuadVS,_shadersWater,_shadersXYZToRGB,_shadersacesTonemapping,_shadersalphaWeight,_shadersantialias,_shadersapproximateSphericalCoordinates,_shadersbackFacing,_shadersbranchFreeTernary,_shaderscascadeColor,_shaderscascadeDistance,_shaderscascadeMatrix,_shaderscascadeWeights,_shaderscolumbusViewMorph,_shaderscomputePosition,_shaderscosineAndSine,_shadersdecompressTextureCoordinates,_shadersdefaultPbrMaterial,_shadersdegreesPerRadian,_shadersdepthClamp,_shadersdepthRange,_shadersdepthRangeStruct,_shaderseastNorthUpToEyeCoordinates,_shadersellipsoidContainsPoint,_shadersellipsoidWgs84TextureCoordinates,_shadersepsilon1,_shadersepsilon2,_shadersepsilon3,_shadersepsilon4,_shadersepsilon5,_shadersepsilon6,_shadersepsilon7,_shadersequalsEpsilon,_shaderseyeOffset,_shaderseyeToWindowCoordinates,_shadersfastApproximateAtan,_shadersfog,_shadersfromCartesian,_shadersgammaCorrect,_shadersgeodeticSurfaceNormal,_shadersgetDefaultMaterial,_shadersgetFloodRect,_shadersgetIndexMat,_shadersgetLambertDiffuse,_shadersgetMaxIndex,_shadersgetMaxIndexVal,_shadersgetSpecular,_shadersgetWaterNoise,_shadershue,_shadersinfinity,_shadersinverseGamma,_shadersisEmpty,_shadersisFull,_shadersisInEllipsoid,_shadersisInObliq,_shaderslatitudeToWebMercatorFraction,_shaderslineDistance,_shaderslinearToSrgb,_shadersluminance,_shadersmagnitude,_shadersmagnitudeSquared,_shadersmaterial,_shadersmaterialInput,_shadersmetersPerPixel,_shadersmodelMaterial,_shadersmodelToWindowCoordinates,_shadersmodelVertexOutput,_shadersmultiplyComponents,_shadersmultiplyWithColorBalance,_shadersnearFarScalar,_shadersoctDecode,_shadersoneOverPi,_shadersoneOverTwoPi,_shaderspackDepth,_shaderspassCesium3DTile,_shaderspassCesium3DTileClassification,_shaderspassCesium3DTileClassificationIgnoreShow,_shaderspassClassification,_shaderspassCompute,_shaderspassEnvironment,_shaderspassGlobe,_shaderspassOpaque,_shaderspassOverlay,_shaderspassTerrainClassification,_shaderspassTranslucent,_shaderspbrLighting,_shaderspbrMetallicRoughnessMaterial,_shaderspbrParameters,_shaderspbrSpecularGlossinessMaterial,_shadersphong,_shaderspi,_shaderspiOverFour,_shaderspiOverSix,_shaderspiOverThree,_shaderspiOverTwo,_shadersplaneDistance,_shaderspointAlongRay,_shadersradiansPerDegree,_shadersray,_shadersrayEllipsoidIntersectionInterval,_shadersraySegment,_shadersraySphereIntersectionInterval,_shadersreadDepth,_shadersreadNonPerspective,_shadersreverseLogDepth,_shadersround,_shaderssampleOctahedralProjection,_shaderssaturation,_shadersscaleToGeodeticSurface,_shaderssceneMode2D,_shaderssceneMode3D,_shaderssceneModeColumbusView,_shaderssceneModeMorphing,_shadersshadowDepthCompare,_shadersshadowParameters,_shadersshadowVisibility,_shaderssignNotZero,_shaderssolarRadius,_shaderssphericalHarmonics,_shaderssrgbToLinear,_shaderstangentToEyeSpaceMatrix,_shadersthreePiOver2,_shaderstransformPlane,_shaderstranslateRelativeToEye,_shaderstranslucentPhong,_shaderstranspose,_shaderstwoPi,_shadersunpackDepth,_shadersunpackFloat,_shadersunpackUint,_shadersvalueTransform,_shadersvertexLogDepth,_shaderswebMercatorMaxLatitude,_shaderswindowToEyeCoordinates,_shaderswriteDepthClamp,_shaderswriteLogDepth,_shaderswriteNonPerspective,addBuffer,addDefaults,addExtensionsRequired,addExtensionsUsed,addPipelineExtras,addToArray,appendForwardSlash,arrayRemoveDuplicates,barycentricCoordinates,binarySearch,bitmap_sdf,buildDrawCommand,buildModuleUrl,cancelAnimationFrame,clone,combine,computeFlyToLocationForRectangle,createBillboardPointCallback,createCommand,createDefaultImageryProviderViewModels,createDefaultTerrainProviderViewModels,createElevationBandMaterial,createGuid,createMaterialPropertyDescriptor,createOsmBuildings,createPropertyDescriptor,createRawPropertyDescriptor,createTangentSpaceDebugPrimitive,createTaskProcessorWorker,createUniform,createUniformArray,createWorldImagery,createWorldTerrain,decodeGoogleEarthEnterpriseData,decodeVectorPolylinePositions,defaultValue,defer,defined,deprecationWarning,destroyObject,dompurify,earcut,exportKml,findAccessorMinMax,findContentMetadata,findGroupMetadata,findTileMetadata,forEachTextureInMaterial,formatError,freezeRenderState,getAbsoluteUri,getAccessorByteStride,getBaseUri,getBinaryAccessor,getClipAndStyleCode,getClippingFunction,getComponentReader,getElement,getExtensionFromUri,getFilenameFromUri,getImageFromTypedArray,getImagePixels,getJsonFromTypedArray,getMagic,getStringFromTypedArray,getTimestamp,grapheme_splitter,hasExtension,heightReferenceOnEntityPropertyChanged,isBitSet,isBlobUri,isCrossOriginUrl,isDataUri,isLeapYear,jsep,kdbush,knockout,knockout_3_5_1,knockout_es5,ktx_parse,lerc,loadAndExecuteScript,loadCubeMap,loadImageFromTypedArray,loadKTX2,mergeSort,mersenne_twister,meshoptimizer,modernizeShader,moveTechniqueRenderStates,moveTechniquesToExtension,nosleep,numberOfComponentsForType,objectToQuery,oneTimeWarning,pako,parseBatchTable,parseBoundingVolumeSemantics,parseFeatureMetadataLegacy,parseGlb,parseResponseHeaders,parseStructuralMetadata,pointInsideTriangle,preprocess3DTileContent,processModelMaterialsCommon,processPbrMaterials,protobufjs,queryToObject,rbush,readAccessorPacked,removeExtensionsRequired,removeExtensionsUsed,removePipelineExtras,removeUnusedElements,requestAnimationFrame,resizeImageToNextPowerOfTwo,sampleTerrain,sampleTerrainMostDetailed,scaleToGeodeticSurface,subdivideArray,subscribeAndEvaluate,topojson,updateAccessorComponentTypes,updateVersion,usesExtension,viewerCesium3DTilesInspectorMixin,viewerCesiumInspectorMixin,viewerDragDropMixin,viewerPerformanceWatchdogMixin,webGLConstantToGlslType,wrapFunction,writeTextToCanvas,zip});
|